summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengineex_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-08-17 11:09:51 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:54:04 (GMT)
commit91e96d6c730aac4accef64e5eaab1b289939ef8e (patch)
tree23a5303b53c29f3ec0ec24fccff176ef76fdc1f0 /src/gui/painting/qpaintengineex_p.h
parent49dfc4ed6a89cdd7377e4b88236bb7303fdfdc15 (diff)
downloadQt-91e96d6c730aac4accef64e5eaab1b289939ef8e.zip
Qt-91e96d6c730aac4accef64e5eaab1b289939ef8e.tar.gz
Qt-91e96d6c730aac4accef64e5eaab1b289939ef8e.tar.bz2
Optimize QStaticText for space
By caching the results of getGlyphPositions() we can make a code path in the critical paint engines which is optimal both in space and speed. The engines where speed is of less importance (pdf engine etc.) which may need more information, we choose the slower code path of drawText() which lays out the text again. We should have optimal paths in raster, vg and GL2 paint engines. The others are less important. Memory consumption of static text is now 14 bytes per glyph, 8 bytes per item and a static overhead of 40 bytes per QStaticText object.
Diffstat (limited to 'src/gui/painting/qpaintengineex_p.h')
-rw-r--r--src/gui/painting/qpaintengineex_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index fccd1dc..4096907 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -70,6 +70,7 @@ QT_MODULE(Gui)
class QPainterState;
class QPaintEngineExPrivate;
+class QStaticTextItem;
struct StrokeHandler;
struct QIntRect {
@@ -200,6 +201,8 @@ public:
virtual void updateState(const QPaintEngineState &state);
+ virtual void drawStaticTextItem(const QPointF &position, QStaticTextItem *item);
+
virtual void setState(QPainterState *s);
inline QPainterState *state() { return static_cast<QPainterState *>(QPaintEngine::state); }
inline const QPainterState *state() const { return static_cast<const QPainterState *>(QPaintEngine::state); }