diff options
Diffstat (limited to 'tests/benchmarks/gui/painting')
4 files changed, 5 insertions, 30 deletions
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp index 2d33825e5c..895d7bff63 100644 --- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp @@ -924,6 +924,7 @@ void tst_QPainter::fillPrimitives_helper(QPainter *p, PrimitiveType type, Primit case Primitive_Float_RectPath: QBENCHMARK { p->drawPath(s->f_path_rect); } break; case Primitive_Float_2RectPath: QBENCHMARK { p->drawPath(s->f_path_2rects); } break; case Primitive_Float_EllipsePath: QBENCHMARK { p->drawPath(s->f_path_ellipse); } break; + case Primitive_Last_Primitive: break; } } 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: diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp index d8082cc2e0..a61610786f 100644 --- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp +++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp @@ -213,7 +213,6 @@ void tst_QtBench::qtBench_data() benchmarks << (new DrawText(longString, DrawText::PixmapMode)); benchmarks << (new DrawText(superLongString, DrawText::PixmapMode)); -#if QT_VERSION >= 0x040700 benchmarks << (new DrawText(shortString, DrawText::StaticTextMode)); benchmarks << (new DrawText(middleString, DrawText::StaticTextMode)); benchmarks << (new DrawText(longString, DrawText::StaticTextMode)); @@ -228,7 +227,6 @@ void tst_QtBench::qtBench_data() benchmarks << (new DrawText(middleString, DrawText::StaticTextBackendOptimizations)); benchmarks << (new DrawText(longString, DrawText::StaticTextBackendOptimizations)); benchmarks << (new DrawText(superLongString, DrawText::StaticTextBackendOptimizations)); -#endif foreach (Benchmark *benchmark, benchmarks) QTest::newRow(qPrintable(benchmark->name())) << reinterpret_cast<void *>(benchmark); diff --git a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp index e71cfc6413..58566fe6a2 100644 --- a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp +++ b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp @@ -149,7 +149,7 @@ void ReplayWidget::paintEvent(QPaintEvent *) } } -void ReplayWidget::resizeEvent(QResizeEvent *event) +void ReplayWidget::resizeEvent(QResizeEvent * /* event */) { visibleUpdates.clear(); |