include/vcl/outdev.hxx | 2 +- include/vcl/print.hxx | 2 +- vcl/source/gdi/print.cxx | 2 +- vcl/source/outdev/bitmap.cxx | 22 ++++++++++++++++++++++ vcl/source/outdev/bitmapex.cxx | 28 +++------------------------- 5 files changed, 28 insertions(+), 28 deletions(-)
New commits: commit 14b75b7b0f735ee172d707d1f05603306110d621 Author: Christopher Sherlock <[email protected]> AuthorDate: Sat Nov 1 13:11:17 2025 +1100 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Wed Dec 17 13:31:08 2025 +0100 vcl: rename DrawTransformBitmapExDirect() to DrawTransformedBitmap() Move to bitmap.cxx Change-Id: I6c52a59080349c93e7f20e6375d4e0add102e562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193407 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 25fdc2353807..32444f9476c3 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1397,7 +1397,7 @@ protected: @return true if it was able to draw the bitmap, false if not */ - virtual bool DrawTransformBitmapExDirect( + virtual bool DrawTransformedBitmap( const basegfx::B2DHomMatrix& aFullTransform, const Bitmap& rBitmap, double fAlpha = 1.0); diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index a4c33da9e048..d9e4500534a7 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -162,7 +162,7 @@ protected: const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel) override; - bool DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform, + bool DrawTransformedBitmap(const basegfx::B2DHomMatrix& aFullTransform, const Bitmap& rBitmap, double fAlpha = 1.0) override; bool TransformAndReduceBitmapExToTargetRange( const basegfx::B2DHomMatrix& aFullTransform, diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 095518fda0e6..febbea1efa29 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -170,7 +170,7 @@ void Printer::ImplPrintTransparent( const Bitmap& rBmp, mbMap = bOldMap; } -bool Printer::DrawTransformBitmapExDirect( +bool Printer::DrawTransformedBitmap( const basegfx::B2DHomMatrix& /*aFullTransform*/, const Bitmap& /*rBitmap*/, double /*fAlpha*/) diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 52eb6c39b578..95f6802a2fe8 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -440,6 +440,28 @@ bool OutputDevice::HasFastDrawTransformedBitmap() const return mpGraphics->HasFastDrawTransformedBitmap(); } +bool OutputDevice::DrawTransformedBitmap( + const basegfx::B2DHomMatrix& aFullTransform, + const Bitmap& rBitmap, + double fAlpha) +{ + assert(!is_double_buffered_window()); + + // try to paint directly + const basegfx::B2DPoint aNull(aFullTransform * basegfx::B2DPoint(0.0, 0.0)); + const basegfx::B2DPoint aTopX(aFullTransform * basegfx::B2DPoint(1.0, 0.0)); + const basegfx::B2DPoint aTopY(aFullTransform * basegfx::B2DPoint(0.0, 1.0)); + SalBitmap* pSalSrcBmp = rBitmap.ImplGetSalBitmap().get(); + + return mpGraphics->DrawTransformedBitmap( + aNull, + aTopX, + aTopY, + *pSalSrcBmp, + fAlpha, + *this); +}; + void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, DrawImageFlags nStyle ) { assert(!is_double_buffered_window()); diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index 17e34a34541b..f112e9fa10fa 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -31,28 +31,6 @@ #include <drawmode.hxx> #include <salgdi.hxx> -bool OutputDevice::DrawTransformBitmapExDirect( - const basegfx::B2DHomMatrix& aFullTransform, - const Bitmap& rBitmap, - double fAlpha) -{ - assert(!is_double_buffered_window()); - - // try to paint directly - const basegfx::B2DPoint aNull(aFullTransform * basegfx::B2DPoint(0.0, 0.0)); - const basegfx::B2DPoint aTopX(aFullTransform * basegfx::B2DPoint(1.0, 0.0)); - const basegfx::B2DPoint aTopY(aFullTransform * basegfx::B2DPoint(0.0, 1.0)); - SalBitmap* pSalSrcBmp = rBitmap.ImplGetSalBitmap().get(); - - return mpGraphics->DrawTransformedBitmap( - aNull, - aTopX, - aTopY, - *pSalSrcBmp, - fAlpha, - *this); -}; - bool OutputDevice::TransformAndReduceBitmapExToTargetRange( const basegfx::B2DHomMatrix& aFullTransform, basegfx::B2DRange &aVisibleRange, @@ -223,7 +201,7 @@ void OutputDevice::DrawTransformedBitmapEx( { if(bTryDirectPaint) { - if(DrawTransformBitmapExDirect(aFullTransform, bitmap, fAlpha)) + if (DrawTransformedBitmap(aFullTransform, bitmap, fAlpha)) { // we are done return; @@ -239,7 +217,7 @@ void OutputDevice::DrawTransformedBitmapEx( // If the backend's implementation is known to not need any optimizations here, pass to it directly. // With most backends it's more performant to try to simplify to DrawBitmap() first. - if(bTryDirectPaint && mpGraphics->HasFastDrawTransformedBitmap() && DrawTransformBitmapExDirect(aFullTransform, bitmap)) + if(bTryDirectPaint && mpGraphics->HasFastDrawTransformedBitmap() && DrawTransformedBitmap(aFullTransform, bitmap)) return; // decompose matrix to check rotation and shear @@ -277,7 +255,7 @@ void OutputDevice::DrawTransformedBitmapEx( } // Try the backend's implementation before resorting to the slower fallback here. - if(bTryDirectPaint && DrawTransformBitmapExDirect(aFullTransform, bitmap)) + if (bTryDirectPaint && DrawTransformedBitmap(aFullTransform, bitmap)) return; // take the fallback when no rotate and shear, but mirror (else we would have done this above)
