diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-30 11:50:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-30 20:39:09 +0100 |
commit | b134e07cb8848a3ea00324d64a82d93b433d23f3 (patch) | |
tree | 3125d6529946c7074589ef09965eff7186de70db /vcl | |
parent | cb664a9532b1318eed0594f06222164749f5babf (diff) |
identify the only callers that don't provide an OutputDevice for mirroring
Change-Id: I57ff433551457c609d3809bb2ad1f7e4b10cf364
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106857
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/FileDefinitionWidgetDraw.hxx | 17 | ||||
-rw-r--r-- | vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 87 |
2 files changed, 77 insertions, 27 deletions
diff --git a/vcl/inc/FileDefinitionWidgetDraw.hxx b/vcl/inc/FileDefinitionWidgetDraw.hxx index fc99471ba336..0ca50c304aad 100644 --- a/vcl/inc/FileDefinitionWidgetDraw.hxx +++ b/vcl/inc/FileDefinitionWidgetDraw.hxx @@ -52,6 +52,23 @@ public: tools::Rectangle& rNativeContentRegion) override; bool updateSettings(AllSettings& rSettings) override; + + static void drawPolyPolygon(SalGraphics& rGraphics, + const basegfx::B2DHomMatrix& rObjectToDevice, + const basegfx::B2DPolyPolygon& i_rPolyPolygon, + double i_fTransparency); + + static void drawPolyLine(SalGraphics& rGraphics, const basegfx::B2DHomMatrix& rObjectToDevice, + const basegfx::B2DPolygon& i_rPolygon, double i_fTransparency, + double i_fLineWidth, const std::vector<double>* i_pStroke, + basegfx::B2DLineJoin i_eLineJoin, css::drawing::LineCap i_eLineCap, + double i_fMiterMinimumAngle, bool bPixelSnapHairline); + + static void drawBitmap(SalGraphics& rGraphics, const SalTwoRect& rPosAry, + const SalBitmap& rSalBitmap); + + static void drawBitmap(SalGraphics& rGraphics, const SalTwoRect& rPosAry, + const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap); }; } // end vcl namespace diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index 6f10ec80fc92..e82980d83ea8 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -206,6 +206,38 @@ bool FileDefinitionWidgetDraw::hitTestNativeControl( return false; } +void FileDefinitionWidgetDraw::drawPolyPolygon(SalGraphics& rGraphics, + const basegfx::B2DHomMatrix& rObjectToDevice, + const basegfx::B2DPolyPolygon& i_rPolyPolygon, + double i_fTransparency) +{ + rGraphics.DrawPolyPolygon(rObjectToDevice, i_rPolyPolygon, i_fTransparency, nullptr); +} + +void FileDefinitionWidgetDraw::drawPolyLine( + SalGraphics& rGraphics, const basegfx::B2DHomMatrix& rObjectToDevice, + const basegfx::B2DPolygon& i_rPolygon, double i_fTransparency, double i_fLineWidth, + const std::vector<double>* i_pStroke, basegfx::B2DLineJoin i_eLineJoin, + css::drawing::LineCap i_eLineCap, double i_fMiterMinimumAngle, bool bPixelSnapHairline) +{ + rGraphics.DrawPolyLine(rObjectToDevice, i_rPolygon, i_fTransparency, i_fLineWidth, i_pStroke, + i_eLineJoin, i_eLineCap, i_fMiterMinimumAngle, bPixelSnapHairline, + nullptr); +} + +void FileDefinitionWidgetDraw::drawBitmap(SalGraphics& rGraphics, const SalTwoRect& rPosAry, + const SalBitmap& rSalBitmap) +{ + rGraphics.DrawBitmap(rPosAry, rSalBitmap, nullptr); +} + +void FileDefinitionWidgetDraw::drawBitmap(SalGraphics& rGraphics, const SalTwoRect& rPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap) +{ + rGraphics.DrawBitmap(rPosAry, rSalBitmap, rTransparentBitmap, nullptr); +} + namespace { void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics, tools::Long nX, @@ -243,9 +275,9 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics { rGraphics.SetLineColor(); rGraphics.SetFillColor(Color(*rRectangle.mpFillColor)); - rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(), - basegfx::B2DPolyPolygon(aB2DPolygon), - 1.0 - rRectangle.mnOpacity, nullptr); + FileDefinitionWidgetDraw::drawPolyPolygon(rGraphics, basegfx::B2DHomMatrix(), + basegfx::B2DPolyPolygon(aB2DPolygon), + 1.0 - rRectangle.mnOpacity); } else if (rRectangle.mpFillGradient) { @@ -295,11 +327,11 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics { rGraphics.SetLineColor(Color(*rRectangle.mpStrokeColor)); rGraphics.SetFillColor(); - rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), aB2DPolygon, - 1.0 - rRectangle.mnOpacity, rRectangle.mnStrokeWidth, - nullptr, // MM01 - basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, - 0.0f, false, nullptr); + FileDefinitionWidgetDraw::drawPolyLine( + rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 1.0 - rRectangle.mnOpacity, + rRectangle.mnStrokeWidth, + nullptr, // MM01 + basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false); } } break; @@ -333,8 +365,8 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics { rGraphics.SetLineColor(); rGraphics.SetFillColor(Color(*rPath.mpFillColor)); - rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPolygon, - 1.0 - rPath.mnOpacity, nullptr); + FileDefinitionWidgetDraw::drawPolyPolygon(rGraphics, basegfx::B2DHomMatrix(), + aPolyPolygon, 1.0 - rPath.mnOpacity); } if (rPath.mpStrokeColor) { @@ -342,11 +374,11 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics rGraphics.SetFillColor(); for (auto const& rPolygon : aPolyPolygon) { - rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), rPolygon, - 1.0 - rPath.mnOpacity, rPath.mnStrokeWidth, - nullptr, // MM01 - basegfx::B2DLineJoin::Round, - css::drawing::LineCap_ROUND, 0.0f, false, nullptr); + FileDefinitionWidgetDraw::drawPolyLine( + rGraphics, basegfx::B2DHomMatrix(), rPolygon, 1.0 - rPath.mnOpacity, + rPath.mnStrokeWidth, + nullptr, // MM01 + basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false); } } } @@ -381,14 +413,14 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr rGraphics.SetLineColor(); rGraphics.SetFillColor(rWidgetDraw.maFillColor); - rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(), - basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f, nullptr); + FileDefinitionWidgetDraw::drawPolyPolygon( + rGraphics, basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f); rGraphics.SetLineColor(rWidgetDraw.maStrokeColor); rGraphics.SetFillColor(); - rGraphics.DrawPolyLine( - basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth, - nullptr, // MM01 - basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr); + FileDefinitionWidgetDraw::drawPolyLine( + rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, + rWidgetDraw.mnStrokeWidth, nullptr, // MM01 + basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false); } break; case WidgetDrawActionType::LINE: @@ -408,10 +440,10 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY2) }, }; - rGraphics.DrawPolyLine( - basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth, - nullptr, // MM01 - basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr); + FileDefinitionWidgetDraw::drawPolyLine( + rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, + rWidgetDraw.mnStrokeWidth, nullptr, // MM01 + basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false); } break; case WidgetDrawActionType::IMAGE: @@ -453,11 +485,12 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr { const std::shared_ptr<SalBitmap> pSalBitmapAlpha = aBitmap.GetAlpha().ImplGetSalBitmap(); - rGraphics.DrawBitmap(aTR, *pSalBitmap, *pSalBitmapAlpha, nullptr); + FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap, + *pSalBitmapAlpha); } else { - rGraphics.DrawBitmap(aTR, *pSalBitmap, nullptr); + FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap); } } } |