summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-06-06 19:04:50 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-07 14:49:42 +0200
commit77354ba8695f66331bfc6cc3f5e3f2e9d15f1740 (patch)
tree58794916319f20cf045293fc4a8b7b50e56565cc /svgio/qa/cppunit
parent225f79a068a1b5a51b82f9d1a6b1fc756b572873 (diff)
tdf#132246: add basic support for feGaussianBlur
for now only apply it if in="SourceGraphic" is explicitly used Change-Id: I3daea354f61ba5f6b3d13da1e7a71e99d51f6729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152684 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx21
-rw-r--r--svgio/qa/cppunit/data/filterFeGaussianBlur.svg11
2 files changed, 27 insertions, 5 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 6e4ac0255677..967bcc0275cf 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -24,9 +24,6 @@
#include <memory>
#include <string_view>
-namespace
-{
-
using namespace css;
using namespace css::uno;
using namespace css::io;
@@ -82,6 +79,8 @@ void Test::checkRectPrimitive(Primitive2DSequence const & rPrimitive)
}
+namespace
+{
bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB)
{
return std::equal(rA.begin(), rA.end(), rB.begin(), rB.end(),
@@ -91,6 +90,7 @@ bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive
return drawinglayer::primitive2d::arePrimitive2DReferencesEqual(a, b);
});
}
+}
// Attributes for an object (like rect as in this case) can be defined
// in different ways (directly with xml attributes, or with CSS styles),
@@ -135,6 +135,19 @@ CPPUNIT_TEST_FIXTURE(Test, testSymbol)
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00d000");
}
+CPPUNIT_TEST_FIXTURE(Test, testFilterFeGaussianBlur)
+{
+ Primitive2DSequence aSequenceTdf132246 = parseSvg(u"/svgio/qa/cppunit/data/filterFeGaussianBlur.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/softedge", "radius", "5");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf87309)
{
Primitive2DSequence aSequenceTdf87309 = parseSvg(u"/svgio/qa/cppunit/data/tdf87309.svg");
@@ -1055,8 +1068,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTspanFillOpacity)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(70), nTransparence);
}
-}
-
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svgio/qa/cppunit/data/filterFeGaussianBlur.svg b/svgio/qa/cppunit/data/filterFeGaussianBlur.svg
new file mode 100644
index 000000000000..e8fd73068a0b
--- /dev/null
+++ b/svgio/qa/cppunit/data/filterFeGaussianBlur.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="blurMe">
+ <feGaussianBlur in="SourceGraphic" stdDeviation="5"/>
+ </filter>
+ <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurMe)" />
+</svg>
+