From 01b72952c38b9193138eabdab6bdab632cd75ebd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 28 Jun 2011 15:08:12 +0200 Subject: Remove QPainter::UniteClip Change-Id: I5413cb5e2cbb53998bb40f27b9bbc16342caafe6 Reviewed-on: http://codereview.qt.nokia.com/837 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- tests/arthur/common/paintcommands.cpp | 6 ++--- tests/auto/qgl/tst_qgl.cpp | 17 ------------ tests/auto/qpainter/tst_qpainter.cpp | 51 ----------------------------------- 3 files changed, 3 insertions(+), 71 deletions(-) (limited to 'tests') diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp index d005ffd215..8735baa3f0 100644 --- a/tests/arthur/common/paintcommands.cpp +++ b/tests/arthur/common/paintcommands.cpp @@ -1879,7 +1879,7 @@ void PaintCommands::command_setClipRect(QRegExp re) int w = convertToInt(caps.at(3)); int h = convertToInt(caps.at(4)); - int combine = translateEnum(clipOperationTable, caps.at(5), Qt::UniteClip + 1); + int combine = translateEnum(clipOperationTable, caps.at(5), Qt::IntersectClip + 1); if (combine == -1) combine = Qt::ReplaceClip; @@ -1892,7 +1892,7 @@ void PaintCommands::command_setClipRect(QRegExp re) /***************************************************************************************************/ void PaintCommands::command_setClipPath(QRegExp re) { - int combine = translateEnum(clipOperationTable, re.cap(2), Qt::UniteClip + 1); + int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); if (combine == -1) combine = Qt::ReplaceClip; @@ -1907,7 +1907,7 @@ void PaintCommands::command_setClipPath(QRegExp re) /***************************************************************************************************/ void PaintCommands::command_setClipRegion(QRegExp re) { - int combine = translateEnum(clipOperationTable, re.cap(2), Qt::UniteClip + 1); + int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); if (combine == -1) combine = Qt::ReplaceClip; QRegion r = m_regionMap[re.cap(1)]; diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 9c51e026d2..7d46ada820 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1742,12 +1742,6 @@ public: painter->fillRect(rect(), Qt::green); painter->restore(); - painter->save(); - painter->setClipRect(0, 60, 60, 25, Qt::IntersectClip); - painter->setClipRect(60, 60, 50, 25, Qt::UniteClip); - painter->fillRect(rect(), Qt::yellow); - painter->restore(); - painter->restore(); painter->translate(100, 100); @@ -1793,17 +1787,6 @@ public: } painter->fillRect(rect(), Qt::green); painter->restore(); - - painter->save(); - { - QPainterPath path; - path.addRect(0, 60, 60, 25); - path.addRect(10, 10, 10, 10); - painter->setClipPath(path, Qt::IntersectClip); - } - painter->setClipRect(60, 60, 50, 25, Qt::UniteClip); - painter->fillRect(rect(), Qt::yellow); - painter->restore(); } protected: diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 5275778320..8898a4874d 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -1820,26 +1820,10 @@ int countPixels(const QImage &img, const QRgb &color) template 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); -- cgit v1.2.3