summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-21 20:41:55 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 11:53:41 +0200
commit4b6e0f2c88debaedb514c868e061c21e15215b6e (patch)
treea1744bdcdeb1bc90437df56c99a9bfcb5a84e219 /drawinglayer/source/processor2d
parent196c22e88138796fb1204610bd5d4ad8b8cd8a85 (diff)
tdf#160726, tdf#48062: Simplify how BitmapExs are created
In my initial approach, I tranformed the primitive2DContainers before converting them to BitmapEx. This caused circles like https://bugs.documentfoundation.org/attachment.cgi?id=193790 not to be displayed. Simplify how BitmapExs are created by just using the range both primitive2DContainers have in common. This way, DrawBitmapInRect can be dropped now Change-Id: I2401dc87b98e04b9cf9f5ebade2b5622d884fc3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166391 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'drawinglayer/source/processor2d')
-rw-r--r--drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx5
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx8
2 files changed, 8 insertions, 5 deletions
diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 6bfc95878332..5347378cc43f 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -1060,8 +1060,9 @@ sal::systools::COMReference<ID2D1Bitmap> D2DPixelProcessor2D::implCreateAlpha_B2
// use new mode to create AlphaChannel (not just AlphaMask) for transparency channel
const AlphaMask aAlpha(::drawinglayer::createAlphaMask(
- std::move(xEmbedSeq), aEmptyViewInformation2D, nDiscreteClippedWidth,
- nDiscreteClippedHeight, nMaximumQuadraticPixels, true));
+ std::move(xEmbedSeq), aEmptyViewInformation2D,
+ basegfx::B2DRange(0, 0, nDiscreteClippedWidth, nDiscreteClippedHeight),
+ nMaximumQuadraticPixels, true));
sal::systools::COMReference<ID2D1Bitmap> pRetval;
if (aAlpha.IsEmpty())
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d93d98fef51a..e3c7703aeaa3 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2524,9 +2524,11 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// limitation to paint the content
const auto aViewInformation2D(geometry::createViewInformation2D({}));
const sal_uInt32 nMaximumQuadraticPixels(500000);
- const BitmapEx aBitmapEx(convertToBitmapEx(
- std::move(xEmbedSeq), aViewInformation2D, basegfx::fround(aDiscreteRange.getWidth()),
- basegfx::fround(aDiscreteRange.getHeight()), nMaximumQuadraticPixels));
+ const BitmapEx aBitmapEx(
+ convertToBitmapEx(std::move(xEmbedSeq), aViewInformation2D,
+ basegfx::B2DRange(0, 0, basegfx::fround(aDiscreteRange.getWidth()),
+ basegfx::fround(aDiscreteRange.getHeight())),
+ nMaximumQuadraticPixels));
// add to target metafile (will create MetaFloatTransparentAction)
mpOutputDevice->DrawBitmapEx(Point(basegfx::fround<tools::Long>(aLogicRange.getMinX()),