summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-18 14:07:31 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:45:16 (GMT)
commit5d0f93a3d6d3d99d86d181ee3cc559a6782be4ee (patch)
tree3f8a7a1584c6dd40fb726f47cd6bd32f87967311 /src/gui/painting/qpainter.h
parentb6b3f7b60ac3a59bc083e38e78b087b20f003bb6 (diff)
downloadQt-5d0f93a3d6d3d99d86d181ee3cc559a6782be4ee.zip
Qt-5d0f93a3d6d3d99d86d181ee3cc559a6782be4ee.tar.gz
Qt-5d0f93a3d6d3d99d86d181ee3cc559a6782be4ee.tar.bz2
Introduce QStaticText API
Much of the time in drawText() is used on text layouting, which is wasted time when the text is not updated every frame. QStaticText is meant to cache the relevant parts of this work. It currently uses a copy-paste of the layout code in QPainter::drawText() and 99% of the time in QPainter::drawStaticText() is spent in drawTextItem(). We can use QTextLayout here instead without losing much.
Diffstat (limited to 'src/gui/painting/qpainter.h')
-rw-r--r--src/gui/painting/qpainter.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index ffddcba..f2be36f 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -50,6 +50,7 @@
#include <QtGui/qimage.h>
#include <QtGui/qtextoption.h>
#include <QtGui/qdrawutil.h>
+#include <QtGui/qstatictext.h>
#ifndef QT_INCLUDE_COMPAT
#include <QtGui/qpolygon.h>
@@ -369,6 +370,8 @@ public:
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;
+ void drawStaticText(const QPointF &p, const QStaticText &staticText);
+
void drawText(const QPointF &p, const QString &s);
inline void drawText(const QPoint &p, const QString &s);
inline void drawText(int x, int y, const QString &s);