summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-05-29 11:15:56 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-05-29 13:30:36 +0200
commit256c19a3b12a69e57b8e09375884a044315120ab (patch)
treed1fe290625844580bbfd5a4455835f911fe89b07 /drawinglayer
parent4166cf43d2a56b0c2e9a3bf4c15d906be025ada6 (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> (cherry picked from commit 61f70d361eed06055ad94218e2e8d0246762e6f7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95110
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
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())),