diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-29 11:15:56 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-29 11:25:57 +0200 |
commit | 7f8f7e7284e29cc0e8a0f282761abea428d0eb33 (patch) | |
tree | 74c7e3ce894f39bb6d205070dba00ade85c30b12 /drawinglayer | |
parent | 4f6b3e3089f070e7bf4b061c549ab3c6614dd542 (diff) |
tdf#101181: disable antialiasing for mask
Since we need objects' bounds here, antialiasing them would make the
resulting non-fully-transparent areas thicker, thus making the effect
also thicker. Disable it here; also slightly increases performance.
We can't do that for soft edge: the effect draws all its children as
bitmap, so disabling AA would make all children areas unaffected by
soft edge to have worse image quality.
Change-Id: Ifc9a60ec7894bfe9d0209e04532c9ca0a1eb3867
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95096
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index d4ee5f39b7a0..8d217dcf18db 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -989,6 +989,9 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv // remember last OutDev and set to content OutputDevice* pLastOutputDevice = mpOutputDevice; mpOutputDevice = &aBufferDevice.getContent(); + // We don't need antialiased mask here, which would only make effect thicker + const auto aPrevAA = mpOutputDevice->GetAntialiasing(); + mpOutputDevice->SetAntialiasing(AntialiasingFlags::NONE); mpOutputDevice->Erase(); process(rCandidate); const tools::Rectangle aRect(static_cast<long>(std::floor(aRange.getMinX())), @@ -996,6 +999,7 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv static_cast<long>(std::ceil(aRange.getMaxX())), static_cast<long>(std::ceil(aRange.getMaxY()))); BitmapEx bmpEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), aRect.GetSize()); + mpOutputDevice->SetAntialiasing(aPrevAA); AlphaMask mask = ProcessAndBlurAlphaMask(bmpEx.GetAlpha(), fBlurRadius, fBlurRadius, nTransparency); @@ -1033,6 +1037,8 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D( OutputDevice* pLastOutputDevice = mpOutputDevice; mpOutputDevice = &aBufferDevice.getContent(); mpOutputDevice->Erase(); + // Since the effect converts all children to bitmap, we can't disable antialiasing here, + // because it would result in poor quality in areas not affected by the effect process(rCandidate); const tools::Rectangle aRect(static_cast<long>(std::floor(aRange.getMinX())), |