diff options
-rw-r--r-- | basegfx/source/color/bcolormodifier.cxx | 19 | ||||
-rwxr-xr-x | basegfx/test/BColorModifierTest.cxx | 27 | ||||
-rw-r--r-- | include/basegfx/color/bcolormodifier.hxx | 20 | ||||
-rw-r--r-- | svgio/inc/svgfecolormatrixnode.hxx | 2 | ||||
-rw-r--r-- | svgio/inc/svgfegaussianblurnode.hxx | 2 | ||||
-rw-r--r-- | svgio/inc/svgfilternode.hxx | 6 | ||||
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 3 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/filterFeGaussianBlur.svg | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgfecolormatrixnode.cxx | 21 | ||||
-rw-r--r-- | svgio/source/svgreader/svgfegaussianblurnode.cxx | 37 |
10 files changed, 6 insertions, 133 deletions
diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx index 1ed19a4003eb..9c9a196bb7f8 100644 --- a/basegfx/source/color/bcolormodifier.cxx +++ b/basegfx/source/color/bcolormodifier.cxx @@ -69,25 +69,6 @@ namespace basegfx return "invert"; } - BColorModifier_alpha::~BColorModifier_alpha() - { - } - - bool BColorModifier_alpha::operator==(const BColorModifier& rCompare) const - { - return dynamic_cast< const BColorModifier_alpha* >(&rCompare) != nullptr; - } - - ::basegfx::BColor BColorModifier_alpha::getModifiedColor(const ::basegfx::BColor& /*aSourceColor*/) const - { - return ::basegfx::BColor(0.0, 0.0, 0.0); - } - - OUString BColorModifier_alpha::getModifierName() const - { - return "alpha"; - } - BColorModifier_luminance_to_alpha::~BColorModifier_luminance_to_alpha() { } diff --git a/basegfx/test/BColorModifierTest.cxx b/basegfx/test/BColorModifierTest.cxx index 5ada0a33ddf9..3a08958018da 100755 --- a/basegfx/test/BColorModifierTest.cxx +++ b/basegfx/test/BColorModifierTest.cxx @@ -389,32 +389,6 @@ public: CPPUNIT_ASSERT(aBColorModifier->operator==(*aBColorModifier2)); } - void testAlpha() - { - const basegfx::BColorModifierSharedPtr aBColorModifier - = std::make_shared<basegfx::BColorModifier_alpha>(); - - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maWhite)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maGray)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maBlack)); - - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maRed)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maGreen)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maBlue)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maYellow)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maMagenta)); - CPPUNIT_ASSERT_EQUAL(maBlack, aBColorModifier->getModifiedColor(maCyan)); - - CPPUNIT_ASSERT(aBColorModifier->operator==(*aBColorModifier)); - const basegfx::BColorModifierSharedPtr aBColorModifierInvert - = std::make_shared<basegfx::BColorModifier_invert>(); - CPPUNIT_ASSERT(*aBColorModifier != *aBColorModifierInvert); - - const basegfx::BColorModifierSharedPtr aBColorModifier2 - = std::make_shared<basegfx::BColorModifier_alpha>(); - CPPUNIT_ASSERT(aBColorModifier->operator==(*aBColorModifier2)); - } - CPPUNIT_TEST_SUITE(bcolormodifier); CPPUNIT_TEST(testGray); CPPUNIT_TEST(testInvert); @@ -426,7 +400,6 @@ public: CPPUNIT_TEST(testMatrix); CPPUNIT_TEST(testIdentityMatrix); CPPUNIT_TEST(testBlackAndWhite); - CPPUNIT_TEST(testAlpha); CPPUNIT_TEST_SUITE_END(); }; diff --git a/include/basegfx/color/bcolormodifier.hxx b/include/basegfx/color/bcolormodifier.hxx index 37c6a5b9e2f3..6eb40b67e9d7 100644 --- a/include/basegfx/color/bcolormodifier.hxx +++ b/include/basegfx/color/bcolormodifier.hxx @@ -126,26 +126,6 @@ namespace basegfx SAL_DLLPRIVATE virtual OUString getModifierName() const override; }; - /** - * convert to alpha - */ - class SAL_WARN_UNUSED BASEGFX_DLLPUBLIC BColorModifier_alpha final : public BColorModifier - { - public: - BColorModifier_alpha() - { - } - - virtual ~BColorModifier_alpha() override; - - // compare operator - SAL_DLLPRIVATE virtual bool operator==(const BColorModifier& rCompare) const override; - - // compute modified color - SAL_DLLPRIVATE virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const override; - SAL_DLLPRIVATE virtual OUString getModifierName() const override; - }; - /** convert to alpha based on luminance returns a color where red green and blue are first weighted and added 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 |