summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-01-14 16:30:59 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-01-16 16:33:59 +0100
commitdfe106c8a939ef051135bb6d546ba2d50afa766e (patch)
treefc0b256fb97b7f168ccf5c357eb42a84b32b29f4 /vcl/qa
parentb1d3ef798a89d11b853c467fa9ce0fe6ed235735 (diff)
implement xor drawing for Skia
Fortunately it seems this is largely unused (I can see 5 invocations when running all LO tests), so I went for the crude approach of redirecting all drawing to a temporary bitmap and then manually xor-ing all the data after each draw operation. This could be optimized if needed. Change-Id: I6fc91362dd93188775b371d5548a68a58645f85c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86776 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/BackendTest.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 07c6d03d2a0c..802e4eb239c6 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -430,7 +430,17 @@ public:
BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend();
auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx);
exportImage("08-05_blend_test.png", aBitmapEx);
- if (aOutDevTest.getRenderBackendName() == "skia")
+ if (SHOULD_ASSERT)
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ }
+
+ void testDrawXor()
+ {
+ vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupXOR();
+ auto eResult = vcl::test::OutputDeviceTestAnotherOutDev::checkXOR(aBitmap);
+ exportImage("08-06_xor_test.png", aBitmap);
+ if (SHOULD_ASSERT)
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
@@ -475,6 +485,7 @@ public:
CPPUNIT_TEST(testDrawBitmapExWithAlpha);
CPPUNIT_TEST(testDrawMask);
CPPUNIT_TEST(testDrawBlend);
+ CPPUNIT_TEST(testDrawXor);
CPPUNIT_TEST_SUITE_END();
};