summaryrefslogtreecommitdiff
path: root/vcl/backendtest/VisualBackendTest.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-05-22 18:59:33 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-05-22 22:10:00 +0200
commit7f264f4beec931833b390ae1bbb93b2e22b4ad8a (patch)
treebb52e49618173c48d67103b0233bbc1dcf832925 /vcl/backendtest/VisualBackendTest.cxx
parentec11b7330fab72dc56d847c7c3691fddbb18096e (diff)
always use region band in Skia's setClipRegion (tdf#133208)
Do like other VCL backends do. Change-Id: I64b5d5a2fb131b41c70aa63eaf84022e9aa9fab5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94702 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/backendtest/VisualBackendTest.cxx')
-rw-r--r--vcl/backendtest/VisualBackendTest.cxx43
1 files changed, 42 insertions, 1 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx
index fb39156714a7..5daa9a642d55 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 = 8;
+ static constexpr unsigned char gnNumberOfTests = 9;
unsigned char mnTest;
bool mbAnimate;
ScopedVclPtr<VirtualDevice> mpVDev;
@@ -435,6 +435,43 @@ public:
}
}
+ static void testClip(vcl::RenderContext& rRenderContext, int nWidth, int nHeight)
+ {
+ tools::Rectangle aRectangle;
+ size_t index = 0;
+
+ std::vector<tools::Rectangle> aRegions = setupRegions(2, 2, nWidth, nHeight);
+
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestClip aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupClipRectangle();
+ assertAndSetBackground(vcl::test::OutputDeviceTestClip::checkClip(aBitmap), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestClip aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupClipPolygon();
+ assertAndSetBackground(vcl::test::OutputDeviceTestClip::checkClip(aBitmap), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestClip aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupClipPolyPolygon();
+ assertAndSetBackground(vcl::test::OutputDeviceTestClip::checkClip(aBitmap), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+ aRectangle = aRegions[index++];
+ {
+ vcl::test::OutputDeviceTestClip aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupClipB2DPolyPolygon();
+ assertAndSetBackground(vcl::test::OutputDeviceTestClip::checkClip(aBitmap), aRectangle, rRenderContext);
+ drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+ }
+ }
+
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) override
{
if (mnTest % gnNumberOfTests == gnNumberOfTests - 1)
@@ -535,6 +572,10 @@ public:
}
else if (mnTest % gnNumberOfTests == 6)
{
+ testClip(rRenderContext, nWidth, nHeight);
+ }
+ else if (mnTest % gnNumberOfTests == 7)
+ {
std::vector<tools::Rectangle> aRegions = setupRegions(3, 1, nWidth, nHeight);
aRectangle = aRegions[index++];