diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-22 13:06:36 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-22 14:55:37 +0200 |
commit | fdf3027a0eb8270d527b3e64c6157917a6718787 (patch) | |
tree | 52fcdf523db0ed223cc0e6a43a68a870ba6c95de /svgio/source | |
parent | 07137ccd7fbbf3afb1cabfc6ca71375293910a3a (diff) |
tdf#159660: Add support for multiply mode in feBlend
Change-Id: I03230e122a10dd6ada6af357c674c278b6b99d9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166427
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgfeblendnode.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/svgio/source/svgreader/svgfeblendnode.cxx b/svgio/source/svgreader/svgfeblendnode.cxx index eace3a53f63e..c5d367d17429 100644 --- a/svgio/source/svgreader/svgfeblendnode.cxx +++ b/svgio/source/svgreader/svgfeblendnode.cxx @@ -24,6 +24,7 @@ #include <vcl/bitmapex.hxx> #include <drawinglayer/converters.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <vcl/BitmapMultiplyBlendFilter.hxx> #include <vcl/BitmapScreenBlendFilter.hxx> #include <vcl/BitmapTools.hxx> @@ -74,6 +75,10 @@ void SvgFeBlendNode::parseAttribute(SVGToken aSVGToken, const OUString& aContent { maMode = Mode::Screen; } + else if (o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"multiply")) + { + maMode = Mode::Multiply; + } } break; } @@ -105,7 +110,7 @@ void SvgFeBlendNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar rTarget.append(*pSource); } } - else if (maMode == Mode::Screen) + else { basegfx::B2DRange aRange, aRange2; const drawinglayer::geometry::ViewInformation2D aViewInformation2D; @@ -156,8 +161,17 @@ void SvgFeBlendNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar aBaseRange.getWidth() * aBaseRange.getHeight()); } - BitmapScreenBlendFilter aScreenBlendFilter(aBmpEx, aBmpEx2); - BitmapEx aResBmpEx = aScreenBlendFilter.execute(); + BitmapEx aResBmpEx; + if (maMode == Mode::Screen) + { + BitmapScreenBlendFilter aScreenBlendFilter(aBmpEx, aBmpEx2); + aResBmpEx = aScreenBlendFilter.execute(); + } + else if (maMode == Mode::Multiply) + { + BitmapMultiplyBlendFilter aMultiplyBlendFilter(aBmpEx, aBmpEx2); + aResBmpEx = aMultiplyBlendFilter.execute(); + } const drawinglayer::primitive2d::Primitive2DReference xRef( new drawinglayer::primitive2d::BitmapPrimitive2D( |