summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-11-01 13:44:20 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-26 13:24:55 +0100
commitdf172bfdb3ef4578345f4ba9ac0589a3765d031e (patch)
treec83d9e9ab079245b9d618d6726aa20bd8555db50 /vcl
parente1b05439b53a5f22fe9c3978e1c1c6b6a243f046 (diff)
use different line and fill color in vcl backendtest
Having them the same can hide problems with them fixed up incorrectly. And it also shows that drawPolygon() with line color unset does not draw the right-most and bottom-most line, which is what all underlying graphics systems do, so the test is kind of wrong and I've added a compensation to make it visually correct (and match the checked expected result). Change-Id: I333f41210232c74ba55bd5c92ef5fda917ce3e59
Diffstat (limited to 'vcl')
-rw-r--r--vcl/backendtest/VisualBackendTest.cxx54
-rw-r--r--vcl/backendtest/outputdevice/bitmap.cxx2
-rw-r--r--vcl/backendtest/outputdevice/common.cxx7
-rw-r--r--vcl/backendtest/outputdevice/line.cxx2
-rw-r--r--vcl/backendtest/outputdevice/outputdevice.cxx7
-rw-r--r--vcl/backendtest/outputdevice/polygon.cxx21
-rw-r--r--vcl/backendtest/outputdevice/polypolygon.cxx21
-rw-r--r--vcl/backendtest/outputdevice/polypolygon_b2d.cxx22
-rw-r--r--vcl/backendtest/outputdevice/rectangle.cxx7
-rw-r--r--vcl/inc/test/outputdevice.hxx10
-rw-r--r--vcl/qa/cppunit/BackendTest.cxx50
11 files changed, 145 insertions, 58 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx
index b2818f42e675..4110082a6985 100644
--- a/vcl/backendtest/VisualBackendTest.cxx
+++ b/vcl/backendtest/VisualBackendTest.cxx
@@ -90,7 +90,7 @@ class VisualBackendTestWindow : public WorkWindow
private:
Timer maUpdateTimer;
std::vector<std::chrono::high_resolution_clock::time_point> mTimePoints;
- static constexpr unsigned char gnNumberOfTests = 6;
+ static constexpr unsigned char gnNumberOfTests = 7;
unsigned char mnTest;
bool mbAnimate;
ScopedVclPtr<VirtualDevice> mpVDev;
@@ -227,29 +227,61 @@ public:
aRectangle = aRegions[index++];
{
vcl::test::OutputDeviceTestRect aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap), aRectangle, rRenderContext);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false), aRectangle, rRenderContext);
drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
}
aRectangle = aRegions[index++];
{
vcl::test::OutputDeviceTestPolygon aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap), aRectangle, rRenderContext);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false), aRectangle, rRenderContext);
drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
}
aRectangle = aRegions[index++];
{
vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap), aRectangle, rRenderContext);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false), aRectangle, rRenderContext);
drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
}
aRectangle = aRegions[index++];
{
+ vcl::test::OutputDeviceTestRect aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(true);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestPolygon aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(true);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(true);
+ assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+ }
+
+ static void testDiamonds(vcl::RenderContext& rRenderContext, int nWidth, int nHeight)
+ {
+ tools::Rectangle aRectangle;
+ size_t index = 0;
+
+ std::vector<tools::Rectangle> aRegions = setupRegions(3, 1, nWidth, nHeight);
+
+ aRectangle = aRegions[index++];
+ {
vcl::test::OutputDeviceTestPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDiamond();
assertAndSetBackground(vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap), aRectangle, rRenderContext);
@@ -443,14 +475,18 @@ public:
}
else if (mnTest % gnNumberOfTests == 2)
{
- testLines(rRenderContext, nWidth, nHeight);
+ testDiamonds(rRenderContext, nWidth, nHeight);
}
else if (mnTest % gnNumberOfTests == 3)
{
- testBitmaps(rRenderContext, nWidth, nHeight);
+ testLines(rRenderContext, nWidth, nHeight);
}
else if (mnTest % gnNumberOfTests == 4)
{
+ testBitmaps(rRenderContext, nWidth, nHeight);
+ }
+ else if (mnTest % gnNumberOfTests == 5)
+ {
std::vector<tools::Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight);
aRectangle = aRegions[index++];
diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx
index 58b7c5f03ff0..66a0a64adf49 100644
--- a/vcl/backendtest/outputdevice/bitmap.cxx
+++ b/vcl/backendtest/outputdevice/bitmap.cxx
@@ -107,7 +107,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawMask()
initialSetup(13, 13, constBackgroundColor);
- mpVirtualDevice->DrawMask(Point(2, 2), aBitmap, constFillColor);
+ mpVirtualDevice->DrawMask(Point(2, 2), aBitmap, constLineColor);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
}
diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx
index 00c7b473e88a..34e37e771f1f 100644
--- a/vcl/backendtest/outputdevice/common.cxx
+++ b/vcl/backendtest/outputdevice/common.cxx
@@ -220,7 +220,7 @@ TestResult checkDiamondLine(Bitmap& rBitmap, int aLayerNumber, Color aExpectedCo
const Color OutputDeviceTestCommon::constBackgroundColor(COL_LIGHTGRAY);
const Color OutputDeviceTestCommon::constLineColor(COL_LIGHTBLUE);
-const Color OutputDeviceTestCommon::constFillColor(COL_LIGHTBLUE);
+const Color OutputDeviceTestCommon::constFillColor(COL_BLUE);
OutputDeviceTestCommon::OutputDeviceTestCommon()
{}
@@ -366,12 +366,13 @@ TestResult OutputDeviceTestCommon::checkRectangleAA(Bitmap& aBitmap)
return checkRectangles(aBitmap, aExpected);
}
-TestResult OutputDeviceTestCommon::checkFilledRectangle(Bitmap& aBitmap)
+TestResult OutputDeviceTestCommon::checkFilledRectangle(Bitmap& aBitmap, bool useLineColor)
{
std::vector<Color> aExpected
{
constBackgroundColor, constBackgroundColor,
- constFillColor, constFillColor, constFillColor, constFillColor, constFillColor
+ useLineColor ? constLineColor : constFillColor,
+ constFillColor, constFillColor, constFillColor, constFillColor
};
return checkRectangles(aBitmap, aExpected);
}
diff --git a/vcl/backendtest/outputdevice/line.cxx b/vcl/backendtest/outputdevice/line.cxx
index ff03a777771e..a43c72a62dc0 100644
--- a/vcl/backendtest/outputdevice/line.cxx
+++ b/vcl/backendtest/outputdevice/line.cxx
@@ -48,7 +48,7 @@ Bitmap OutputDeviceTestLine::setupDiamond()
{
initialSetup(11, 11, constBackgroundColor);
- mpVirtualDevice->SetLineColor(constFillColor);
+ mpVirtualDevice->SetLineColor(constLineColor);
mpVirtualDevice->SetFillColor();
Point aPoint1, aPoint2, aPoint3, aPoint4;
diff --git a/vcl/backendtest/outputdevice/outputdevice.cxx b/vcl/backendtest/outputdevice/outputdevice.cxx
index 408ce09551f7..4f31501b6f3b 100644
--- a/vcl/backendtest/outputdevice/outputdevice.cxx
+++ b/vcl/backendtest/outputdevice/outputdevice.cxx
@@ -55,7 +55,12 @@ Bitmap OutputDeviceTestAnotherOutDev::setupXOR()
TestResult OutputDeviceTestAnotherOutDev::checkDrawOutDev(Bitmap& rBitmap)
{
- return checkFilledRectangle(rBitmap);
+ std::vector<Color> aExpected
+ {
+ constBackgroundColor, constBackgroundColor,
+ constFillColor, constFillColor, constFillColor, constFillColor, constFillColor
+ };
+ return checkRectangles(rBitmap, aExpected);
}
TestResult OutputDeviceTestAnotherOutDev::checkXOR(Bitmap& rBitmap)
diff --git a/vcl/backendtest/outputdevice/polygon.cxx b/vcl/backendtest/outputdevice/polygon.cxx
index 4a0fac9f92ed..f0977abfb5f6 100644
--- a/vcl/backendtest/outputdevice/polygon.cxx
+++ b/vcl/backendtest/outputdevice/polygon.cxx
@@ -16,13 +16,17 @@ namespace test {
namespace
{
-void drawPolygonOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
+void drawPolygonOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset, int nFix = 0)
{
+ // Note: According to https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html
+ // filling polygons always skips the right-most and bottom-most pixels, in order to avoid
+ // overlaps when drawing adjacent polygons. Specifying nFix = 1 allows to visually compensate
+ // for this by making the polygon explicitly larger.
tools::Polygon aPolygon(4);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
- aPolygon.SetPoint(Point(rRect.Right() - nOffset, rRect.Top() + nOffset), 1);
- aPolygon.SetPoint(Point(rRect.Right() - nOffset, rRect.Bottom() - nOffset), 2);
- aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset), 3);
+ aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
+ aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Bottom() - nOffset + nFix), 2);
+ aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
aPolygon.Optimize(PolyOptimizeFlags::CLOSE);
rDevice.DrawPolygon(aPolygon);
@@ -43,13 +47,16 @@ Bitmap OutputDeviceTestPolygon::setupRectangle(bool bEnableAA)
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
}
-Bitmap OutputDeviceTestPolygon::setupFilledRectangle()
+Bitmap OutputDeviceTestPolygon::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- mpVirtualDevice->SetLineColor();
+ if(useLineColor)
+ mpVirtualDevice->SetLineColor(constLineColor);
+ else
+ mpVirtualDevice->SetLineColor();
mpVirtualDevice->SetFillColor(constFillColor);
- drawPolygonOffset(*mpVirtualDevice, maVDRectangle, 2);
+ drawPolygonOffset(*mpVirtualDevice, maVDRectangle, 2, useLineColor ? 0 : 1);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
}
diff --git a/vcl/backendtest/outputdevice/polypolygon.cxx b/vcl/backendtest/outputdevice/polypolygon.cxx
index f36db1e9fd65..e5a527042bdc 100644
--- a/vcl/backendtest/outputdevice/polypolygon.cxx
+++ b/vcl/backendtest/outputdevice/polypolygon.cxx
@@ -17,13 +17,17 @@ namespace test {
namespace
{
-tools::Polygon createPolygonOffset(tools::Rectangle const & rRect, int nOffset)
+tools::Polygon createPolygonOffset(tools::Rectangle const & rRect, int nOffset, int nFix = 0)
{
+ // Note: According to https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html
+ // filling polygons always skips the right-most and bottom-most pixels, in order to avoid
+ // overlaps when drawing adjacent polygons. Specifying nFix = 1 allows to visually compensate
+ // for this by making the polygon explicitly larger.
tools::Polygon aPolygon(4);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
- aPolygon.SetPoint(Point(rRect.Right() - nOffset, rRect.Top() + nOffset), 1);
- aPolygon.SetPoint(Point(rRect.Right() - nOffset, rRect.Bottom() - nOffset), 2);
- aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset), 3);
+ aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
+ aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Bottom() - nOffset + nFix), 2);
+ aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
aPolygon.Optimize(PolyOptimizeFlags::CLOSE);
return aPolygon;
}
@@ -46,15 +50,18 @@ Bitmap OutputDeviceTestPolyPolygon::setupRectangle(bool bEnableAA)
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
}
-Bitmap OutputDeviceTestPolyPolygon::setupFilledRectangle()
+Bitmap OutputDeviceTestPolyPolygon::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- mpVirtualDevice->SetLineColor();
+ if(useLineColor)
+ mpVirtualDevice->SetLineColor(constLineColor);
+ else
+ mpVirtualDevice->SetLineColor();
mpVirtualDevice->SetFillColor(constFillColor);
tools::PolyPolygon aPolyPolygon(1);
- aPolyPolygon.Insert(createPolygonOffset(maVDRectangle, 2));
+ aPolyPolygon.Insert(createPolygonOffset(maVDRectangle, 2, useLineColor ? 0 : 1));
mpVirtualDevice->DrawPolyPolygon(aPolyPolygon);
diff --git a/vcl/backendtest/outputdevice/polypolygon_b2d.cxx b/vcl/backendtest/outputdevice/polypolygon_b2d.cxx
index 808e8637c3d8..977f73dcc1f4 100644
--- a/vcl/backendtest/outputdevice/polypolygon_b2d.cxx
+++ b/vcl/backendtest/outputdevice/polypolygon_b2d.cxx
@@ -16,13 +16,17 @@ namespace test
{
namespace
{
-basegfx::B2DPolygon createPolygonOffset(tools::Rectangle const& rRect, int nOffset)
+basegfx::B2DPolygon createPolygonOffset(tools::Rectangle const& rRect, int nOffset, int nFix = 0)
{
+ // Note: According to https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html
+ // filling polygons always skips the right-most and bottom-most pixels, in order to avoid
+ // overlaps when drawing adjacent polygons. Specifying nFix = 1 allows to visually compensate
+ // for this by making the polygon explicitly larger.
basegfx::B2DPolygon aPolygon{
basegfx::B2DPoint(rRect.Left() + nOffset, rRect.Top() + nOffset),
- basegfx::B2DPoint(rRect.Right() - nOffset, rRect.Top() + nOffset),
- basegfx::B2DPoint(rRect.Right() - nOffset, rRect.Bottom() - nOffset),
- basegfx::B2DPoint(rRect.Left() + nOffset, rRect.Bottom() - nOffset),
+ basegfx::B2DPoint(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset),
+ basegfx::B2DPoint(rRect.Right() - nOffset + nFix, rRect.Bottom() - nOffset + nFix),
+ basegfx::B2DPoint(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix),
};
aPolygon.setClosed(true);
return aPolygon;
@@ -46,14 +50,18 @@ Bitmap OutputDeviceTestPolyPolygonB2D::setupRectangle(bool bEnableAA)
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
}
-Bitmap OutputDeviceTestPolyPolygonB2D::setupFilledRectangle()
+Bitmap OutputDeviceTestPolyPolygonB2D::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- mpVirtualDevice->SetLineColor();
+ if (useLineColor)
+ mpVirtualDevice->SetLineColor(constLineColor);
+ else
+ mpVirtualDevice->SetLineColor();
mpVirtualDevice->SetFillColor(constFillColor);
- basegfx::B2DPolyPolygon aPolyPolygon(createPolygonOffset(maVDRectangle, 2));
+ basegfx::B2DPolyPolygon aPolyPolygon(
+ createPolygonOffset(maVDRectangle, 2, useLineColor ? 0 : 1));
mpVirtualDevice->DrawPolyPolygon(aPolyPolygon);
diff --git a/vcl/backendtest/outputdevice/rectangle.cxx b/vcl/backendtest/outputdevice/rectangle.cxx
index f861cc2f05bb..033ebb3c54ae 100644
--- a/vcl/backendtest/outputdevice/rectangle.cxx
+++ b/vcl/backendtest/outputdevice/rectangle.cxx
@@ -31,11 +31,14 @@ namespace
} // end anonymous namespace
-Bitmap OutputDeviceTestRect::setupFilledRectangle()
+Bitmap OutputDeviceTestRect::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- mpVirtualDevice->SetLineColor();
+ if(useLineColor)
+ mpVirtualDevice->SetLineColor(constLineColor);
+ else
+ mpVirtualDevice->SetLineColor();
mpVirtualDevice->SetFillColor(constFillColor);
drawRectOffset(*mpVirtualDevice, maVDRectangle, 2);
diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx
index fb625d7987f3..520436f66fea 100644
--- a/vcl/inc/test/outputdevice.hxx
+++ b/vcl/inc/test/outputdevice.hxx
@@ -50,7 +50,7 @@ public:
static TestResult checkRectangle(Bitmap& rBitmap);
static TestResult checkRectangleAA(Bitmap& rBitmap);
- static TestResult checkFilledRectangle(Bitmap& rBitmap);
+ static TestResult checkFilledRectangle(Bitmap& rBitmap, bool useLineColor);
static TestResult checkLines(Bitmap& rBitmap);
static TestResult checkAALines(Bitmap& rBitmap);
static TestResult checkDiamond(Bitmap& rBitmap);
@@ -155,7 +155,7 @@ public:
OutputDeviceTestRect() = default;
Bitmap setupRectangle(bool bEnableAA);
- Bitmap setupFilledRectangle();
+ Bitmap setupFilledRectangle(bool useLineColor);
Bitmap setupInvert_NONE();
Bitmap setupInvert_N50();
Bitmap setupInvert_TrackFrame();
@@ -167,7 +167,7 @@ public:
OutputDeviceTestPolygon() = default;
Bitmap setupRectangle(bool bEnableAA);
- Bitmap setupFilledRectangle();
+ Bitmap setupFilledRectangle(bool useLineColor);
Bitmap setupDiamond();
Bitmap setupLines();
Bitmap setupAALines();
@@ -179,7 +179,7 @@ public:
OutputDeviceTestPolyPolygon() = default;
Bitmap setupRectangle(bool bEnableAA);
- Bitmap setupFilledRectangle();
+ Bitmap setupFilledRectangle(bool useLineColor);
};
class VCL_DLLPUBLIC OutputDeviceTestPolyPolygonB2D : public OutputDeviceTestCommon
@@ -188,7 +188,7 @@ public:
OutputDeviceTestPolyPolygonB2D() = default;
Bitmap setupRectangle(bool bEnableAA);
- Bitmap setupFilledRectangle();
+ Bitmap setupFilledRectangle(bool useLineColor);
};
class VCL_DLLPUBLIC OutputDeviceTestGradient : public OutputDeviceTestCommon
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index fd9bf10eaff5..01a81c0f17f3 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -237,9 +237,14 @@ public:
void testDrawFilledRectWithRectangle()
{
vcl::test::OutputDeviceTestRect aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap);
- exportImage("03-01_filled_rectangle_test-rectangle.png", aBitmap);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false);
+ exportImage("03-01_filled_rectangle_test-rectangle_noline.png", aBitmap);
+ if (SHOULD_ASSERT)
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ aBitmap = aOutDevTest.setupFilledRectangle(true);
+ eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true);
+ exportImage("03-01_filled_rectangle_test-rectangle_line.png", aBitmap);
if (SHOULD_ASSERT)
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
@@ -247,9 +252,14 @@ public:
void testDrawFilledRectWithPolygon()
{
vcl::test::OutputDeviceTestPolygon aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap);
- exportImage("03-02_filled_rectangle_test-polygon.png", aBitmap);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false);
+ exportImage("03-02_filled_rectangle_test-polygon_noline.png", aBitmap);
+ if (SHOULD_ASSERT)
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ aBitmap = aOutDevTest.setupFilledRectangle(true);
+ eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true);
+ exportImage("03-02_filled_rectangle_test-polygon_line.png", aBitmap);
if (SHOULD_ASSERT)
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
@@ -257,9 +267,14 @@ public:
void testDrawFilledRectWithPolyPolygon()
{
vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap);
- exportImage("03-03_filled_rectangle_test-polypolygon.png", aBitmap);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false);
+ exportImage("03-03_filled_rectangle_test-polypolygon_noline.png", aBitmap);
+ if (SHOULD_ASSERT)
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ aBitmap = aOutDevTest.setupFilledRectangle(true);
+ eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true);
+ exportImage("03-03_filled_rectangle_test-polypolygon_line.png", aBitmap);
if (SHOULD_ASSERT)
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
@@ -267,9 +282,14 @@ public:
void testDrawFilledRectWithPolyPolygon2D()
{
vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest;
- Bitmap aBitmap = aOutDevTest.setupFilledRectangle();
- auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap);
- exportImage("03-04_filled_rectangle_test-polypolygon_b2d.png", aBitmap);
+ Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
+ auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false);
+ exportImage("03-04_filled_rectangle_test-polypolygon_b2d_noline.png", aBitmap);
+ if (SHOULD_ASSERT)
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ aBitmap = aOutDevTest.setupFilledRectangle(true);
+ eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true);
+ exportImage("03-04_filled_rectangle_test-polypolygon_b2d_line.png", aBitmap);
if (SHOULD_ASSERT)
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
@@ -434,9 +454,9 @@ public:
CPPUNIT_TEST(testDrawRectAAWithPolyPolygonB2D);
CPPUNIT_TEST(testDrawFilledRectWithRectangle);
- // CPPUNIT_TEST(testDrawFilledRectWithPolygon); TODO SKIA
- // CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon); TODO SKIA
- // CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon2D); TODO SKIA
+ CPPUNIT_TEST(testDrawFilledRectWithPolygon);
+ CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon);
+ CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon2D);
CPPUNIT_TEST(testDrawDiamondWithPolygon);
CPPUNIT_TEST(testDrawDiamondWithLine);