summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-06-28 23:46:37 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-29 10:40:06 +0200
commit14c40c460526f2e4ed2c24a3f50baae25a43a8f2 (patch)
treeabe0964a546eddf5ade34bb71a6faa8fc6913f17 /svgio/qa/cppunit
parentdb591df99424dd7e1837946b36ca0658a02d520c (diff)
tdf#156066: Add support for feDropShadow filter
Change-Id: I0b2772a7211efb91821853e3369cfc3a5ef6a932 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx17
-rw-r--r--svgio/qa/cppunit/data/filterFeDropShadow.svg10
2 files changed, 27 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 9383b7ac5430..5aa25aed5b1e 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -221,6 +221,23 @@ CPPUNIT_TEST_FIXTURE(Test, testFilterFeFlood)
assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/polypolygoncolor/polypolygon", "miny", "50");
}
+CPPUNIT_TEST_FIXTURE(Test, testFilterFeDropShadow)
+{
+ Primitive2DSequence aSequenceTdf132246 = parseSvg(u"/svgio/qa/cppunit/data/filterFeDropShadow.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf132246.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequenceTdf132246);
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "50");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/shadow", "color", "#0000ff");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/shadow", "blur", "0.2");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence/shadow", "blur", "0.2");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#ffc0cb");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf87309)
{
Primitive2DSequence aSequenceTdf87309 = parseSvg(u"/svgio/qa/cppunit/data/tdf87309.svg");
diff --git a/svgio/qa/cppunit/data/filterFeDropShadow.svg b/svgio/qa/cppunit/data/filterFeDropShadow.svg
new file mode 100644
index 000000000000..a6405c93af15
--- /dev/null
+++ b/svgio/qa/cppunit/data/filterFeDropShadow.svg
@@ -0,0 +1,10 @@
+<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <filter id="shadow">
+ <feDropShadow dx="0.6" dy="0.4" stdDeviation="0.2" flood-color="blue" flood-opacity="0.5" />
+ </filter>
+ </defs>
+
+ <circle cx="5" cy="50%" r="4" style="fill:pink; filter:url(#shadow);" />
+</svg>
+