summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-04 18:25:59 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-04 18:25:59 (GMT)
commit70137e5049b14d3b5c7c018b2f2111704878dfee (patch)
tree89e4bd50f197bb526233332dc4772e62a5446186 /tests
parent215e5b51392f3b0129ad62c4f5efdfc3a0ba6ed6 (diff)
parent08d09a78d3faf8b211e78cb63285c35c5544b5fc (diff)
downloadQt-70137e5049b14d3b5c7c018b2f2111704878dfee.zip
Qt-70137e5049b14d3b5c7c018b2f2111704878dfee.tar.gz
Qt-70137e5049b14d3b5c7c018b2f2111704878dfee.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed crash in concentric circles example QDeclarativeDebug: use QueuedConnection in the packet protocol Implement comp_Source with SSE2 when there is a const alpha
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/gui/image/blendbench/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp
index 92d1633..f53654b 100644
--- a/tests/benchmarks/gui/image/blendbench/main.cpp
+++ b/tests/benchmarks/gui/image/blendbench/main.cpp
@@ -103,6 +103,9 @@ class BlendBench : public QObject
private slots:
void blendBench_data();
void blendBench();
+
+ void blendBenchAlpha_data();
+ void blendBenchAlpha();
};
void BlendBench::blendBench_data()
@@ -147,6 +150,35 @@ void BlendBench::blendBench()
}
}
+void BlendBench::blendBenchAlpha_data()
+{
+ blendBench_data();
+}
+
+void BlendBench::blendBenchAlpha()
+{
+ QFETCH(int, brushType);
+ QFETCH(int, compositionMode);
+
+ QImage img(512, 512, QImage::Format_ARGB32_Premultiplied);
+ QImage src(512, 512, QImage::Format_ARGB32_Premultiplied);
+ paint(&src);
+ QPainter p(&img);
+ p.setPen(Qt::NoPen);
+
+ p.setCompositionMode(QPainter::CompositionMode(compositionMode));
+ if (brushType == ImageBrush) {
+ p.setBrush(QBrush(src));
+ } else if (brushType == SolidBrush) {
+ p.setBrush(QColor(127, 127, 127, 127));
+ }
+ p.setOpacity(0.7f);
+
+ QBENCHMARK {
+ p.drawRect(0, 0, 512, 512);
+ }
+}
+
QTEST_MAIN(BlendBench)
#include "main.moc"