src/gui/painting/qtextureglyphcache_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    74 
    74 
    75 class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache
    75 class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache
    76 {
    76 {
    77 public:
    77 public:
    78     QTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix)
    78     QTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix)
    79         : QFontEngineGlyphCache(matrix), m_w(0), m_h(0), m_cx(0), m_cy(0), m_type(type) { }
    79         : QFontEngineGlyphCache(matrix, type), m_w(0), m_h(0), m_cx(0), m_cy(0) { }
    80 
    80 
    81     virtual ~QTextureGlyphCache() { }
    81     virtual ~QTextureGlyphCache() { }
    82 
    82 
    83     struct Coord {
    83     struct Coord {
    84         int x;
    84         int x;
    95                   const QVarLengthArray<QFixedPoint> &positions);
    95                   const QVarLengthArray<QFixedPoint> &positions);
    96 
    96 
    97     virtual void createTextureData(int width, int height) = 0;
    97     virtual void createTextureData(int width, int height) = 0;
    98     virtual void resizeTextureData(int width, int height) = 0;
    98     virtual void resizeTextureData(int width, int height) = 0;
    99     virtual int glyphMargin() const { return 0; }
    99     virtual int glyphMargin() const { return 0; }
   100 
       
   101     QFontEngineGlyphCache::Type cacheType() const { return m_type; }
       
   102 
   100 
   103     virtual void fillTexture(const Coord &coord, glyph_t glyph) = 0;
   101     virtual void fillTexture(const Coord &coord, glyph_t glyph) = 0;
   104 
   102 
   105     inline void createCache(int width, int height) {
   103     inline void createCache(int width, int height) {
   106         m_w = width;
   104         m_w = width;
   119 
   117 
   120     int m_w; // image width
   118     int m_w; // image width
   121     int m_h; // image height
   119     int m_h; // image height
   122     int m_cx; // current x
   120     int m_cx; // current x
   123     int m_cy; // current y
   121     int m_cy; // current y
   124     QFontEngineGlyphCache::Type m_type;
       
   125 };
   122 };
   126 
   123 
   127 
   124 
   128 class QImageTextureGlyphCache : public QTextureGlyphCache
   125 class QImageTextureGlyphCache : public QTextureGlyphCache
   129 {
   126 {