summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/declarative/painting/paintbenchmark.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-02-17 23:31:53 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-02-17 23:31:53 (GMT)
commitf01995b657e6acf31a31d013a167e3a56c49f286 (patch)
treed3c1bfce6c3353bdb62d452f5e6b9fe15145058f /tests/benchmarks/declarative/painting/paintbenchmark.cpp
parent6661bde48360816df052bb179e11c87ad1d99f90 (diff)
downloadQt-f01995b657e6acf31a31d013a167e3a56c49f286.zip
Qt-f01995b657e6acf31a31d013a167e3a56c49f286.tar.gz
Qt-f01995b657e6acf31a31d013a167e3a56c49f286.tar.bz2
Enable QStaticText in QtDeclarative painting benchmark
Diffstat (limited to 'tests/benchmarks/declarative/painting/paintbenchmark.cpp')
-rw-r--r--tests/benchmarks/declarative/painting/paintbenchmark.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/benchmarks/declarative/painting/paintbenchmark.cpp b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
index d6a873c..8b8fc5e 100644
--- a/tests/benchmarks/declarative/painting/paintbenchmark.cpp
+++ b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
@@ -48,10 +48,7 @@
#include <QVBoxLayout>
#include <QTime>
#include <QDebug>
-
-#ifdef HAVE_STATICTEXT
-#include <private/qstatictext_p.h>
-#endif
+#include <QStaticText>
int iterations = 20;
const int count = 600;
@@ -105,7 +102,6 @@ void paint_QTextLayout_cache(QPainter &p)
paint_QTextLayout(p, true);
}
-#ifdef HAVE_STATICTEXT
void paint_QStaticText(QPainter &p, bool useOptimizations)
{
static QStaticText *staticText[lines];
@@ -113,7 +109,10 @@ void paint_QStaticText(QPainter &p, bool useOptimizations)
if (first) {
for (int i = 0; i < lines; ++i) {
staticText[i] = new QStaticText(strings[i]);
- staticText[i]->setUseBackendOptimizations(useOptimizations);
+ if (useOptimizations)
+ staticText[i]->setPerformanceHint(QStaticText::AggressiveCaching);
+ else
+ staticText[i]->setPerformanceHint(QStaticText::ModerateCaching);
}
first = false;
}
@@ -133,7 +132,6 @@ void paint_QStaticText_optimizations(QPainter &p)
{
paint_QStaticText(p, true);
}
-#endif
void paint_QPixmapCachedText(QPainter &p)
{
@@ -203,10 +201,8 @@ struct {
} funcs[] = {
{ "QTextLayoutNoCache", &paint_QTextLayout_noCache },
{ "QTextLayoutWithCache", &paint_QTextLayout_cache },
-#ifdef HAVE_STATICTEXT
{ "QStaticTextNoBackendOptimizations", &paint_QStaticText_noOptimizations },
{ "QStaticTextWithBackendOptimizations", &paint_QStaticText_optimizations },
-#endif
{ "CachedText", &paint_QPixmapCachedText },
{ "RoundedRect", &paint_RoundedRect },
{ "CachedRoundedRect", &paint_QPixmapCachedRoundedRect },