summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-29 07:57:23 +0900
committerTomaž Vajngerl <quikee@gmail.com>2019-04-29 03:53:50 +0200
commit4c868602960a362edbea28a53535bdee4cfc2230 (patch)
treebe55e4bb004435ff9ab28b4cb04f6e220a0f5c35 /vcl
parent405bfa05226116d05f1b87c92d4760dbab184314 (diff)
Add MetaActionTransparent to the SVM test
Change-Id: Ia927070883e5647b61876e31d6a0a085e2456f8a Reviewed-on: https://gerrit.libreoffice.org/71498 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx39
1 files changed, 37 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 406eeb551360..a4cecaa12b14 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -156,7 +156,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools
void checkRasterOp(const GDIMetaFile& rMetaFile);
void testRasterOp();
- //void checkTransparent(const GDIMetaFile& rMetaFile);
+ void checkTransparent(const GDIMetaFile& rMetaFile);
void testTransparent();
//void checkFloatTransparent(const GDIMetaFile& rMetaFile);
@@ -1517,8 +1517,43 @@ void SvmTest::testRasterOp()
checkRasterOp(writeAndRead(aGDIMetaFile, "rasterop.svm"));
}
+void SvmTest::checkTransparent(const GDIMetaFile& rMetaFile)
+{
+ xmlDocPtr pDoc = dumpMeta(rMetaFile);
+
+ assertXPathAttrs(pDoc, "/metafile/transparent[1]", {
+ {"transparence", "50"},
+ });
+
+ assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[1]", {
+ {"x", "1"}, {"y", "8"},
+ });
+ assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[2]", {
+ {"x", "2"}, {"y", "7"},
+ });
+ assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[3]", {
+ {"x", "3"}, {"y", "6"},
+ });
+}
+
void SvmTest::testTransparent()
-{}
+{
+ GDIMetaFile aGDIMetaFile;
+ ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
+ setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
+
+ tools::Polygon aPolygon(3);
+ aPolygon.SetPoint(Point(1, 8), 0);
+ aPolygon.SetPoint(Point(2, 7), 1);
+ aPolygon.SetPoint(Point(3, 6), 2);
+
+ tools::PolyPolygon aPolyPolygon(1);
+ aPolyPolygon.Insert(aPolygon);
+
+ pVirtualDev->DrawTransparent(aPolygon, 50);
+
+ checkTransparent(writeAndRead(aGDIMetaFile, "transparent.svm"));
+}
void SvmTest::testFloatTransparent()
{}