diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-14 12:39:06 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-14 21:08:17 +0200 |
commit | 41bf4139cab36984cff514bfdd6b1b13576746a3 (patch) | |
tree | f976deb977ad2b7bc372b1193fde8984a3842bd8 /svgio/qa/cppunit | |
parent | b6474249caa697513affdbcb02c7a69fda8203be (diff) |
tdf#155735: Add support for saturate type
Add getModifierName to BColorModifier class so when
can assert which modifier is being used
Change-Id: I2bc2a36470a449df4dc84a8440f232149c1f8278
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153048
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 21 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/filterSaturate.svg | 11 |
2 files changed, 28 insertions, 4 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 559af49af695..bdfbfcccb911 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -153,17 +153,30 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155819) assertXPath(pDocument, "/primitive2D/transform/transform", 4); } +CPPUNIT_TEST_FIXTURE(Test, testFilterSaturate) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/filterSaturate.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/modifiedColor", "modifier", "saturate"); +} + CPPUNIT_TEST_FIXTURE(Test, testFilterLuminanceToAlpha) { - Primitive2DSequence aSequenceTdf132246 = parseSvg(u"/svgio/qa/cppunit/data/filterLuminanceToAlpha.svg"); - CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceTdf132246.getLength())); + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/filterLuminanceToAlpha.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); drawinglayer::Primitive2dXmlDump dumper; - xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequenceTdf132246); + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); CPPUNIT_ASSERT (pDocument); - assertXPath(pDocument, "/primitive2D/transform/modifiedColor"); + assertXPath(pDocument, "/primitive2D/transform/modifiedColor", "modifier", "luminance_to_alpha"); } CPPUNIT_TEST_FIXTURE(Test, testFilterFeGaussianBlur) diff --git a/svgio/qa/cppunit/data/filterSaturate.svg b/svgio/qa/cppunit/data/filterSaturate.svg new file mode 100644 index 000000000000..3fc1ab89f538 --- /dev/null +++ b/svgio/qa/cppunit/data/filterSaturate.svg @@ -0,0 +1,11 @@ +<svg + width="230" + height="120" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <filter id="saturate"> + <feColorMatrix type="saturate" values="0.5"/> + </filter> + <circle cx="170" cy="60" r="50" fill="green" filter="url(#saturate)" /> +</svg> + |