From 18fd4437077f1e51ae54cfd1a160866cca015c2d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 14 Aug 2020 02:01:05 +0300 Subject: tdf#134968: don't forget to draw on mpAlphaVDev in fallback case Change-Id: I6ab8cc8907943c3bb7fd717624ea4ac7c9d4fd5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100711 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/outdev/polygon.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'vcl') diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index 77e0564ba16f..e031fb05990c 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -290,6 +290,8 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP if( mbInitFillColor ) InitFillColor(); + bool bSuccess(false); + if((mnAntialiasing & AntialiasingFlags::EnableB2dDraw) && mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && RasterOp::OverPaint == GetRasterOp() && @@ -297,7 +299,7 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly); - bool bSuccess(true); + bSuccess = true; // ensure closed - maybe assert, hinders buffering if(!aB2DPolyPolygon.isClosed()) @@ -335,20 +337,18 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP break; } } + } - if(bSuccess) - { - if (mpAlphaVDev) - mpAlphaVDev->ImplDrawPolyPolygonWithB2DPolyPolygon(rB2DPolyPoly); - - return; - } + if (!bSuccess) + { + // fallback to old polygon drawing if needed + const tools::PolyPolygon aToolsPolyPolygon(rB2DPolyPoly); + const tools::PolyPolygon aPixelPolyPolygon = ImplLogicToDevicePixel(aToolsPolyPolygon); + ImplDrawPolyPolygon(aPixelPolyPolygon.Count(), aPixelPolyPolygon); } - // fallback to old polygon drawing if needed - const tools::PolyPolygon aToolsPolyPolygon( rB2DPolyPoly ); - const tools::PolyPolygon aPixelPolyPolygon = ImplLogicToDevicePixel( aToolsPolyPolygon ); - ImplDrawPolyPolygon( aPixelPolyPolygon.Count(), aPixelPolyPolygon ); + if (mpAlphaVDev) + mpAlphaVDev->ImplDrawPolyPolygonWithB2DPolyPolygon(rB2DPolyPoly); } // #100127# Extracted from OutputDevice::DrawPolyPolygon() -- cgit