summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-10-24 22:22:11 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-11-27 09:55:12 +0100
commit37a88941ff128b04ed12776495e252460d240a27 (patch)
tree64641073ab9b1035de6a4024f7b221ccf689c8d6 /vcl/qa
parent84f25280a77100ea8b204a741916c064f9a9a63b (diff)
backendtests: add some bitmap tests
Change-Id: If791dd113fb484ccdd81a2ee7c1f217057a918ca
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/BackendTest.cxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index f3ba4195d5c3..cfa41e0dc790 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -337,6 +337,46 @@ public:
CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
}
+ void testDrawBitmap()
+ {
+ vcl::test::OutputDeviceTestBitmap aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupDrawBitmap();
+ exportImage("08-01_bitmap_test.png", aBitmap);
+ auto eResult = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap);
+ if (aOutDevTest.getRenderBackendName() == "skia")
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ }
+
+ void testDrawTransformedBitmap()
+ {
+ vcl::test::OutputDeviceTestBitmap aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap();
+ auto eResult = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap);
+ exportImage("08-02_transformed_bitmap_test.png", aBitmap);
+ if (aOutDevTest.getRenderBackendName() == "skia")
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ }
+
+ void testDrawBitmapExWithAlpha()
+ {
+ vcl::test::OutputDeviceTestBitmap aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupDrawBitmapExWithAlpha();
+ auto eResult = vcl::test::OutputDeviceTestBitmap::checkBitmapExWithAlpha(aBitmap);
+ exportImage("08-03_bitmapex_with_alpha_test.png", aBitmap);
+ if (aOutDevTest.getRenderBackendName() == "skia")
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ }
+
+ void testDrawMask()
+ {
+ vcl::test::OutputDeviceTestBitmap aOutDevTest;
+ Bitmap aBitmap = aOutDevTest.setupDrawMask();
+ auto eResult = vcl::test::OutputDeviceTestBitmap::checkMask(aBitmap);
+ exportImage("08-04_mask_test.png", aBitmap);
+ if (aOutDevTest.getRenderBackendName() == "skia")
+ CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed);
+ }
+
CPPUNIT_TEST_SUITE(BackendTest);
CPPUNIT_TEST(testDrawRectWithRectangle);
CPPUNIT_TEST(testDrawRectWithPixel);
@@ -373,6 +413,11 @@ public:
CPPUNIT_TEST(testDrawBezierWithPolylineB2D);
CPPUNIT_TEST(testDrawBezierAAWithPolylineB2D);
+ CPPUNIT_TEST(testDrawBitmap);
+ CPPUNIT_TEST(testDrawTransformedBitmap);
+ CPPUNIT_TEST(testDrawBitmapExWithAlpha);
+ CPPUNIT_TEST(testDrawMask);
+
CPPUNIT_TEST_SUITE_END();
};