summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/declarative')
-rw-r--r--tests/benchmarks/declarative/painting/paintbenchmark.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/benchmarks/declarative/painting/paintbenchmark.cpp b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
index d6a873c..dd52740 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 },
@@ -231,7 +227,7 @@ public:
void paintEvent(QPaintEvent *) {
static int last = 0;
static bool firstRun = true;
- if (firstRun == 0) {
+ if (firstRun) {
timer.start();
firstRun = false;
} else {