vcl/headless/CairoCommon.cxx | 10 ++---- vcl/headless/SvpGraphicsBackend.cxx | 5 +-- vcl/inc/headless/CairoCommon.hxx | 2 - vcl/inc/headless/SvpGraphicsBackend.hxx | 2 - vcl/inc/qt5/QtGraphics.hxx | 2 - vcl/inc/quartz/salgdi.h | 2 - vcl/inc/salgdi.hxx | 8 ++--- vcl/inc/salgdiimpl.hxx | 2 - vcl/inc/skia/gdiimpl.hxx | 2 - vcl/inc/win/salgdi.h | 2 - vcl/qt5/QtGraphics_GDI.cxx | 9 ++--- vcl/quartz/AquaGraphicsBackend.cxx | 12 +++---- vcl/skia/gdiimpl.cxx | 7 +--- vcl/source/gdi/salgdilayout.cxx | 7 ++-- vcl/source/outdev/line.cxx | 3 + vcl/source/outdev/polygon.cxx | 22 +++++++------- vcl/source/outdev/transparent.cxx | 37 +++++++++++------------- vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx | 5 +-- vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx | 2 - vcl/win/gdi/gdiimpl.cxx | 6 +-- vcl/win/gdi/gdiimpl.hxx | 2 - vcl/win/gdi/salgdi_gdiplus.cxx | 4 +- 22 files changed, 71 insertions(+), 82 deletions(-)
New commits: commit 74963f654768d6f25ac1ea907736731d9a886853 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jul 30 22:03:39 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Jul 31 09:58:28 2023 +0200 all drawPolyPolygon variants return true now since: commit 4998de76ed1da4039e30718941d50d6f1dfe4f82 Date: Sun Jul 30 07:40:48 2023 +0000 tdf#156230: Drop freshly unused GenPspGfxBackend Change-Id: I7fc2a068f807777ed392c5d58772d130bf7f51c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155076 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index 417fd633f87e..d1a20ec1624b 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -872,7 +872,7 @@ void CairoCommon::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPointCoun drawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPoly, 0.0, bAntiAlias); } -bool CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency, bool bAntiAlias) { @@ -882,14 +882,14 @@ bool CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, if (0 == rPolyPolygon.count() || !(bHasFill || bHasLine) || fTransparency < 0.0 || fTransparency >= 1.0) { - return true; + return; } // don't bother trying to draw stuff which is effectively invisible basegfx::B2DRange aPolygonRange = rPolyPolygon.getB2DRange(); aPolygonRange.transform(rObjectToDevice); if (aPolygonRange.getWidth() < 0.1 || aPolygonRange.getHeight() < 0.1) - return true; + return; cairo_t* cr = getCairoContext(true, bAntiAlias); if (cairo_status(cr) != CAIRO_STATUS_SUCCESS) @@ -897,7 +897,7 @@ bool CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, SAL_WARN("vcl.gdi", "cannot render to surface: " << cairo_status_to_string(cairo_status(cr))); releaseCairoContext(cr, true, basegfx::B2DRange()); - return true; + return; } clipRegion(cr); @@ -949,8 +949,6 @@ bool CairoCommon::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, // of damage so they can be correctly redrawn extents.transform(rObjectToDevice); releaseCairoContext(cr, true, extents); - - return true; } void CairoCommon::drawPolyLine(sal_uInt32 nPoints, const Point* pPtAry, bool bAntiAlias) diff --git a/vcl/headless/SvpGraphicsBackend.cxx b/vcl/headless/SvpGraphicsBackend.cxx index dafbe75ff3ca..e8d582b98fcc 100644 --- a/vcl/headless/SvpGraphicsBackend.cxx +++ b/vcl/headless/SvpGraphicsBackend.cxx @@ -109,12 +109,11 @@ void SvpGraphicsBackend::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPo m_rCairoCommon.drawPolyPolygon(nPoly, pPointCounts, pPtAry, getAntiAlias()); } -bool SvpGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void SvpGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { - return m_rCairoCommon.drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency, - getAntiAlias()); + m_rCairoCommon.drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency, getAntiAlias()); } bool SvpGraphicsBackend::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx index 8402e38b1d59..ffe0affb137e 100644 --- a/vcl/inc/headless/CairoCommon.hxx +++ b/vcl/inc/headless/CairoCommon.hxx @@ -180,7 +180,7 @@ struct VCL_DLLPUBLIC CairoCommon void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry, bool bAntiAlias); - bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency, bool bAntiAlias); void drawPolyLine(sal_uInt32 nPoints, const Point* pPtAry, bool bAntiAlias); diff --git a/vcl/inc/headless/SvpGraphicsBackend.hxx b/vcl/inc/headless/SvpGraphicsBackend.hxx index 5e0e196b503e..6a68899c8a27 100644 --- a/vcl/inc/headless/SvpGraphicsBackend.hxx +++ b/vcl/inc/headless/SvpGraphicsBackend.hxx @@ -65,7 +65,7 @@ public: void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPointArray) override; - bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolygon&, diff --git a/vcl/inc/qt5/QtGraphics.hxx b/vcl/inc/qt5/QtGraphics.hxx index 0bc7e20dee69..fce2b0d9b56d 100644 --- a/vcl/inc/qt5/QtGraphics.hxx +++ b/vcl/inc/qt5/QtGraphics.hxx @@ -94,7 +94,7 @@ public: void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPointArray) override; - bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolygon&, diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 026f5e066382..24b657e10886 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -374,7 +374,7 @@ public: void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPointArray) override; - bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolygon&, diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index debdd34bb00f..b4536cc3ee3c 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -203,7 +203,7 @@ public: const Point** pPtAry, const OutputDevice& rOutDev ); - bool DrawPolyPolygon( + void DrawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon &i_rPolyPolygon, double i_fTransparency, @@ -442,7 +442,7 @@ protected: virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) = 0; - virtual bool drawPolyPolygon( + virtual void drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) = 0; @@ -736,12 +736,12 @@ public: GetImpl()->drawPolyPolygon (nPoly, pPoints, pPtAry); } - bool drawPolyPolygon( + void drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) override { - return GetImpl()->drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency); + GetImpl()->drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency); } bool drawPolyLine( diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx index 314156da0d0b..fd3a13378b53 100644 --- a/vcl/inc/salgdiimpl.hxx +++ b/vcl/inc/salgdiimpl.hxx @@ -115,7 +115,7 @@ public: virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) = 0; - virtual bool drawPolyPolygon( + virtual void drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) = 0; diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index c8986831ab13..b879872a8bca 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -101,7 +101,7 @@ public: virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry) override; - virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + virtual void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; virtual bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index b58ae4b05866..80fafdeba56f 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -230,7 +230,7 @@ protected: virtual void drawPolyLine( sal_uInt32 nPoints, const Point* pPtAry ) override; virtual void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) override; virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) override; - virtual bool drawPolyPolygon( + virtual void drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx index 5ce68cfa9d0f..a8ec20f60080 100644 --- a/vcl/qt5/QtGraphics_GDI.cxx +++ b/vcl/qt5/QtGraphics_GDI.cxx @@ -282,15 +282,15 @@ void QtGraphicsBackend::drawPolyPolygon(sal_uInt32 nPolyCount, const sal_uInt32* aPainter.update(aPath.boundingRect()); } -bool QtGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void QtGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { // ignore invisible polygons if (!m_oFillColor && !m_oLineColor) - return true; + return; if ((fTransparency >= 1.0) || (fTransparency < 0)) - return true; + return; // Fallback: Transform to DeviceCoordinates basegfx::B2DPolyPolygon aPolyPolygon(rPolyPolygon); @@ -299,12 +299,11 @@ bool QtGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDe QPainterPath aPath; // ignore empty polygons if (!AddPolyPolygonToPath(aPath, aPolyPolygon, !getAntiAlias(), m_oLineColor.has_value())) - return true; + return; QtPainter aPainter(*this, true, 255 * (1.0 - fTransparency)); aPainter.drawPath(aPath); aPainter.update(aPath.boundingRect()); - return true; } bool QtGraphicsBackend::drawPolyLineBezier(sal_uInt32 /*nPoints*/, const Point* /*pPtAry*/, diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index cf1851662c2e..729f47f66dc0 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -664,22 +664,22 @@ void AquaGraphicsBackend::drawPolyPolygon(sal_uInt32 nPolyCount, const sal_uInt3 mrShared.refreshRect(leftX, topY, maxWidth, maxHeight); } -bool AquaGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void AquaGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { #ifdef IOS if (!mrShared.maContextHolder.isSet()) - return true; + return; #endif // short circuit if there is nothing to do if (rPolyPolygon.count() == 0) - return true; + return; // ignore invisible polygons if ((fTransparency >= 1.0) || (fTransparency < 0)) - return true; + return; // Fallback: Transform to DeviceCoordinates basegfx::B2DPolyPolygon aPolyPolygon(rPolyPolygon); @@ -716,7 +716,7 @@ bool AquaGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectTo { SAL_WARN("vcl.quartz", "Neither pen nor brush visible"); CGPathRelease(xPath); - return true; + return; } // use the path to prepare the graphics context @@ -735,8 +735,6 @@ bool AquaGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectTo } CGPathRelease(xPath); - - return true; } bool AquaGraphicsBackend::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 503892287ed4..3f42546b930d 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -838,7 +838,7 @@ void SkiaSalGraphicsImpl::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pP drawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPolygon, 0.0); } -bool SkiaSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void SkiaSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { @@ -847,7 +847,7 @@ bool SkiaSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectTo if (rPolyPolygon.count() == 0 || !(bHasFill || bHasLine) || fTransparency < 0.0 || fTransparency >= 1.0) - return true; + return; basegfx::B2DPolyPolygon aPolyPolygon(rPolyPolygon); aPolyPolygon.transform(rObjectToDevice); @@ -859,11 +859,10 @@ bool SkiaSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectTo if (delayDrawPolyPolygon(aPolyPolygon, fTransparency)) { scheduleFlush(); - return true; + return; } performDrawPolyPolygon(aPolyPolygon, fTransparency, mParent.getAntiAlias()); - return true; } void SkiaSalGraphicsImpl::performDrawPolyPolygon(const basegfx::B2DPolyPolygon& aPolyPolygon, diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 5f7baf18d71d..0a5eb5140a39 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -475,7 +475,7 @@ namespace } } -bool SalGraphics::DrawPolyPolygon( +void SalGraphics::DrawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& i_rPolyPolygon, double i_fTransparency, @@ -487,14 +487,15 @@ bool SalGraphics::DrawPolyPolygon( const basegfx::B2DHomMatrix& rMirror(getMirror(i_rOutDev)); if(!rMirror.isIdentity()) { - return drawPolyPolygon( + drawPolyPolygon( rMirror * rObjectToDevice, i_rPolyPolygon, i_fTransparency); + return; } } - return drawPolyPolygon( + drawPolyPolygon( rObjectToDevice, i_rPolyPolygon, i_fTransparency); diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index 041c6c16c345..6bf59455da73 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -340,11 +340,12 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin if (bTryB2d && !bDone) { - bDone = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( basegfx::B2DHomMatrix(), aFillPolyPolygon, 0.0, *this); + bDone = true; } if(!bDone) diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index fb876e425975..e764e6b66dbe 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -65,7 +65,6 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly ) { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPoly.getB2DPolyPolygon()); - bool bSuccess(true); // ensure closed - may be asserted, will prevent buffering if(!aB2DPolyPolygon.isClosed()) @@ -73,16 +72,17 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly ) aB2DPolyPolygon.setClosed(true); } - if(IsFillColor()) + if (IsFillColor()) { - bSuccess = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( aTransform, aB2DPolyPolygon, 0.0, *this); } - if(bSuccess && IsLineColor()) + bool bSuccess(true); + if (IsLineColor()) { const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); @@ -183,7 +183,6 @@ void OutputDevice::DrawPolygon( const tools::Polygon& rPoly ) { const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); basegfx::B2DPolygon aB2DPolygon(rPoly.getB2DPolygon()); - bool bSuccess(true); // ensure closed - maybe assert, hinders buffering if(!aB2DPolygon.isClosed()) @@ -191,16 +190,17 @@ void OutputDevice::DrawPolygon( const tools::Polygon& rPoly ) aB2DPolygon.setClosed(true); } - if(IsFillColor()) + if (IsFillColor()) { - bSuccess = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( aTransform, basegfx::B2DPolyPolygon(aB2DPolygon), 0.0, *this); } - if(bSuccess && IsLineColor()) + bool bSuccess(true); + if (IsLineColor()) { const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); @@ -299,16 +299,16 @@ void OutputDevice::ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyP aB2DPolyPolygon.setClosed(true); } - if(IsFillColor()) + if (IsFillColor()) { - bSuccess = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( aTransform, aB2DPolyPolygon, 0.0, *this); } - if(bSuccess && IsLineColor()) + if (IsLineColor()) { const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index b114d735e7bf..df64db2c9b85 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -131,18 +131,17 @@ void OutputDevice::DrawTransparent( // TODO: this must not drop transparency for mpAlphaVDev case, but instead use premultiplied // alpha... but that requires using premultiplied alpha also for already drawn data const double fAdjustedTransparency = mpAlphaVDev ? 0 : fTransparency; - bool bDrawnOk(true); - if( IsFillColor() ) + if (IsFillColor()) { - bDrawnOk = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( aFullTransform, aB2DPolyPolygon, fAdjustedTransparency, *this); } - if( bDrawnOk && IsLineColor() ) + if (IsLineColor()) { const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); @@ -162,24 +161,21 @@ void OutputDevice::DrawTransparent( } } - if( bDrawnOk ) + if( mpMetaFile ) { - if( mpMetaFile ) - { - // tdf#119843 need transformed Polygon here - basegfx::B2DPolyPolygon aB2DPolyPoly(rB2DPolyPoly); - aB2DPolyPoly.transform(rObjectTransform); - mpMetaFile->AddAction( - new MetaTransparentAction( - tools::PolyPolygon(aB2DPolyPoly), - static_cast< sal_uInt16 >(fTransparency * 100.0))); - } + // tdf#119843 need transformed Polygon here + basegfx::B2DPolyPolygon aB2DPolyPoly(rB2DPolyPoly); + aB2DPolyPoly.transform(rObjectTransform); + mpMetaFile->AddAction( + new MetaTransparentAction( + tools::PolyPolygon(aB2DPolyPoly), + static_cast< sal_uInt16 >(fTransparency * 100.0))); + } - if (mpAlphaVDev) - mpAlphaVDev->DrawTransparent(rObjectTransform, rB2DPolyPoly, fTransparency); + if (mpAlphaVDev) + mpAlphaVDev->DrawTransparent(rObjectTransform, rB2DPolyPoly, fTransparency); - return; - } + return; } // fallback to old polygon drawing if needed @@ -237,11 +233,12 @@ bool OutputDevice::DrawTransparentNatively ( const tools::PolyPolygon& rPolyPoly // functionality and we use the fallback some lines below (which is not very good, // though. For now, WinSalGraphics::drawPolyPolygon will detect printer usage and // correct the wrong mapping (see there for details) - bDrawn = mpGraphics->DrawPolyPolygon( + mpGraphics->DrawPolyPolygon( aTransform, aB2DPolyPolygon, fTransparency, *this); + bDrawn = true; } if( mbLineColor ) diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx index d5a88631c192..5a751f9ea528 100644 --- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx +++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx @@ -53,12 +53,11 @@ void X11CairoSalGraphicsImpl::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 mrCairoCommon.drawPolyPolygon(nPoly, pPointCounts, pPtAry, getAntiAlias()); } -bool X11CairoSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, +void X11CairoSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { - return mrCairoCommon.drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency, - getAntiAlias()); + mrCairoCommon.drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency, getAntiAlias()); } void X11CairoSalGraphicsImpl::drawPixel(tools::Long nX, tools::Long nY) diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx index d9944cc9714a..23547daa05d5 100644 --- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx +++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx @@ -88,7 +88,7 @@ public: void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry) override; - bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, + void drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) override; diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 785c2f09168b..5cb6a05bda48 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -2030,7 +2030,7 @@ sal_Int64 SystemDependentData_GraphicsPath::estimateUsageInBytes() const return nRetval; } -bool WinSalGraphicsImpl::drawPolyPolygon( +void WinSalGraphicsImpl::drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) @@ -2039,7 +2039,7 @@ bool WinSalGraphicsImpl::drawPolyPolygon( if(!mbBrush || 0 == nCount || fTransparency < 0.0 || fTransparency > 1.0) { - return true; + return; } Gdiplus::Graphics aGraphics(mrParent.getHDC()); @@ -2182,8 +2182,6 @@ bool WinSalGraphicsImpl::drawPolyPolygon( aGraphics.FillPath( &aSolidBrush, &(*pGraphicsPath)); - - return true; } bool WinSalGraphicsImpl::drawPolyLine( diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx index 667268619ac2..9d4fa32233de 100644 --- a/vcl/win/gdi/gdiimpl.hxx +++ b/vcl/win/gdi/gdiimpl.hxx @@ -120,7 +120,7 @@ public: virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) override; - virtual bool drawPolyPolygon( + virtual void drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon&, double fTransparency) override; diff --git a/vcl/win/gdi/salgdi_gdiplus.cxx b/vcl/win/gdi/salgdi_gdiplus.cxx index 13452f5c7a6e..198f755b231d 100644 --- a/vcl/win/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/gdi/salgdi_gdiplus.cxx @@ -26,12 +26,12 @@ #include "gdiimpl.hxx" -bool WinSalGraphics::drawPolyPolygon( +void WinSalGraphics::drawPolyPolygon( const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency) { - return mpImpl->drawPolyPolygon( + mpImpl->drawPolyPolygon( rObjectToDevice, rPolyPolygon, fTransparency);