include/vcl/test/GraphicsRenderTests.hxx | 5 + vcl/backendtest/GraphicsRenderTests.cxx | 105 +++++++++++++++++++++++ vcl/backendtest/outputdevice/common.cxx | 69 +++++++++++++++ vcl/backendtest/outputdevice/polygon.cxx | 13 ++ vcl/backendtest/outputdevice/polyline.cxx | 15 +++ vcl/backendtest/outputdevice/polyline_b2d.cxx | 13 ++ vcl/backendtest/outputdevice/polypolygon.cxx | 17 +++ vcl/backendtest/outputdevice/polypolygon_b2d.cxx | 16 +++ vcl/inc/test/outputdevice.hxx | 7 + vcl/qa/cppunit/BackendTest.cxx | 56 ++++++++++++ 10 files changed, 316 insertions(+)
New commits: commit 3eeb77ece8db11e6c57864c507af5d24253a6276 Author: homeboy445 <akshitsa...@gmail.com> AuthorDate: Fri Aug 6 20:44:39 2021 +0530 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Oct 31 18:47:39 2021 +0100 backendtest: Drawing Open Polygon test Change-Id: I57af3232ad5e83b649fdfac719dc2359e1bbb412 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120171 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/test/GraphicsRenderTests.hxx b/include/vcl/test/GraphicsRenderTests.hxx index 7d44b538a948..718674b1cc5e 100644 --- a/include/vcl/test/GraphicsRenderTests.hxx +++ b/include/vcl/test/GraphicsRenderTests.hxx @@ -143,6 +143,11 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests void testDrawRectangleOnSize4096WithPolyPolygon(); void testDrawRectangleOnSize1028WithPolyPolygonB2D(); void testDrawRectangleOnSize4096WithPolygonPolygonB2D(); + void testDrawOpenPolygonWithPolyLine(); + void testDrawOpenPolygonWithPolyLineB2D(); + void testDrawOpenPolygonWithPolygon(); + void testDrawOpenPolygonWithPolyPolygon(); + void testDrawOpenPolygonWithPolyPolygonB2D(); static OUString returnTestStatus(vcl::test::TestResult const result); void runALLTests(); void appendTestResult(OUString aTestName, OUString aTestStatus, Bitmap aTestBitmap = Bitmap()); diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx index bf3932ffa2b1..0f360f2ae9c0 100644 --- a/vcl/backendtest/GraphicsRenderTests.cxx +++ b/vcl/backendtest/GraphicsRenderTests.cxx @@ -2015,6 +2015,106 @@ void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygonPolygonB2D() } } +void GraphicsRenderTests::testDrawOpenPolygonWithPolyLine() +{ + vcl::test::OutputDeviceTestPolyLine aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + OUString aTestName = "testDrawOpenPolygonWithPolyLine"; + if (!SHOULD_ASSERT) + { + appendTestResult(aTestName, "SKIPPED"); + return; + } + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + appendTestResult(aTestName, returnTestStatus(eResult), + (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", aBitmapEx); + } +} + +void GraphicsRenderTests::testDrawOpenPolygonWithPolyLineB2D() +{ + vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + OUString aTestName = "testDrawOpenPolygonWithPolyLineB2D"; + if (!SHOULD_ASSERT) + { + appendTestResult(aTestName, "SKIPPED"); + return; + } + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + appendTestResult(aTestName, returnTestStatus(eResult), + (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", aBitmapEx); + } +} + +void GraphicsRenderTests::testDrawOpenPolygonWithPolygon() +{ + vcl::test::OutputDeviceTestPolygon aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + OUString aTestName = "testDrawOpenPolygonWithPolygon"; + if (!SHOULD_ASSERT) + { + appendTestResult(aTestName, "SKIPPED"); + return; + } + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + appendTestResult(aTestName, returnTestStatus(eResult), + (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", aBitmapEx); + } +} + +void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygon() +{ + vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + OUString aTestName = "testDrawOpenPolygonWithPolyPolygon"; + if (!SHOULD_ASSERT) + { + appendTestResult(aTestName, "SKIPPED"); + return; + } + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + appendTestResult(aTestName, returnTestStatus(eResult), + (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", aBitmapEx); + } +} + +void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygonB2D() +{ + vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + OUString aTestName = "testDrawOpenPolygonWithPolyPolygonB2D"; + if (!SHOULD_ASSERT) + { + appendTestResult(aTestName, "SKIPPED"); + return; + } + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + appendTestResult(aTestName, returnTestStatus(eResult), + (m_aStoreResultantBitmap ? aBitmap : Bitmap())); + if (m_aStoreResultantBitmap) + { + BitmapEx aBitmapEx(aBitmap); + exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", aBitmapEx); + } +} + void GraphicsRenderTests::runALLTests() { testDrawRectWithRectangle(); @@ -2112,6 +2212,11 @@ void GraphicsRenderTests::runALLTests() testDrawRectangleOnSize4096WithPolyPolygon(); testDrawRectangleOnSize1028WithPolyPolygonB2D(); testDrawRectangleOnSize4096WithPolygonPolygonB2D(); + testDrawOpenPolygonWithPolyLine(); + testDrawOpenPolygonWithPolyLineB2D(); + testDrawOpenPolygonWithPolygon(); + testDrawOpenPolygonWithPolyPolygon(); + testDrawOpenPolygonWithPolyPolygonB2D(); } void GraphicsRenderTests::appendTestResult(OUString aTestName, OUString aTestStatus, diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 9e9f67bd9513..8a5b80cb8dec 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -18,6 +18,7 @@ namespace vcl::test { namespace { + int deltaColor(BitmapColor aColor1, BitmapColor aColor2) { int deltaR = std::abs(aColor1.GetRed() - aColor2.GetRed()); @@ -719,6 +720,19 @@ tools::Polygon OutputDeviceTestCommon::createClosedBezierLoop(const tools::Recta return aPolygon; } +basegfx::B2DPolygon OutputDeviceTestCommon::createOpenPolygon(tools::Rectangle& rRect, int nOffset) +{ + int nMidOffset = rRect.GetWidth() / 2; + basegfx::B2DPolygon aPolygon{ + basegfx::B2DPoint(rRect.Left() + nOffset - (nOffset + 1) / 2, rRect.Top() + nOffset - 1), + basegfx::B2DPoint(rRect.Left() + nOffset - (nOffset + 1) / 2, rRect.Bottom() - nOffset + 1), + basegfx::B2DPoint(rRect.Right() - nMidOffset - nOffset / 3, rRect.Bottom() - nOffset + 1), + basegfx::B2DPoint(rRect.Right() - nMidOffset - nOffset / 3, rRect.Top() + nOffset - 1), + }; + aPolygon.setClosed(false); + return aPolygon; +} + TestResult OutputDeviceTestCommon::checkDropShape(Bitmap& rBitmap, bool aEnableAA) { BitmapScopedWriteAccess pAccess(rBitmap); @@ -1095,6 +1109,61 @@ TestResult OutputDeviceTestCommon::checkEvenOddRuleInIntersectingRecs(Bitmap& rB return aReturnValue; } +TestResult OutputDeviceTestCommon::checkOpenPolygon(Bitmap& rBitmap, bool aEnableAA) +{ + std::vector<Color> aExpected = { constBackgroundColor, constLineColor, constLineColor }; + + BitmapScopedWriteAccess pAccess(rBitmap); + + TestResult aResult = TestResult::Passed; + int nNumberOfQuirks = 0; + int nNumberOfErrors = 0; + + for (size_t aLayerNumber = 0; aLayerNumber < aExpected.size(); aLayerNumber++) + { + tools::Long startX = aLayerNumber + 1, endX = pAccess->Width() / 2 - aLayerNumber; + tools::Long startY = aLayerNumber + 2, endY = pAccess->Height() - aLayerNumber - 3; + + for (tools::Long ptX = startX; ptX <= endX; ++ptX) + { + if (aEnableAA) + { + checkValueAA(pAccess, ptX, endY - (aLayerNumber == 2 ? 2 : 0), + aExpected[aLayerNumber], nNumberOfQuirks, nNumberOfErrors); + } + else + { + checkValue(pAccess, ptX, endY - (aLayerNumber == 2 ? 2 : 0), + aExpected[aLayerNumber], nNumberOfQuirks, nNumberOfErrors, true); + } + } + for (tools::Long ptY = startY + (aLayerNumber == 2 ? 2 : 0); + ptY <= endY - (aLayerNumber == 2 ? 2 : 0); ++ptY) + { + if (aEnableAA) + { + checkValueAA(pAccess, startX, ptY, aExpected[aLayerNumber], nNumberOfQuirks, + nNumberOfErrors); + checkValueAA(pAccess, endX, ptY, aExpected[aLayerNumber], nNumberOfQuirks, + nNumberOfErrors); + } + else + { + checkValue(pAccess, startX, ptY, aExpected[aLayerNumber], nNumberOfQuirks, + nNumberOfErrors, true); + checkValue(pAccess, endX, ptY, aExpected[aLayerNumber], nNumberOfQuirks, + nNumberOfErrors, true); + } + } + } + + if (nNumberOfQuirks > 0) + aResult = TestResult::PassedWithQuirks; + if (nNumberOfErrors > 0) + aResult = TestResult::Failed; + return aResult; +} + // Check 'count' pixels from (x,y) in (addX,addY) direction, the color values must not decrease. static bool checkGradient(BitmapScopedWriteAccess& pAccess, int x, int y, int count, int addX, int addY) { diff --git a/vcl/backendtest/outputdevice/polygon.cxx b/vcl/backendtest/outputdevice/polygon.cxx index 6b52ccabf72c..051c0d893cb1 100644 --- a/vcl/backendtest/outputdevice/polygon.cxx +++ b/vcl/backendtest/outputdevice/polygon.cxx @@ -239,6 +239,19 @@ Bitmap OutputDeviceTestPolygon::setupRectangleOnSize4096() return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } +Bitmap OutputDeviceTestPolygon::setupOpenPolygon() +{ + initialSetup(21, 21, constBackgroundColor); + + mpVirtualDevice->SetLineColor(constLineColor); + mpVirtualDevice->SetFillColor(); + + mpVirtualDevice->DrawPolygon(tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle))); + mpVirtualDevice->DrawPolygon(tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle, 7))); + + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); +} + } // end namespace vcl::test /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/backendtest/outputdevice/polyline.cxx b/vcl/backendtest/outputdevice/polyline.cxx index 86f9de6306b4..da5a4a6474c6 100644 --- a/vcl/backendtest/outputdevice/polyline.cxx +++ b/vcl/backendtest/outputdevice/polyline.cxx @@ -213,6 +213,21 @@ Bitmap OutputDeviceTestPolyLine::setupRectangleOnSize4096() return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } +Bitmap OutputDeviceTestPolyLine::setupOpenPolygon() +{ + initialSetup(21, 21, constBackgroundColor); + + mpVirtualDevice->SetLineColor(constLineColor); + mpVirtualDevice->SetFillColor(); + + mpVirtualDevice->DrawPolyLine( + tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle))); + mpVirtualDevice->DrawPolyLine( + tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle, 7))); + + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); +} + } // end namespace vcl::test /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/backendtest/outputdevice/polyline_b2d.cxx b/vcl/backendtest/outputdevice/polyline_b2d.cxx index cef4c6e66aeb..1284a3fa8074 100644 --- a/vcl/backendtest/outputdevice/polyline_b2d.cxx +++ b/vcl/backendtest/outputdevice/polyline_b2d.cxx @@ -162,6 +162,19 @@ Bitmap OutputDeviceTestPolyLineB2D::setupRectangleOnSize4096() return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } +Bitmap OutputDeviceTestPolyLineB2D::setupOpenPolygon() +{ + initialSetup(21, 21, constBackgroundColor); + + mpVirtualDevice->SetLineColor(constLineColor); + mpVirtualDevice->SetFillColor(); + + mpVirtualDevice->DrawPolyLine(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle)); + mpVirtualDevice->DrawPolyLine(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle, 7)); + + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); +} + } // end namespace vcl::test /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/backendtest/outputdevice/polypolygon.cxx b/vcl/backendtest/outputdevice/polypolygon.cxx index 8c96f2d33447..e1abb2f9014b 100644 --- a/vcl/backendtest/outputdevice/polypolygon.cxx +++ b/vcl/backendtest/outputdevice/polypolygon.cxx @@ -190,6 +190,23 @@ Bitmap OutputDeviceTestPolyPolygon::setupRectangleOnSize4096() return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } +Bitmap OutputDeviceTestPolyPolygon::setupOpenPolygon() +{ + initialSetup(21, 21, constBackgroundColor); + + mpVirtualDevice->SetLineColor(constLineColor); + mpVirtualDevice->SetFillColor(); + + tools::PolyPolygon aPolyPolygon; + aPolyPolygon.Insert(tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle))); + aPolyPolygon.Insert( + tools::Polygon(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle, 7))); + + mpVirtualDevice->DrawPolyPolygon(aPolyPolygon); + + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); +} + } // end namespace vcl::test /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/backendtest/outputdevice/polypolygon_b2d.cxx b/vcl/backendtest/outputdevice/polypolygon_b2d.cxx index 432fc429b6e5..59391abe1922 100644 --- a/vcl/backendtest/outputdevice/polypolygon_b2d.cxx +++ b/vcl/backendtest/outputdevice/polypolygon_b2d.cxx @@ -178,6 +178,22 @@ Bitmap OutputDeviceTestPolyPolygonB2D::setupRectangleOnSize4096() return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } +Bitmap OutputDeviceTestPolyPolygonB2D::setupOpenPolygon() +{ + initialSetup(21, 21, constBackgroundColor); + + mpVirtualDevice->SetLineColor(constLineColor); + mpVirtualDevice->SetFillColor(); + + basegfx::B2DPolyPolygon aPolyPolygon; + aPolyPolygon.append(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle)); + aPolyPolygon.append(OutputDeviceTestCommon::createOpenPolygon(maVDRectangle, 7)); + + mpVirtualDevice->DrawPolyPolygon(aPolyPolygon); + + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); +} + } // end namespace vcl::test /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx index 7e6f09040d03..c63c97a1e48c 100644 --- a/vcl/inc/test/outputdevice.hxx +++ b/vcl/inc/test/outputdevice.hxx @@ -71,6 +71,7 @@ public: static tools::Polygon createDropShapePolygon(); static basegfx::B2DPolygon createHalfEllipsePolygon(); static tools::Polygon createClosedBezierLoop(const tools::Rectangle& rRect); + static basegfx::B2DPolygon createOpenPolygon(tools::Rectangle& rRect, int nOffset = 4); static void createHorizontalVerticalDiagonalLinePoints(tools::Rectangle rRect, Point& rHorizontalLinePoint1, Point& rHorizontalLinePoint2, @@ -96,6 +97,7 @@ public: static TestResult checkTextLocation(Bitmap& rBitmap); static TestResult checkEvenOddRuleInIntersectingRecs(Bitmap &rBitmap); static TestResult checkIntersectingRecs(Bitmap& rBitmap,int aLayerNumber, Color aExpectedColor); + static TestResult checkOpenPolygon(Bitmap& rBitmap, bool aEnableAA = false); private: static TestResult checkLineCap(Bitmap& rBitmap, css::drawing::LineCap lineCap); static TestResult checkLineJoin(Bitmap& rBitmap, basegfx::B2DLineJoin lineJoin); @@ -186,6 +188,7 @@ public: Bitmap setupClosedBezier(); Bitmap setupRectangleOnSize1028(); Bitmap setupRectangleOnSize4096(); + Bitmap setupOpenPolygon(); }; class VCL_DLLPUBLIC OutputDeviceTestPolyLineB2D : public OutputDeviceTestCommon @@ -200,6 +203,7 @@ public: Bitmap setupHalfEllipse(bool aEnableAA = false); Bitmap setupRectangleOnSize1028(); Bitmap setupRectangleOnSize4096(); + Bitmap setupOpenPolygon(); }; class VCL_DLLPUBLIC OutputDeviceTestRect : public OutputDeviceTestCommon @@ -233,6 +237,7 @@ public: Bitmap setupFilledAsymmetricalDropShape(); Bitmap setupRectangleOnSize1028(); Bitmap setupRectangleOnSize4096(); + Bitmap setupOpenPolygon(); }; class VCL_DLLPUBLIC OutputDeviceTestPolyPolygon : public OutputDeviceTestCommon @@ -245,6 +250,7 @@ public: Bitmap setupIntersectingRectangles(); Bitmap setupRectangleOnSize1028(); Bitmap setupRectangleOnSize4096(); + Bitmap setupOpenPolygon(); }; class VCL_DLLPUBLIC OutputDeviceTestPolyPolygonB2D : public OutputDeviceTestCommon @@ -257,6 +263,7 @@ public: Bitmap setupIntersectingRectangles(); Bitmap setupRectangleOnSize1028(); Bitmap setupRectangleOnSize4096(); + Bitmap setupOpenPolygon(); }; class VCL_DLLPUBLIC OutputDeviceTestGradient : public OutputDeviceTestCommon diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index 3d14c811f022..ffb44b5fe3c1 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -1223,6 +1223,56 @@ public: CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } + void testDrawOpenPolygonWithPolyLine() + { + vcl::test::OutputDeviceTestPolyLine aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + auto eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + exportImage("19-01_open_polygon-polyline.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + } + + void testDrawOpenPolygonWithPolyLineB2D() + { + vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + auto eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + exportImage("19-02_open_polygon-polyline_b2d.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + } + + void testDrawOpenPolygonWithPolygon() + { + vcl::test::OutputDeviceTestPolygon aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + auto eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + exportImage("19-03_open_polygon-polygon.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + } + + void testDrawOpenPolygonWithPolyPolygon() + { + vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + auto eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + exportImage("19-04_open_polygon-polypolygon.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + } + + void testDrawOpenPolygonWithPolyPolygonB2D() + { + vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; + Bitmap aBitmap = aOutDevTest.setupOpenPolygon(); + auto eResult = vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap); + exportImage("19-04_open_polygon-polypolygon_b2d.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + } + void testTdf124848() { // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented @@ -1395,6 +1445,12 @@ public: CPPUNIT_TEST(testDrawingText); CPPUNIT_TEST(testEvenOddRuleInIntersectionRectangles); + CPPUNIT_TEST(testDrawOpenPolygonWithPolyLine); + CPPUNIT_TEST(testDrawOpenPolygonWithPolyLineB2D); + CPPUNIT_TEST(testDrawOpenPolygonWithPolygon); + CPPUNIT_TEST(testDrawOpenPolygonWithPolyPolygon); + CPPUNIT_TEST(testDrawOpenPolygonWithPolyPolygonB2D); + CPPUNIT_TEST(testTdf124848); CPPUNIT_TEST(testTdf136171);