summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-07-06 13:55:40 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-07-06 14:08:02 +0200
commit314fdbce8ce473eb3610be3658c61fab2fac0efb (patch)
tree98a24a6f53ea8d6a7f3fc6ad60ab84dd66ae2863 /tests/auto/qpainter
parent8d7647e286e07690de15a6ff9189307ee1a3517c (diff)
parent83736a8d06a6ca2a1f165d6119ddaca90646e1f8 (diff)
Merge remote branch 'gerrit/master' into refactor
Conflicts: config.tests/unix/opengldesktop/opengldesktop.cpp examples/itemviews/interview/interview.pro examples/mainwindows/mainwindow/mainwindow.pro examples/openvg/README examples/richtext/textedit/textedit.pro examples/tools/undo/undo.pro src/corelib/global/qglobal.h src/corelib/kernel/qcoreapplication.h src/corelib/kernel/qcoreevent.h src/corelib/kernel/qmetatype.h src/gui/kernel/qevent.cpp src/gui/kernel/qevent.h src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qpaintengine_raster_p.h src/gui/text/qfontdatabase.cpp src/opengl/qgl.h src/openvg/qpaintengine_vg.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp tests/auto/qmainwindow/qmainwindow.pro Change-Id: I6bfb586740a68379bb99f4612ec993393a5f3234
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp57
1 files changed, 3 insertions, 54 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index a149e087cd..8898a4874d 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -1294,7 +1294,7 @@ void tst_QPainter::drawRect2()
p.end();
QRect stroke = getPaintedSize(image, Qt::white);
- QCOMPARE(stroke, fill.adjusted(0, 0, 1, 1));
+ QCOMPARE(stroke.adjusted(1, 1, 0, 0), fill.adjusted(0, 0, 1, 1));
}
}
@@ -1391,13 +1391,13 @@ void tst_QPainter::drawPath_data()
{
QPainterPath p;
p.addRect(2.25, 2.25, 10, 10);
- QTest::newRow("non-aligned rect") << p << QRect(2, 2, 10, 10) << 10 * 10;
+ QTest::newRow("non-aligned rect") << p << QRect(3, 3, 10, 10) << 10 * 10;
}
{
QPainterPath p;
p.addRect(2.25, 2.25, 10.5, 10.5);
- QTest::newRow("non-aligned rect 2") << p << QRect(2, 2, 11, 11) << 11 * 11;
+ QTest::newRow("non-aligned rect 2") << p << QRect(3, 3, 10, 10) << 10 * 10;
}
{
@@ -1820,26 +1820,10 @@ int countPixels(const QImage &img, const QRgb &color)
template <typename T>
void testClipping(QImage &img)
{
- img.fill(0x0);
QPainterPath a, b;
a.addRect(QRect(2, 2, 4, 4));
b.addRect(QRect(4, 4, 4, 4));
-
QPainter p(&img);
- p.setClipPath(a);
- p.setClipPath(b, Qt::UniteClip);
-
- p.setClipping(false);
- p.setPen(Qt::NoPen);
- p.setBrush(QColor(0xff0000));
- p.drawRect(T(0, 0, 10, 10));
-
- p.setClipping(true);
- p.setBrush(QColor(0x00ff00));
- p.drawRect(T(0, 0, 10, 10));
-
- QCOMPARE(countPixels(img, 0xff0000), 72);
- QCOMPARE(countPixels(img, 0x00ff00), 28);
p.end();
img.fill(0x0);
@@ -2002,43 +1986,8 @@ void tst_QPainter::setEqualClipRegionAndPath()
QCOMPARE(img1, img2);
#endif
- // simple uniteclip
img1.fill(0x12345678);
img2.fill(0x12345678);
- {
- QPainter p(&img1);
- p.setClipRegion(region);
- p.setClipRegion(region, Qt::UniteClip);
- p.fillRect(0, 0, img1.width(), img1.height(), QColor(Qt::red));
- }
- {
- QPainter p(&img2);
- p.setClipPath(path);
- p.setClipPath(path, Qt::UniteClip);
- p.fillRect(0, 0, img2.width(), img2.height(), QColor(Qt::red));
- }
- QCOMPARE(img1, img2);
- img1.fill(0x12345678);
- img2.fill(0x12345678);
- {
- QPainter p(&img1);
- p.setClipPath(path);
- p.setClipRegion(region, Qt::UniteClip);
- p.fillRect(0, 0, img1.width(), img1.height(), QColor(Qt::red));
- }
- {
- QPainter p(&img2);
- p.setClipRegion(region);
- p.setClipPath(path, Qt::UniteClip);
- p.fillRect(0, 0, img2.width(), img2.height(), QColor(Qt::red));
- }
-#if 0
- if (img1 != img2) {
- img1.save("setEqualClipRegionAndPath_1.xpm", "XPM");
- img2.save("setEqualClipRegionAndPath_2.xpm", "XPM");
- }
-#endif
- QCOMPARE(img1, img2);
// simple intersectclip
img1.fill(0x12345678);