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);
#if 0
p.fillRect(0, 0, img2.width(), img2.height(), QColor(Qt::red));
}
-#if 1
- if (img1 != img2) {
- img1.save("setEqualClipRegionAndPath_1.xpm", "XPM");
- img2.save("setEqualClipRegionAndPath_2.xpm", "XPM");
- }
-#endif
QCOMPARE(img1, img2);
#endif
p.setClipPath(path, Qt::IntersectClip);
p.fillRect(0, 0, img2.width(), img2.height(), QColor(Qt::red));
}
-#if 0
- if (img1 != img2) {
- img1.save("setEqualClipRegionAndPath_1.png", "PNG");
- img2.save("setEqualClipRegionAndPath_2.png", "PNG");
- }
-#endif
QCOMPARE(img1, img2);
img1.fill(0x12345678);
p.setClipPath(path, Qt::IntersectClip);
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);
}
painter.drawPath(path);
}
-#if 0
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
// repeat with antialiasing
painter.drawPath(path);
}
-#if 1
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
-
}
void tst_QPainter::clippedLines_data()
painter.drawLine(line.toLine());
}
-#if 0
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
// repeat with antialiasing
painter.drawLine(line.toLine());
}
-#if 0
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
}
painter.drawPolygon(polygon.toPolygon());
}
-#if 0
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
// repeat with antialiasing
painter.drawPolygon(polygon.toPolygon());
}
-#if 0
- if (clippedRect != clippedPath) {
- clippedRect.save(QString("clippedRect.png"), "PNG");
- clippedPath.save(QString("clippedPath.png"), "PNG");
- }
-#endif
QCOMPARE(clippedRect, clippedPath);
}
// Test skipped due to rounding errors...
continue;
}
-#if 0
- if (subDest != expected) {
- qDebug() << "size" << size << "opacity" << opacity;
- for (int j = 0; j < expected.height(); ++j) {
- for (int i = 0; i < expected.width(); ++i) {
- if (expected.pixel(i,j) != subDest.pixel(i,j))
- qDebug() << i << j << hex << expected.pixel(i, j)
- << subDest.pixel(i, j);
- }
- }
- }
-#endif
QCOMPARE(subDest, expected);
}
}
// Skipping test due to rounding errors. Test needs rewrite
continue;
}
-#if 0
- if (subDest != expected) {
- qDebug() << "size" << size << "opacity" << opacity;
- for (int j = 0; j < expected.height(); ++j) {
- for (int i = 0; i < expected.width(); ++i) {
- if (expected.pixel(i,j) != subDest.pixel(i,j))
- qDebug() << i << j << hex << expected.pixel(i, j)
- << subDest.pixel(i, j);
- }
- }
- }
-#endif
QCOMPARE(subDest, expected);
}
}
p.drawPolygon(copy);
p.end();
-#if 0
- if (!verifyOutlineFillConsistency(dst, background, p.brush().color().rgba(), p.pen().color().rgba()))
- dst.save(QString("outlineFillConsistency-%1.png").arg(i));
-#endif
-
QVERIFY(verifyOutlineFillConsistency(dst, background, brush.color().rgba(), pen.color().rgba()));
}
}
const QImage result = dest.copy(i, 0, src.width(), src.height());
-#if 0
- if (result != expected) {
- qDebug("i=%i", i);
- result.save("result.png");
- expected.save("expected.png");
- }
-#endif
QCOMPARE(result, expected);
}
}