summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-06-26 22:16:12 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-26 23:15:03 +0200
commit9951ffedd6941234447b9655fbc49ed6ca4cc64c (patch)
tree6bd1034aa6888b6c48a5ba6b4714a5736064ba83 /svgio
parent1be3ab048d417611055a76d1776a0a69eb6fc6dd (diff)
Revert "tdf#132246, tdf#155735: Add support for SourceAlpha"
This reverts commit 75399b8aad6c0f0998b9d0a6eddb2e29f8bc114c. it was incomplete. While at it, do not parse 'in' attribute for now, so only in="SourceGraphic" is used. Implementing the 'in' attribute is not trivial Change-Id: I66c721c1144638f5e3759e0aa3a1c2c062499a90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153627 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgfecolormatrixnode.hxx2
-rw-r--r--svgio/inc/svgfegaussianblurnode.hxx2
-rw-r--r--svgio/inc/svgfilternode.hxx6
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx3
-rw-r--r--svgio/qa/cppunit/data/filterFeGaussianBlur.svg2
-rw-r--r--svgio/source/svgreader/svgfecolormatrixnode.cxx21
-rw-r--r--svgio/source/svgreader/svgfegaussianblurnode.cxx37
7 files changed, 6 insertions, 67 deletions
diff --git a/svgio/inc/svgfecolormatrixnode.hxx b/svgio/inc/svgfecolormatrixnode.hxx
index d3fafb64e969..78d8b027f653 100644
--- a/svgio/inc/svgfecolormatrixnode.hxx
+++ b/svgio/inc/svgfecolormatrixnode.hxx
@@ -20,7 +20,6 @@
#pragma once
#include "svgnode.hxx"
-#include "svgfilternode.hxx"
#include "svgstyleattributes.hxx"
#include <basegfx/matrix/b3dhommatrix.hxx>
@@ -40,7 +39,6 @@ class SvgFeColorMatrixNode final : public SvgNode
private:
ColorType maType;
OUString maValuesContent;
- In maIn;
public:
SvgFeColorMatrixNode(SvgDocument& rDocument, SvgNode* pParent);
diff --git a/svgio/inc/svgfegaussianblurnode.hxx b/svgio/inc/svgfegaussianblurnode.hxx
index 68068d97ce93..0bef266f9368 100644
--- a/svgio/inc/svgfegaussianblurnode.hxx
+++ b/svgio/inc/svgfegaussianblurnode.hxx
@@ -20,7 +20,6 @@
#pragma once
#include "svgnode.hxx"
-#include "svgfilternode.hxx"
#include "svgstyleattributes.hxx"
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -30,7 +29,6 @@ class SvgFeGaussianBlurNode final : public SvgNode
{
private:
SvgNumber maStdDeviation;
- In maIn;
public:
SvgFeGaussianBlurNode(SvgDocument& rDocument, SvgNode* pParent);
diff --git a/svgio/inc/svgfilternode.hxx b/svgio/inc/svgfilternode.hxx
index 520471501a11..19ce2cb34b33 100644
--- a/svgio/inc/svgfilternode.hxx
+++ b/svgio/inc/svgfilternode.hxx
@@ -25,12 +25,6 @@
namespace svgio::svgreader
{
-enum class In
-{
- SourceGraphic,
- SourceAlpha
-};
-
class SvgFilterNode final : public SvgNode
{
public:
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 7607a5593256..c3bbc0f9c211 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -179,8 +179,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFilterFeGaussianBlur)
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/modifiedColor", "modifier", "alpha");
- assertXPath(pDocument, "/primitive2D/transform/modifiedColor/softedge", "radius", "5");
+ assertXPath(pDocument, "/primitive2D/transform/softedge", "radius", "5");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf87309)
diff --git a/svgio/qa/cppunit/data/filterFeGaussianBlur.svg b/svgio/qa/cppunit/data/filterFeGaussianBlur.svg
index 917a7592d51d..e8fd73068a0b 100644
--- a/svgio/qa/cppunit/data/filterFeGaussianBlur.svg
+++ b/svgio/qa/cppunit/data/filterFeGaussianBlur.svg
@@ -4,7 +4,7 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<filter id="blurMe">
- <feGaussianBlur in="SourceAlpha" stdDeviation="5"/>
+ <feGaussianBlur in="SourceGraphic" stdDeviation="5"/>
</filter>
<circle cx="170" cy="60" r="50" fill="green" filter="url(#blurMe)" />
</svg>
diff --git a/svgio/source/svgreader/svgfecolormatrixnode.cxx b/svgio/source/svgreader/svgfecolormatrixnode.cxx
index e5ba501469f9..03dc5cf24c1e 100644
--- a/svgio/source/svgreader/svgfecolormatrixnode.cxx
+++ b/svgio/source/svgreader/svgfecolormatrixnode.cxx
@@ -26,7 +26,6 @@ namespace svgio::svgreader
SvgFeColorMatrixNode::SvgFeColorMatrixNode(SvgDocument& rDocument, SvgNode* pParent)
: SvgNode(SVGToken::FeColorMatrix, rDocument, pParent)
, maType(ColorType::None)
- , maIn(In::SourceGraphic)
{
}
@@ -66,17 +65,6 @@ void SvgFeColorMatrixNode::parseAttribute(const OUString& /*rTokenName*/, SVGTok
maValuesContent = aContent;
break;
}
- case SVGToken::In:
- {
- if (!aContent.isEmpty())
- {
- if (o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"SourceAlpha"))
- {
- maIn = In::SourceAlpha;
- }
- }
- break;
- }
default:
{
break;
@@ -124,15 +112,6 @@ void SvgFeColorMatrixNode::apply(drawinglayer::primitive2d::Primitive2DContainer
std::move(rTarget), std::make_shared<basegfx::BColorModifier_matrix>(aMatrix)));
rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
}
-
- if (maIn == In::SourceAlpha)
- {
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
- std::move(rTarget), std::make_shared<basegfx::BColorModifier_alpha>()));
-
- rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
- }
}
} // end of namespace svgio::svgreader
diff --git a/svgio/source/svgreader/svgfegaussianblurnode.cxx b/svgio/source/svgreader/svgfegaussianblurnode.cxx
index 7dbe808a484a..03f3e4298a1b 100644
--- a/svgio/source/svgreader/svgfegaussianblurnode.cxx
+++ b/svgio/source/svgreader/svgfegaussianblurnode.cxx
@@ -18,7 +18,6 @@
*/
#include <svgfegaussianblurnode.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/softedgeprimitive2d.hxx>
#include <o3tl/string_view.hxx>
@@ -27,7 +26,6 @@ namespace svgio::svgreader
SvgFeGaussianBlurNode::SvgFeGaussianBlurNode(SvgDocument& rDocument, SvgNode* pParent)
: SvgNode(SVGToken::FeGaussianBlur, rDocument, pParent)
, maStdDeviation(SvgNumber(0.0))
- , maIn(In::SourceGraphic)
{
}
@@ -52,21 +50,6 @@ void SvgFeGaussianBlurNode::parseAttribute(const OUString& /*rTokenName*/, SVGTo
}
break;
}
- case SVGToken::In:
- {
- if (!aContent.isEmpty())
- {
- if (o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"SourceGraphic"))
- {
- maIn = In::SourceGraphic;
- }
- else if (o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"SourceAlpha"))
- {
- maIn = In::SourceAlpha;
- }
- }
- break;
- }
default:
{
break;
@@ -76,23 +59,11 @@ void SvgFeGaussianBlurNode::parseAttribute(const OUString& /*rTokenName*/, SVGTo
void SvgFeGaussianBlurNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const
{
- if (maStdDeviation.getNumber() != 0.0)
- {
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::SoftEdgePrimitive2D(maStdDeviation.getNumber(),
- std::move(rTarget)));
-
- rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
- }
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::SoftEdgePrimitive2D(maStdDeviation.getNumber(),
+ std::move(rTarget)));
- if (maIn == In::SourceAlpha)
- {
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
- std::move(rTarget), std::make_shared<basegfx::BColorModifier_alpha>()));
-
- rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
- }
+ rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
}
} // end of namespace svgio::svgreader