diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-08-21 14:29:44 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 13:05:08 (GMT) |
commit | bf919e06127962836a6b566bf119cf248c6a999b (patch) | |
tree | 789ca79fa342cf741513cb21e6d4d3728345a511 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | |
parent | 7fbffd29e5904151a3a249004031d0502a16f4fc (diff) | |
download | Qt-bf919e06127962836a6b566bf119cf248c6a999b.zip Qt-bf919e06127962836a6b566bf119cf248c6a999b.tar.gz Qt-bf919e06127962836a6b566bf119cf248c6a999b.tar.bz2 |
Implement drawStaticTextItem() in OpenGL paint engines
The OpenGL and OpenGL2 engines now have support for static text, as
well as the QEmulationPaintEngine.
Also contains an optimization: Instead of passing both the position and
glyph positions to drawStaticTextItem() we add the position into the
glyph position and update it only when it changes. Otherwise we would
have to do this work in all engines for every call. This means we have
to cache the position in QStaticTextPrivate as well, but it seems like
a small price to pay, since it's a per-text overhead and only 16 bytes.
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index ce1b538..b683b8b 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -133,6 +133,7 @@ public: virtual void stroke(const QVectorPath &path, const QPen &pen); virtual void clip(const QVectorPath &path, Qt::ClipOperation op); + virtual void drawStaticTextItem(QStaticTextItem *textItem); Type type() const { return OpenGL2; } @@ -194,7 +195,7 @@ public: void stroke(const QVectorPath &path, const QPen &pen); void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false); void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints); - void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti); + void drawCachedGlyphs(QStaticTextItem *staticTextItem); // Calls glVertexAttributePointer if the pointer has changed inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer); |