summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-05-20 19:45:38 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-05-20 19:46:19 +0200
commitd671acd5b296b83440db9836a92189c501c87ff3 (patch)
treebd9c1a000e17c70124c207666cfb3276b5518ffd /tests/benchmarks/gui/painting/qtbench/benchmarktests.h
parent42f5786104f9eef9542df2c7469a03324978281d (diff)
parent4f2138ecfbdc58e5cb5b0c7d762197ef69752957 (diff)
Merge remote branch 'staging/master' into refactor
Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/glxconvenience/qglxconvenience.cpp src/plugins/platforms/platforms.pro src/plugins/platforms/wayland/qwaylandwindow.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/plugins/platforms/xcb/qxcbwindowsurface.cpp src/widgets/kernel/qwidget_qpa.cpp tests/auto/qvariant/tst_qvariant.cpp
Diffstat (limited to 'tests/benchmarks/gui/painting/qtbench/benchmarktests.h')
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h30
1 files changed, 3 insertions, 27 deletions
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index f5bc717cfb..c20cbfaef1 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -48,10 +48,7 @@
#include <QTextLayout>
#include <QFontMetrics>
#include <QDebug>
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
-# include <QStaticText>
-#endif
+#include <QStaticText>
class Benchmark
{
@@ -472,13 +469,10 @@ public:
PainterQPointMode,
LayoutMode,
DocumentMode,
- PixmapMode
-
-#if QT_VERSION >= 0x040700
- , StaticTextMode,
+ PixmapMode,
+ StaticTextMode,
StaticTextWithMaximumSizeMode,
StaticTextBackendOptimizations
-#endif
};
DrawText(const QString &text, Mode mode)
@@ -487,12 +481,8 @@ public:
}
virtual void begin(QPainter *p, int iterations) {
-#if QT_VERSION >= 0x040700
m_staticTexts.clear();
m_currentStaticText = 0;
-#else
- Q_UNUSED(iterations);
-#endif
m_pixmaps.clear();
m_currentPixmap = 0;
QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
@@ -536,7 +526,6 @@ public:
m_size = m_layout.boundingRect().toRect().size();
break; }
-#if QT_VERSION >= 0x040700
case StaticTextWithMaximumSizeMode: {
QStaticText staticText;
m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
@@ -570,8 +559,6 @@ public:
break;
}
-#endif
-
case PainterQPointMode: {
QFontMetrics fm(p->font());
m_size = QSize(fm.width(m_text, m_text.length()), fm.height());
@@ -602,8 +589,6 @@ public:
case LayoutMode:
m_layout.draw(p, rect.topLeft());
break;
-
-#if QT_VERSION >= 0x040700
case StaticTextWithMaximumSizeMode:
case StaticTextMode:
p->drawStaticText(rect.topLeft(), m_staticTexts.at(0));
@@ -612,7 +597,6 @@ public:
p->drawStaticText(rect.topLeft(), m_staticTexts.at(m_currentStaticText));
m_currentStaticText = (m_currentStaticText + 1) % m_staticTexts.size();
break;
-#endif
}
}
@@ -628,12 +612,9 @@ public:
case LayoutMode: type = "layout.draw()"; break;
case DocumentMode: type = "doc.drawContents()"; break;
case PixmapMode: type = "pixmap cached text"; break;
-
-#if QT_VERSION >= 0x040700
case StaticTextMode: type = "drawStaticText()"; break;
case StaticTextWithMaximumSizeMode: type = "drawStaticText() w/ maxsize"; break;
case StaticTextBackendOptimizations: type = "drawStaticText() w/ backend optimizations"; break;
-#endif
}
return QString::fromLatin1("%3, len=%1, lines=%2")
@@ -651,15 +632,10 @@ private:
QList<QPixmap> m_pixmaps;
int m_currentPixmap;
-#if QT_VERSION >= 0x040700
int m_currentStaticText;
QList<QStaticText> m_staticTexts;
-#endif
};
-
-
-
class ClippedDrawRectBenchmark : public Benchmark
{
public: