drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 21 +++++++++------- vcl/source/outdev/outdev.cxx | 12 +++++++-- 2 files changed, 23 insertions(+), 10 deletions(-)
New commits: commit 541e5a9e84c42fbf20158b01a4feaa0f226e9ed0 Author: Mike Kaganski <[email protected]> AuthorDate: Thu May 14 14:42:24 2020 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Fri May 29 06:23:26 2020 +0200 tdf#49247, tdf#101181: Fix effect bounds This will avoid cutting rightmost and bottommost pixels from the effects, caused by casting of range dimensions to integers. Change-Id: Icad9c06c33bafae9531bc45559acecd3581fad89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95020 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 131e51f34913..32afe33e6147 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -993,8 +993,11 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv // glow primitive. mpOutputDevice->Erase(); process(rCandidate); - Bitmap bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), aRange.getMinY()), - Size(aRange.getWidth(), aRange.getHeight())); + const tools::Rectangle aRect(static_cast<long>(std::floor(aRange.getMinX())), + static_cast<long>(std::floor(aRange.getMinY())), + static_cast<long>(std::ceil(aRange.getMaxX())), + static_cast<long>(std::ceil(aRange.getMaxY()))); + Bitmap bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), aRect.GetSize()); AlphaMask mask = ProcessAndBlurAlphaMask(bitmap, fBlurRadius, fBlurRadius, nTransparency); @@ -1007,7 +1010,7 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv // back to old OutDev mpOutputDevice = pLastOutputDevice; - mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), result); + mpOutputDevice->DrawBitmapEx(aRect.TopLeft(), result); } else SAL_WARN("drawinglayer", "Temporary buffered virtual device is not visible"); @@ -1036,8 +1039,11 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D( rCandidate.setMaskGeneration(); process(rCandidate); rCandidate.setMaskGeneration(false); - Bitmap bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), aRange.getMinY()), - Size(aRange.getWidth(), aRange.getHeight())); + const tools::Rectangle aRect(static_cast<long>(std::floor(aRange.getMinX())), + static_cast<long>(std::floor(aRange.getMinY())), + static_cast<long>(std::ceil(aRange.getMaxX())), + static_cast<long>(std::ceil(aRange.getMaxY()))); + Bitmap bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), aRect.GetSize()); AlphaMask mask = ProcessAndBlurAlphaMask(bitmap, -fBlurRadius, fBlurRadius, 0); @@ -1045,15 +1051,14 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D( mpOutputDevice->Erase(); process(rCandidate); - bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), aRange.getMinY()), - Size(aRange.getWidth(), aRange.getHeight())); + bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), aRect.GetSize()); // alpha mask will be scaled up automatically to match bitmap BitmapEx result(bitmap, mask); // back to old OutDev mpOutputDevice = pLastOutputDevice; - mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX(), aRange.getMinY()), result); + mpOutputDevice->DrawBitmapEx(aRect.TopLeft(), result); } else SAL_WARN("drawinglayer", "Temporary buffered virtual device is not visible"); commit 946b01e2d4a41b06415f6371b7b52dca090e7b86 Author: Mike Kaganski <[email protected]> AuthorDate: Thu May 14 14:42:24 2020 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Fri May 29 06:23:16 2020 +0200 Consider mpAlphaVDev when processing metafile in OutputDevice::DrawOutDev Change-Id: Ia9709bba6eb2a64781297ca260341693b0e39107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95019 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 18f273b8185a..020a57a6a40c 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -415,8 +415,16 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize, if ( mpMetaFile ) { - const Bitmap aBmp( rOutDev.GetBitmap( rSrcPt, rSrcSize ) ); - mpMetaFile->AddAction( new MetaBmpScaleAction( rDestPt, rDestSize, aBmp ) ); + if (rOutDev.mpAlphaVDev) + { + const BitmapEx aBmpEx(rOutDev.GetBitmapEx(rSrcPt, rSrcSize)); + mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmpEx)); + } + else + { + const Bitmap aBmp(rOutDev.GetBitmap(rSrcPt, rSrcSize)); + mpMetaFile->AddAction(new MetaBmpScaleAction(rDestPt, rDestSize, aBmp)); + } } if ( !IsDeviceOutputNecessary() ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
