diff options
-rw-r--r-- | vcl/backendtest/GraphicsRenderTests.cxx | 336 | ||||
-rw-r--r-- | vcl/inc/skia/utils.hxx | 10 | ||||
-rw-r--r-- | vcl/inc/test/GraphicsRenderTests.hxx | 24 | ||||
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 3 |
4 files changed, 265 insertions, 108 deletions
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx index efa3c281fb4f..962c60f94e17 100644 --- a/vcl/backendtest/GraphicsRenderTests.cxx +++ b/vcl/backendtest/GraphicsRenderTests.cxx @@ -19,6 +19,7 @@ #include <svdata.hxx> #include <salinst.hxx> #include <strings.hrc> +#include <test/GraphicsRenderTests.hxx> #include <unordered_map> @@ -30,6 +31,13 @@ && aOutDevTest.getRenderBackendName() != "genpsp" \ && aOutDevTest.getRenderBackendName() != "win") +namespace vcl::test +{ +static OUString activeGraphicsRenderTestName; +void setActiveGraphicsRenderTest(const OUString& name) { activeGraphicsRenderTestName = name; } +const OUString& activeGraphicsRenderTest() { return activeGraphicsRenderTestName; } +} // namespace vcl::test + OUString VclTestResult::getStatus(bool bLocalize) { // tdf#145919 localize for UI but not in the log file if (bLocalize) @@ -65,6 +73,19 @@ void exportBitmapExToImage(OUString const& rImageName, const BitmapEx& rBitmapEx GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, aStream); } bool is32bppSupported() { return ImplGetSVData()->mpDefInst->supportsBitmap32(); } + +// Some tests need special handling in drawing code (for example, not smoothscaling +// when handling HiDPI bitmaps). Temporarily set up the test name to get such special +// handling as well. +class GraphicsTestZone +{ +public: + GraphicsTestZone(std::u16string_view name) + { + vcl::test::setActiveGraphicsRenderTest(OUString::Concat("GraphicsRenderTest__") + name); + } + ~GraphicsTestZone() { vcl::test::setActiveGraphicsRenderTest(""); } +}; } OUString GraphicsRenderTests::returnTestStatus(vcl::test::TestResult const result) @@ -83,10 +104,11 @@ OUString GraphicsRenderTests::returnTestStatus(vcl::test::TestResult const resul void GraphicsRenderTests::testDrawRectWithRectangle() { + OUString aTestName = "testDrawRectWithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); m_aCurGraphicsBackend = aOutDevTest.getRenderBackendName(); - OUString aTestName = "testDrawRectWithRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -104,9 +126,10 @@ void GraphicsRenderTests::testDrawRectWithRectangle() void GraphicsRenderTests::testDrawRectWithPixel() { + OUString aTestName = "testDrawRectWithPixel"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPixel"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -124,9 +147,10 @@ void GraphicsRenderTests::testDrawRectWithPixel() void GraphicsRenderTests::testDrawRectWithLine() { + OUString aTestName = "testDrawRectWithLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -144,9 +168,10 @@ void GraphicsRenderTests::testDrawRectWithLine() void GraphicsRenderTests::testDrawRectWithPolygon() { + OUString aTestName = "testDrawRectWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -164,9 +189,10 @@ void GraphicsRenderTests::testDrawRectWithPolygon() void GraphicsRenderTests::testDrawRectWithPolyLine() { + OUString aTestName = "testDrawRectWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -184,9 +210,10 @@ void GraphicsRenderTests::testDrawRectWithPolyLine() void GraphicsRenderTests::testDrawRectWithPolyLineB2D() { + OUString aTestName = "testDrawRectWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -204,9 +231,10 @@ void GraphicsRenderTests::testDrawRectWithPolyLineB2D() void GraphicsRenderTests::testDrawRectWithPolyPolygon() { + OUString aTestName = "testDrawRectWithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -224,9 +252,10 @@ void GraphicsRenderTests::testDrawRectWithPolyPolygon() void GraphicsRenderTests::testDrawRectWithPolyPolygonB2D() { + OUString aTestName = "testDrawRectWithPolyPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); - OUString aTestName = "testDrawRectWithPolyPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -244,9 +273,10 @@ void GraphicsRenderTests::testDrawRectWithPolyPolygonB2D() void GraphicsRenderTests::testDrawRectAAWithRectangle() { + OUString aTestName = "testDrawRectAAWithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -264,9 +294,10 @@ void GraphicsRenderTests::testDrawRectAAWithRectangle() void GraphicsRenderTests::testDrawRectAAWithPixel() { + OUString aTestName = "testDrawRectAAWithPixel"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPixel"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -284,9 +315,10 @@ void GraphicsRenderTests::testDrawRectAAWithPixel() void GraphicsRenderTests::testDrawRectAAWithLine() { + OUString aTestName = "testDrawRectAAWithLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -304,9 +336,10 @@ void GraphicsRenderTests::testDrawRectAAWithLine() void GraphicsRenderTests::testDrawRectAAWithPolygon() { + OUString aTestName = "testDrawRectAAWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -324,9 +357,10 @@ void GraphicsRenderTests::testDrawRectAAWithPolygon() void GraphicsRenderTests::testDrawRectAAWithPolyLine() { + OUString aTestName = "testDrawRectAAWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -344,9 +378,10 @@ void GraphicsRenderTests::testDrawRectAAWithPolyLine() void GraphicsRenderTests::testDrawRectAAWithPolyLineB2D() { + OUString aTestName = "testDrawRectAAWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -364,9 +399,10 @@ void GraphicsRenderTests::testDrawRectAAWithPolyLineB2D() void GraphicsRenderTests::testDrawRectAAWithPolyPolygon() { + OUString aTestName = "testDrawRectAAWithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -384,9 +420,10 @@ void GraphicsRenderTests::testDrawRectAAWithPolyPolygon() void GraphicsRenderTests::testDrawRectAAWithPolyPolygonB2D() { + OUString aTestName = "testDrawRectAAWithPolyPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); - OUString aTestName = "testDrawRectAAWithPolyPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -404,9 +441,10 @@ void GraphicsRenderTests::testDrawRectAAWithPolyPolygonB2D() void GraphicsRenderTests::testDrawFilledRectWithRectangle() { + OUString aTestName = "testDrawFilledRectWithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); - OUString aTestName = "testDrawFilledRectWithRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -435,9 +473,10 @@ void GraphicsRenderTests::testDrawFilledRectWithRectangle() void GraphicsRenderTests::testDrawFilledRectWithPolygon() { + OUString aTestName = "testDrawFilledRectWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); - OUString aTestName = "testDrawFilledRectWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -466,9 +505,10 @@ void GraphicsRenderTests::testDrawFilledRectWithPolygon() void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon() { + OUString aTestName = "testDrawFilledRectWithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); - OUString aTestName = "testDrawFilledRectWithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -497,9 +537,10 @@ void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon() void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon2D() { + OUString aTestName = "testDrawFilledRectWithPolyPolygon2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); - OUString aTestName = "testDrawFilledRectWithPolyPolygon2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -528,9 +569,10 @@ void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon2D() void GraphicsRenderTests::testDrawDiamondWithPolygon() { + OUString aTestName = "testDrawDiamondWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDiamond(); - OUString aTestName = "testDrawDiamondWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -548,9 +590,10 @@ void GraphicsRenderTests::testDrawDiamondWithPolygon() void GraphicsRenderTests::testDrawDiamondWithLine() { + OUString aTestName = "testDrawDiamondWithLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDiamond(); - OUString aTestName = "testDrawDiamondWithLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -568,9 +611,10 @@ void GraphicsRenderTests::testDrawDiamondWithLine() void GraphicsRenderTests::testDrawDiamondWithPolyline() { + OUString aTestName = "testDrawDiamondWithPolyline"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDiamond(); - OUString aTestName = "testDrawDiamondWithPolyline"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -588,9 +632,10 @@ void GraphicsRenderTests::testDrawDiamondWithPolyline() void GraphicsRenderTests::testDrawDiamondWithPolylineB2D() { + OUString aTestName = "testDrawDiamondWithPolylineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDiamond(); - OUString aTestName = "testDrawDiamondWithPolylineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -608,9 +653,10 @@ void GraphicsRenderTests::testDrawDiamondWithPolylineB2D() void GraphicsRenderTests::testDrawInvertWithRectangle() { + OUString aTestName = "testDrawInvertWithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupInvert_NONE(); - OUString aTestName = "testDrawInvertWithRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -629,9 +675,10 @@ void GraphicsRenderTests::testDrawInvertWithRectangle() void GraphicsRenderTests::testDrawInvertN50WithRectangle() { + OUString aTestName = "testDrawInvertN50WithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupInvert_N50(); - OUString aTestName = "testDrawInvertN50WithRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -650,9 +697,10 @@ void GraphicsRenderTests::testDrawInvertN50WithRectangle() void GraphicsRenderTests::testDrawInvertTrackFrameWithRectangle() { + OUString aTestName = "testDrawInvertTrackFrameWithRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupInvert_TrackFrame(); - OUString aTestName = "testDrawInvertTrackFrameWithRectangle"; if (!(SHOULD_ASSERT && aOutDevTest.getRenderBackendName() != "svp")) { appendTestResult(aTestName, "SKIPPED"); @@ -671,9 +719,10 @@ void GraphicsRenderTests::testDrawInvertTrackFrameWithRectangle() void GraphicsRenderTests::testDrawDropShapeWithPolyline() { + OUString aTestName = "testDrawDropShapeWithPolyline"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDropShape(); - OUString aTestName = "testDrawDropShapeWithPolyline"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -691,9 +740,10 @@ void GraphicsRenderTests::testDrawDropShapeWithPolyline() void GraphicsRenderTests::testDrawDropShapeAAWithPolyline() { + OUString aTestName = "testDrawDropShapeAAWithPolyline"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAADropShape(); - OUString aTestName = "testDrawDropShapeAAWithPolyline"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -712,9 +762,10 @@ void GraphicsRenderTests::testDrawDropShapeAAWithPolyline() void GraphicsRenderTests::testDrawBezierWithPolylineB2D() { + OUString aTestName = "testDrawBezierWithPolylineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupBezier(); - OUString aTestName = "testDrawBezierWithPolylineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -732,9 +783,10 @@ void GraphicsRenderTests::testDrawBezierWithPolylineB2D() void GraphicsRenderTests::testDrawBezierAAWithPolylineB2D() { + OUString aTestName = "testDrawBezierAAWithPolylineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAABezier(); - OUString aTestName = "testDrawBezierAAWithPolylineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -752,9 +804,10 @@ void GraphicsRenderTests::testDrawBezierAAWithPolylineB2D() void GraphicsRenderTests::testDrawDropShapeWithPolygon() { + OUString aTestName = "testDrawDropShapeWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDropShape(); - OUString aTestName = "testDrawDropShapeWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -772,9 +825,10 @@ void GraphicsRenderTests::testDrawDropShapeWithPolygon() void GraphicsRenderTests::testDrawDropShapeAAWithPolygon() { + OUString aTestName = "testDrawDropShapeAAWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAADropShape(); - OUString aTestName = "testDrawDropShapeAAWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -793,9 +847,10 @@ void GraphicsRenderTests::testDrawDropShapeAAWithPolygon() void GraphicsRenderTests::testDrawBitmap24bpp() { + OUString aTestName = "testDrawBitmap24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmap(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testDrawBitmap24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -814,9 +869,10 @@ void GraphicsRenderTests::testDrawBitmap24bpp() void GraphicsRenderTests::testDrawTransformedBitmap24bpp() { + OUString aTestName = "testDrawTransformedBitmap24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testDrawTransformedBitmap24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -835,9 +891,10 @@ void GraphicsRenderTests::testDrawTransformedBitmap24bpp() void GraphicsRenderTests::testComplexDrawTransformedBitmap24bpp() { + OUString aTestName = "testComplexDrawTransformedBitmap24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupComplexDrawTransformedBitmap(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testComplexDrawTransformedBitmap24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -856,9 +913,10 @@ void GraphicsRenderTests::testComplexDrawTransformedBitmap24bpp() void GraphicsRenderTests::testDrawBitmapExWithAlpha24bpp() { + OUString aTestName = "testDrawBitmapExWithAlpha24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmapExWithAlpha(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testDrawBitmapExWithAlpha24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -877,9 +935,10 @@ void GraphicsRenderTests::testDrawBitmapExWithAlpha24bpp() void GraphicsRenderTests::testDrawMask24bpp() { + OUString aTestName = "testDrawMask24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawMask(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testDrawMask24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -897,9 +956,10 @@ void GraphicsRenderTests::testDrawMask24bpp() void GraphicsRenderTests::testDrawBlend24bpp() { + OUString aTestName = "testDrawBlend24bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); - OUString aTestName = "testDrawBlend24bpp"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -916,9 +976,10 @@ void GraphicsRenderTests::testDrawBlend24bpp() void GraphicsRenderTests::testDrawXor() { + OUString aTestName = "testDrawXor"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupXOR(); - OUString aTestName = "testDrawXor"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -936,9 +997,10 @@ void GraphicsRenderTests::testDrawXor() void GraphicsRenderTests::testClipRectangle() { + OUString aTestName = "testClipRectangle"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipRectangle(); - OUString aTestName = "testClipRectangle"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -956,9 +1018,10 @@ void GraphicsRenderTests::testClipRectangle() void GraphicsRenderTests::testClipPolygon() { + OUString aTestName = "testClipPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipPolygon(); - OUString aTestName = "testClipPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -976,9 +1039,10 @@ void GraphicsRenderTests::testClipPolygon() void GraphicsRenderTests::testClipPolyPolygon() { + OUString aTestName = "testClipPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipPolyPolygon(); - OUString aTestName = "testClipPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -996,9 +1060,10 @@ void GraphicsRenderTests::testClipPolyPolygon() void GraphicsRenderTests::testClipB2DPolyPolygon() { + OUString aTestName = "testClipB2DPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipB2DPolyPolygon(); - OUString aTestName = "testClipB2DPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1016,9 +1081,10 @@ void GraphicsRenderTests::testClipB2DPolyPolygon() void GraphicsRenderTests::testDrawOutDev() { + OUString aTestName = "testDrawOutDev"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawOutDev(); - OUString aTestName = "testDrawOutDev"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1037,9 +1103,10 @@ void GraphicsRenderTests::testDrawOutDev() void GraphicsRenderTests::testDrawOutDevScaledClipped() { + OUString aTestName = "testDrawOutDevScaledClipped"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawOutDevScaledClipped(); - OUString aTestName = "testDrawOutDevScaledClipped"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1058,9 +1125,10 @@ void GraphicsRenderTests::testDrawOutDevScaledClipped() void GraphicsRenderTests::testDrawOutDevSelf() { + OUString aTestName = "testDrawOutDevSelf"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawOutDevSelf(); - OUString aTestName = "testDrawOutDevSelf"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1079,9 +1147,10 @@ void GraphicsRenderTests::testDrawOutDevSelf() void GraphicsRenderTests::testDashedLine() { + OUString aTestName = "testDashedLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDashedLine(); - OUString aTestName = "testDashedLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1099,9 +1168,10 @@ void GraphicsRenderTests::testDashedLine() void GraphicsRenderTests::testLinearGradient() { + OUString aTestName = "testLinearGradient"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradient(); - OUString aTestName = "testLinearGradient"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1120,9 +1190,10 @@ void GraphicsRenderTests::testLinearGradient() void GraphicsRenderTests::testLinearGradientAngled() { + OUString aTestName = "testLinearGradientAngled"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientAngled(); - OUString aTestName = "testLinearGradientAngled"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1141,9 +1212,10 @@ void GraphicsRenderTests::testLinearGradientAngled() void GraphicsRenderTests::testLinearGradientBorder() { + OUString aTestName = "testLinearGradientBorder"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientBorder(); - OUString aTestName = "testLinearGradientBorder"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1162,9 +1234,10 @@ void GraphicsRenderTests::testLinearGradientBorder() void GraphicsRenderTests::testLinearGradientIntensity() { + OUString aTestName = "testLinearGradientIntensity"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientIntensity(); - OUString aTestName = "testLinearGradientIntensity"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1183,9 +1256,10 @@ void GraphicsRenderTests::testLinearGradientIntensity() void GraphicsRenderTests::testLinearGradientSteps() { + OUString aTestName = "testLinearGradientSteps"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientSteps(); - OUString aTestName = "testLinearGradientSteps"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1204,9 +1278,10 @@ void GraphicsRenderTests::testLinearGradientSteps() void GraphicsRenderTests::testAxialGradient() { + OUString aTestName = "testAxialGradient"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAxialGradient(); - OUString aTestName = "testAxialGradient"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1225,9 +1300,10 @@ void GraphicsRenderTests::testAxialGradient() void GraphicsRenderTests::testRadialGradient() { + OUString aTestName = "testRadialGradient"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRadialGradient(); - OUString aTestName = "testRadialGradient"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1246,9 +1322,10 @@ void GraphicsRenderTests::testRadialGradient() void GraphicsRenderTests::testRadialGradientOfs() { + OUString aTestName = "testRadialGradientOfs"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRadialGradientOfs(); - OUString aTestName = "testRadialGradientOfs"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1262,9 +1339,10 @@ void GraphicsRenderTests::testRadialGradientOfs() void GraphicsRenderTests::testLineJoinBevel() { + OUString aTestName = "testLineJoinBevel"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineJoinBevel(); - OUString aTestName = "testLineJoinBevel"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1282,9 +1360,10 @@ void GraphicsRenderTests::testLineJoinBevel() void GraphicsRenderTests::testLineJoinRound() { + OUString aTestName = "testLineJoinRound"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineJoinRound(); - OUString aTestName = "testLineJoinRound"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1302,9 +1381,10 @@ void GraphicsRenderTests::testLineJoinRound() void GraphicsRenderTests::testLineJoinMiter() { + OUString aTestName = "testLineJoinMiter"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineJoinMiter(); - OUString aTestName = "testLineJoinMiter"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1322,9 +1402,10 @@ void GraphicsRenderTests::testLineJoinMiter() void GraphicsRenderTests::testLineJoinNone() { + OUString aTestName = "testLineJoinNone"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineJoinNone(); - OUString aTestName = "testLineJoinNone"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1342,9 +1423,10 @@ void GraphicsRenderTests::testLineJoinNone() void GraphicsRenderTests::testLineCapRound() { + OUString aTestName = "testLineCapRound"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineCapRound(); - OUString aTestName = "testLineCapRound"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1362,9 +1444,10 @@ void GraphicsRenderTests::testLineCapRound() void GraphicsRenderTests::testLineCapSquare() { + OUString aTestName = "testLineCapSquare"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineCapSquare(); - OUString aTestName = "testLineCapSquare"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1382,9 +1465,10 @@ void GraphicsRenderTests::testLineCapSquare() void GraphicsRenderTests::testLineCapButt() { + OUString aTestName = "testLineCapButt"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLineCapButt(); - OUString aTestName = "testLineCapButt"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1402,9 +1486,10 @@ void GraphicsRenderTests::testLineCapButt() void GraphicsRenderTests::testHalfEllipseWithPolyLine() { + OUString aTestName = "testHalfEllipseWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(); - OUString aTestName = "testHalfEllipseWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1422,9 +1507,10 @@ void GraphicsRenderTests::testHalfEllipseWithPolyLine() void GraphicsRenderTests::testHalfEllipseAAWithPolyLine() { + OUString aTestName = "testHalfEllipseAAWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(true); - OUString aTestName = "testHalfEllipseAAWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1443,9 +1529,10 @@ void GraphicsRenderTests::testHalfEllipseAAWithPolyLine() void GraphicsRenderTests::testHalfEllipseWithPolyLineB2D() { + OUString aTestName = "testHalfEllipseWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(); - OUString aTestName = "testHalfEllipseWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1463,9 +1550,10 @@ void GraphicsRenderTests::testHalfEllipseWithPolyLineB2D() void GraphicsRenderTests::testHalfEllipseAAWithPolyLineB2D() { + OUString aTestName = "testHalfEllipseAAWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(true); - OUString aTestName = "testHalfEllipseAAWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1484,9 +1572,10 @@ void GraphicsRenderTests::testHalfEllipseAAWithPolyLineB2D() void GraphicsRenderTests::testHalfEllipseWithPolygon() { + OUString aTestName = "testHalfEllipseWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(); - OUString aTestName = "testHalfEllipseWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1504,9 +1593,10 @@ void GraphicsRenderTests::testHalfEllipseWithPolygon() void GraphicsRenderTests::testClosedBezierWithPolyline() { + OUString aTestName = "testClosedBezierWithPolyline"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClosedBezier(); - OUString aTestName = "testClosedBezierWithPolyline"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1524,9 +1614,10 @@ void GraphicsRenderTests::testClosedBezierWithPolyline() void GraphicsRenderTests::testClosedBezierWithPolygon() { + OUString aTestName = "testClosedBezierWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClosedBezier(); - OUString aTestName = "testClosedBezierWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1544,9 +1635,10 @@ void GraphicsRenderTests::testClosedBezierWithPolygon() void GraphicsRenderTests::testHalfEllipseAAWithPolygon() { + OUString aTestName = "testHalfEllipseAAWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupHalfEllipse(true); - OUString aTestName = "testHalfEllipseAAWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1565,9 +1657,10 @@ void GraphicsRenderTests::testHalfEllipseAAWithPolygon() void GraphicsRenderTests::testFilledAsymmetricalDropShape() { + OUString aTestName = "testFilledAsymmetricalDropShape"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledAsymmetricalDropShape(); - OUString aTestName = "testFilledAsymmetricalDropShape"; vcl::test::TestResult eResult = vcl::test::OutputDeviceTestLine::checkFilledAsymmetricalDropShape(aBitmap); appendTestResult(aTestName, returnTestStatus(eResult), @@ -1581,9 +1674,10 @@ void GraphicsRenderTests::testFilledAsymmetricalDropShape() void GraphicsRenderTests::testTextDrawing() { + OUString aTestName = "testTextDrawing"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestText aOutDevTest; Bitmap aBitmap = aOutDevTest.setupTextBitmap(); - OUString aTestName = "testTextDrawing"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1601,9 +1695,10 @@ void GraphicsRenderTests::testTextDrawing() void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygon() { + OUString aTestName = "testEvenOddRuleInIntersectingRectsWithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupIntersectingRectangles(); - OUString aTestName = "testEvenOddRuleInIntersectingRectsWithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1622,9 +1717,10 @@ void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygon() void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D() { + OUString aTestName = "testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupIntersectingRectangles(); - OUString aTestName = "testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1643,9 +1739,10 @@ void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D() void GraphicsRenderTests::testDrawBitmap8bppGreyScale() { + OUString aTestName = "testDrawBitmap8bppGreyScale"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmap(vcl::PixelFormat::N8_BPP, true); - OUString aTestName = "testDrawBitmap8bppGreyScale"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1664,9 +1761,10 @@ void GraphicsRenderTests::testDrawBitmap8bppGreyScale() void GraphicsRenderTests::testDrawTransformedBitmap8bppGreyScale() { + OUString aTestName = "testDrawTransformedBitmap8bppGreyScale"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap(vcl::PixelFormat::N8_BPP, true); - OUString aTestName = "testDrawTransformedBitmap8bppGreyScale"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1685,9 +1783,10 @@ void GraphicsRenderTests::testDrawTransformedBitmap8bppGreyScale() void GraphicsRenderTests::testDrawBitmap32bpp() { + OUString aTestName = "testDrawBitmap32bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmap(vcl::PixelFormat::N32_BPP); - OUString aTestName = "testDrawBitmap32bpp"; if (!SHOULD_ASSERT || !is32bppSupported()) { appendTestResult(aTestName, "SKIPPED"); @@ -1706,9 +1805,10 @@ void GraphicsRenderTests::testDrawBitmap32bpp() void GraphicsRenderTests::testDrawTransformedBitmap32bpp() { + OUString aTestName = "testDrawTransformedBitmap32bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap(vcl::PixelFormat::N32_BPP); - OUString aTestName = "testDrawTransformedBitmap32bpp"; if (!SHOULD_ASSERT || !is32bppSupported()) { appendTestResult(aTestName, "SKIPPED"); @@ -1727,9 +1827,10 @@ void GraphicsRenderTests::testDrawTransformedBitmap32bpp() void GraphicsRenderTests::testDrawBitmapExWithAlpha32bpp() { + OUString aTestName = "testDrawBitmapExWithAlpha32bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmapExWithAlpha(vcl::PixelFormat::N32_BPP); - OUString aTestName = "testDrawBitmapExWithAlpha32bpp"; if (!SHOULD_ASSERT || !is32bppSupported()) { appendTestResult(aTestName, "SKIPPED"); @@ -1748,9 +1849,10 @@ void GraphicsRenderTests::testDrawBitmapExWithAlpha32bpp() void GraphicsRenderTests::testDrawMask32bpp() { + OUString aTestName = "testDrawMask32bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawMask(vcl::PixelFormat::N32_BPP); - OUString aTestName = "testDrawMask32bpp"; if (!SHOULD_ASSERT || !is32bppSupported()) { appendTestResult(aTestName, "SKIPPED"); @@ -1768,9 +1870,10 @@ void GraphicsRenderTests::testDrawMask32bpp() void GraphicsRenderTests::testDrawBlend32bpp() { + OUString aTestName = "testDrawBlend32bpp"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N32_BPP); - OUString aTestName = "testDrawBlend32bpp"; if (!SHOULD_ASSERT || !is32bppSupported()) { appendTestResult(aTestName, "SKIPPED"); @@ -1787,10 +1890,11 @@ void GraphicsRenderTests::testDrawBlend32bpp() void GraphicsRenderTests::testDrawRectangleOnSize1028WithRect() { + OUString aTestName = "testDrawRectangleOnSize1028WithRect"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); m_aCurGraphicsBackend = aOutDevTest.getRenderBackendName(); - OUString aTestName = "testDrawRectangleOnSize1028WithRect"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1808,10 +1912,11 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithRect() void GraphicsRenderTests::testDrawRectangleOnSize4096WithRect() { + OUString aTestName = "testDrawRectangleOnSize4096WithRect"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); m_aCurGraphicsBackend = aOutDevTest.getRenderBackendName(); - OUString aTestName = "testDrawRectangleOnSize4096WithRect"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1829,9 +1934,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithRect() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPixel() { + OUString aTestName = "testDrawRectangleOnSize1028WithPixel"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPixel"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1849,9 +1955,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPixel() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPixel() { + OUString aTestName = "testDrawRectangleOnSize4096WithPixel"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPixel"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1869,9 +1976,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPixel() void GraphicsRenderTests::testDrawRectangleOnSize1028WithLine() { + OUString aTestName = "testDrawRectangleOnSize1028WithLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1889,9 +1997,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithLine() void GraphicsRenderTests::testDrawRectangleOnSize4096WithLine() { + OUString aTestName = "testDrawRectangleOnSize4096WithLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1909,9 +2018,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithLine() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLine() { + OUString aTestName = "testDrawRectangleOnSize1028WithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1929,9 +2039,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLine() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLine() { + OUString aTestName = "testDrawRectangleOnSize4096WithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1949,9 +2060,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLine() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolygon() { + OUString aTestName = "testDrawRectangleOnSize1028WithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1969,9 +2081,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolygon() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygon() { + OUString aTestName = "testDrawRectangleOnSize4096WithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -1989,9 +2102,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygon() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLineB2D() { + OUString aTestName = "testDrawRectangleOnSize1028WithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2009,9 +2123,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLineB2D() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLineB2D() { + OUString aTestName = "testDrawRectangleOnSize4096WithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2029,9 +2144,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLineB2D() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygon() { + OUString aTestName = "testDrawRectangleOnSize1028WithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2049,9 +2165,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygon() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyPolygon() { + OUString aTestName = "testDrawRectangleOnSize4096WithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2069,9 +2186,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyPolygon() void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygonB2D() { + OUString aTestName = "testDrawRectangleOnSize1028WithPolyPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize1028(); - OUString aTestName = "testDrawRectangleOnSize1028WithPolyPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2089,9 +2207,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygonB2D() void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygonPolygonB2D() { + OUString aTestName = "testDrawRectangleOnSize4096WithPolygonPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangleOnSize4096(); - OUString aTestName = "testDrawRectangleOnSize4096WithPolygonPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2109,9 +2228,10 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygonPolygonB2D() void GraphicsRenderTests::testDrawOpenPolygonWithPolyLine() { + OUString aTestName = "testDrawOpenPolygonWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); - OUString aTestName = "testDrawOpenPolygonWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2129,9 +2249,10 @@ void GraphicsRenderTests::testDrawOpenPolygonWithPolyLine() void GraphicsRenderTests::testDrawOpenPolygonWithPolyLineB2D() { + OUString aTestName = "testDrawOpenPolygonWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); - OUString aTestName = "testDrawOpenPolygonWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2149,9 +2270,10 @@ void GraphicsRenderTests::testDrawOpenPolygonWithPolyLineB2D() void GraphicsRenderTests::testDrawOpenPolygonWithPolygon() { + OUString aTestName = "testDrawOpenPolygonWithPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); - OUString aTestName = "testDrawOpenPolygonWithPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2169,9 +2291,10 @@ void GraphicsRenderTests::testDrawOpenPolygonWithPolygon() void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygon() { + OUString aTestName = "testDrawOpenPolygonWithPolyPolygon"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); - OUString aTestName = "testDrawOpenPolygonWithPolyPolygon"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2189,9 +2312,10 @@ void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygon() void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygonB2D() { + OUString aTestName = "testDrawOpenPolygonWithPolyPolygonB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); - OUString aTestName = "testDrawOpenPolygonWithPolyPolygonB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2209,9 +2333,10 @@ void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygonB2D() void GraphicsRenderTests::testDrawOpenBezierWithPolyLine() { + OUString aTestName = "testDrawOpenBezierWithPolyLine"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenBezier(); - OUString aTestName = "testDrawOpenBezierWithPolyLine"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); @@ -2229,9 +2354,10 @@ void GraphicsRenderTests::testDrawOpenBezierWithPolyLine() void GraphicsRenderTests::testDrawOpenBezierWithPolyLineB2D() { + OUString aTestName = "testDrawOpenBezierWithPolyLineB2D"; + GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupOpenBezier(); - OUString aTestName = "testDrawOpenBezierWithPolyLineB2D"; if (!SHOULD_ASSERT) { appendTestResult(aTestName, "SKIPPED"); diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index d2d4c81c3f94..355718e8bfa1 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -27,6 +27,8 @@ #include <vcl/bitmap.hxx> #include <vcl/salgtype.hxx> +#include <test/GraphicsRenderTests.hxx> + #include <premac.h> #include <SkRegion.h> #include <SkSurface.h> @@ -133,10 +135,14 @@ inline bool isUnitTestRunning(const char* name = nullptr) if (name == nullptr) { static const char* const testname = getenv("LO_TESTNAME"); - return testname != nullptr; + if (testname != nullptr) + return true; + return !vcl::test::activeGraphicsRenderTest().isEmpty(); } const char* const testname = getenv("LO_TESTNAME"); - return testname != nullptr && std::string_view(name) == testname; + if (testname != nullptr && std::string_view(name) == testname) + return true; + return vcl::test::activeGraphicsRenderTest().equalsAscii(name); } // Scaling done on the GPU is fast, but bicubic done in raster mode can be slow diff --git a/vcl/inc/test/GraphicsRenderTests.hxx b/vcl/inc/test/GraphicsRenderTests.hxx new file mode 100644 index 000000000000..cdf835f48ed0 --- /dev/null +++ b/vcl/inc/test/GraphicsRenderTests.hxx @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include <rtl/ustring.hxx> + +namespace vcl::test +{ +// Set and get currently running graphic render test. Some of them may need +// special handling in the backend code, just like unittests do. +void setActiveGraphicsRenderTest(const OUString& name); +const OUString& activeGraphicsRenderTest(); + +} // end namespace vcl::test + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index c2efb62f96dc..c253ceb3a2df 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -1372,7 +1372,8 @@ std::shared_ptr<SalBitmap> SkiaSalGraphicsImpl::getBitmap(tools::Long nX, tools: // Some tests require exact pixel values and would be confused by smooth-scaling. // And some draw something smooth and not smooth-scaling there would break the checks. if (isUnitTestRunning("BackendTest__testDrawHaflEllipseAAWithPolyLineB2D_") - || isUnitTestRunning("BackendTest__testDrawRectAAWithLine_")) + || isUnitTestRunning("BackendTest__testDrawRectAAWithLine_") + || isUnitTestRunning("GraphicsRenderTest__testDrawRectAAWithLine")) { bitmap->Scale(1.0 / mScaling, 1.0 / mScaling, goodScalingQuality()); } |