summaryrefslogtreecommitdiff
path: root/svgio/source
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 13:32:15 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 14:55:44 +0200
commita9f1b705275ef9abbcf17366d8f3713235dd4675 (patch)
tree5b4d7eb18b1937bcc4c418270212be5778a3d0dc /svgio/source
parentfdf3027a0eb8270d527b3e64c6157917a6718787 (diff)
tdf#159660: Add support for darken mode in feBlend
Change-Id: I56862163b7bf1177120081c95ab7851a5fc4019b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166428 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/source')
-rw-r--r--svgio/source/svgreader/svgfeblendnode.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/svgio/source/svgreader/svgfeblendnode.cxx b/svgio/source/svgreader/svgfeblendnode.cxx
index c5d367d17429..ad545dc8856f 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/BitmapDarkenBlendFilter.hxx>
#include <vcl/BitmapMultiplyBlendFilter.hxx>
#include <vcl/BitmapScreenBlendFilter.hxx>
#include <vcl/BitmapTools.hxx>
@@ -79,6 +80,10 @@ void SvgFeBlendNode::parseAttribute(SVGToken aSVGToken, const OUString& aContent
{
maMode = Mode::Multiply;
}
+ else if (o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"darken"))
+ {
+ maMode = Mode::Darken;
+ }
}
break;
}
@@ -172,6 +177,11 @@ void SvgFeBlendNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar
BitmapMultiplyBlendFilter aMultiplyBlendFilter(aBmpEx, aBmpEx2);
aResBmpEx = aMultiplyBlendFilter.execute();
}
+ else if (maMode == Mode::Darken)
+ {
+ BitmapDarkenBlendFilter aDarkenBlendFilter(aBmpEx, aBmpEx2);
+ aResBmpEx = aDarkenBlendFilter.execute();
+ }
const drawinglayer::primitive2d::Primitive2DReference xRef(
new drawinglayer::primitive2d::BitmapPrimitive2D(