summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit/SvgImportTest.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 13:06:36 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 14:55:37 +0200
commitfdf3027a0eb8270d527b3e64c6157917a6718787 (patch)
tree52fcdf523db0ed223cc0e6a43a68a870ba6c95de /svgio/qa/cppunit/SvgImportTest.cxx
parent07137ccd7fbbf3afb1cabfc6ca71375293910a3a (diff)
tdf#159660: Add support for multiply mode in feBlend
Change-Id: I03230e122a10dd6ada6af357c674c278b6b99d9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166427 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit/SvgImportTest.cxx')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index c336458df004..8a97d5b93302 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -1821,6 +1821,50 @@ CPPUNIT_TEST_FIXTURE(Test, testScreenBlend)
CPPUNIT_ASSERT_EQUAL(OUString("008000"), aPixels[125]);
}
+CPPUNIT_TEST_FIXTURE(Test, testMultiplyBlend)
+{
+ xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/multiplyBlend.svg");
+
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "height"_ostr, "150");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "width"_ostr, "150");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap/data"_ostr, 150);
+
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy11"_ostr, "150");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy12"_ostr, "0");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy13"_ostr, "20");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy21"_ostr, "0");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy22"_ostr, "150");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy23"_ostr, "20");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy31"_ostr, "0");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy32"_ostr, "0");
+ assertXPath(pDocument,
+ "/primitive2D/transform/transform/bitmap"_ostr, "xy33"_ostr, "1");
+
+ // Check the colors in the diagonal
+ OUString sDataRow = getXPath(pDocument, "/primitive2D/transform/transform/bitmap/data[25]"_ostr, "row"_ostr);
+ std::vector<OUString> aPixels = comphelper::string::split(sDataRow, ',');
+ CPPUNIT_ASSERT_EQUAL(OUString("ff0000"), aPixels[25]);
+
+ sDataRow = getXPath(pDocument, "/primitive2D/transform/transform/bitmap/data[75]"_ostr, "row"_ostr);
+ aPixels = comphelper::string::split(sDataRow, ',');
+ CPPUNIT_ASSERT_EQUAL(OUString("000000"), aPixels[75]);
+
+ sDataRow = getXPath(pDocument, "/primitive2D/transform/transform/bitmap/data[125]"_ostr, "row"_ostr);
+ aPixels = comphelper::string::split(sDataRow, ',');
+ CPPUNIT_ASSERT_EQUAL(OUString("008000"), aPixels[125]);
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf149880)
{
xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/tdf149880.svg");