summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-09-13 18:52:29 -0400
committerPatrick Luby <plubius@neooffice.org>2023-09-14 01:52:22 +0200
commit4942aa1533af25cf102da7516bd5e521c553aa07 (patch)
tree7ba46d03270f258ae8ea16277cb16d3a280719a7 /drawinglayer
parentd23ba9e6103bba27b57c59505641cc64db63ec98 (diff)
tdf#156808 force an alpha mask to be created even if it has no alpha
We need an alpha mask, even if it is totally opaque, so that drawinglayer::primitive2d::ProcessAndBlurAlphaMask() can be called. Otherwise, blurring of edges will fail in cases like running in a slideshow or exporting to PDF. Change-Id: If03b32a8a22ed960f1475710a9831cab33799b60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156903 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/softedgeprimitive2d.cxx7
-rw-r--r--drawinglayer/source/tools/converters.cxx4
2 files changed, 8 insertions, 3 deletions
diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
index 89e1fd545fcb..bfd8ebf71656 100644
--- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
@@ -166,9 +166,14 @@ void SoftEdgePrimitive2D::create2DDecomposition(
const sal_uInt32 nDiscreteClippedHeight(ceil(aDiscreteClippedSize.getY()));
const geometry::ViewInformation2D aViewInformation2D;
const sal_uInt32 nMaximumQuadraticPixels(250000);
+ // tdf#156808 force an alpha mask to be created even if it has no alpha
+ // We need an alpha mask, even if it is totally opaque, so that
+ // drawinglayer::primitive2d::ProcessAndBlurAlphaMask() can be called.
+ // Otherwise, blurring of edges will fail in cases like running in a
+ // slideshow or exporting to PDF.
const BitmapEx aBitmapEx(::drawinglayer::convertToBitmapEx(
std::move(xEmbedSeq), aViewInformation2D, nDiscreteClippedWidth, nDiscreteClippedHeight,
- nMaximumQuadraticPixels));
+ nMaximumQuadraticPixels, true));
if (aBitmapEx.IsEmpty())
break;
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index 80ae15a3b6a9..9283f7db779f 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -156,7 +156,7 @@ AlphaMask createAlphaMask(drawinglayer::primitive2d::Primitive2DContainer&& rSeq
BitmapEx convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&& rSeq,
const geometry::ViewInformation2D& rViewInformation2D,
sal_uInt32 nDiscreteWidth, sal_uInt32 nDiscreteHeight,
- sal_uInt32 nMaxSquarePixels)
+ sal_uInt32 nMaxSquarePixels, bool bForceAlphaMaskCreation)
{
drawinglayer::primitive2d::Primitive2DContainer aSequence(std::move(rSeq));
@@ -261,7 +261,7 @@ BitmapEx convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&& rSe
}
#endif
- if (aAlpha.hasAlpha())
+ if (bForceAlphaMaskCreation || aAlpha.hasAlpha())
{
// Need to correct content using known alpha to get to background-free
// RGBA result, usable e.g. in PNG export(s) or convert-to-bitmap.