diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2021-12-07 14:29:49 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2021-12-07 18:51:47 +0100 |
commit | 7e5af164b7d293dd410710bed411e1ca64bbecf7 (patch) | |
tree | 64cd2b159a633678e6d1a5b0c0a964b5124ae9bc /vcl | |
parent | 8995bc21ee570c9a914df71817a132c3b3637059 (diff) |
Re-Enable DrawTransformBitmapExDirect for render backends
Unfortunately the add/usage of HasFastDrawTransformedBitmap did disable the
system-dependent implementations/fast-path for DrawTransformBitmapExDirect
and it's implemenations, except for Skia.
This means that the current backends for Windows/Mac/Cairo/headless/Qt5
have to do expensive pixel operations when a Bitmap is 'really' transformed
(rotate/shear) since some time.
The nine implementations using ::hasFastDrawTransformedBitmap (grep for it)
all return false, except the Skia one.
Since HasFastDrawTransformedBitmap() uses that and itself is used in the very
central mehod OutputDevice::DrawTransformedBitmapEx(...) to decide if that
fast-path shall/can be used at all, it was *no longer used* - except for
Skia - what makes Skia definitely performing better with transformed Bitmaps,
or the other way around - the others worse.
HasFastDrawTransformedBitmap() is used in only two places, the second is in the
canvas helper to decide if to try to use that fast-path for presentation
rendering.
A method at OutputDevice to see if that fast-path is implemented is therefore
currently needed, but for the canvas helper only. Since this will/should be
converted to primitive usage (hopefully) anyways, nine impementations calling
these virtual functions often and the danger to produce a mismatch/
error beween implementations of hasFastDrawTransformedBitmap and
drawTransformedBitmap (as happened here, but can also happen when someone
adds or removes an implementation) I looked for a way to solve that differenly
and more safe.
Since SalGraphics::DrawTransformedBitmap anyways returns a bool to signal it's
success I take this as base to implement a buffered test directly at
SalGraphics, also directly set a local flag to detect that functionality if
DrawTransformedBitmap is used anyways before the test is/would be needed.
Combined wih that small test to check only if this was not yet used and thus
tested by DrawTransformedBitmap anyways I can offer a reliable non-virtual
method at OutputDevice called ImplementsFastDrawTransformedBitmap() that will
be used at the single necessary location - in the canvas helper.
Since that small test direcly uses one of the nine implementations of
hasFastDrawTransformedBitmap it is fundamenally more reliable and probably
the copy bitmap/writeBack never really used (I tested that it works) due
to an earlier use of DrawTransformedBitmap did the check potentially already.
I also took a look at the cairo version (since I had this one running here)
and ensured that the buffering of the system-dependent form of the Bitmap
as cairo surface still works. Regarding the newly introduced fAlpha
parameter I want to add some remarks:
- It should be called fOpacity to make clear that it describes opacity,
defining that if 1.0 == fAlpha means *no* transparency. That word is
used in other graphic systems and makes more clear what function it has.
It is the opposite of transparency, but works the same.
- Currently all implementations of ::drawTransformedBitmap - except Skia
where it was implemented - do not use it, but return false. It will in most
cases not be too complicated to add/implement it, e.g. for cairo anyways a
transparency surface will/is created, fAlpha can just be merged in, and the
criteria for buffering that may be extended to remember for which value
(if at all) of fAlpha that was prepared. I strongly recommend implementing
these for our main graphic backends.
- The primitive renderer uses another more general way to add an extra alpha
channel to paint when needed - it draws the content (any content) that needs
to be transparent to a buffer and then that buffer using the intended
transparency. This is discussable since may be more expensive, but more
general and keeps the interface less complex. We can see here that adding
that complexity to the existing interface at OutputDevice makes the
implementations more complex what might be the reason his was only
implemented for one of nine backends. When adding something like this and
extending the complexity I would prefer that at the same time it gets
also *implemented* in all or most or at least most used cases. I want to
make clear that from my POV in those cases choosing possible runtime speed
over complexity is not always preferable.
Change-Id: I5bab59f59fca878a7b11a20094e49e8b50196063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126480
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 5 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/qt5/QtGraphics.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 15 | ||||
-rw-r--r-- | vcl/inc/salgdiimpl.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/GenPspGfxBackend.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/qt5/QtGraphics_GDI.cxx | 3 | ||||
-rw-r--r-- | vcl/quartz/AquaGraphicsBackend.cxx | 2 | ||||
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 7 | ||||
-rw-r--r-- | vcl/source/gdi/salgdilayout.cxx | 46 | ||||
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 12 | ||||
-rw-r--r-- | vcl/source/outdev/bitmapex.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/generic/print/GenPspGfxBackend.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 5 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi_gdiplus.cxx | 9 |
23 files changed, 62 insertions, 86 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index ac375c3fadf0..b894183102be 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -830,11 +830,6 @@ bool SvpSalGraphics::drawTransformedBitmap( return true; } -bool SvpSalGraphics::hasFastDrawTransformedBitmap() const -{ - return false; -} - void SvpSalGraphics::clipRegion(cairo_t* cr, const vcl::Region& rClipRegion) { RectangleVector aRectangles; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 32168d87e727..c69462b89742 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -147,7 +147,6 @@ protected: const SalBitmap& rSourceBitmap, const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; virtual bool drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency ) override; cairo_t* createTmpCompatibleCairoContext() const; diff --git a/vcl/inc/qt5/QtGraphics.hxx b/vcl/inc/qt5/QtGraphics.hxx index fed7c2cb88f0..b5756584f11b 100644 --- a/vcl/inc/qt5/QtGraphics.hxx +++ b/vcl/inc/qt5/QtGraphics.hxx @@ -149,8 +149,6 @@ public: const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap, const SalBitmap* pAlphaBitmap, double fAlpha) override; - bool hasFastDrawTransformedBitmap() const override; - bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index f0aa925c6083..f996ffff378d 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -431,8 +431,6 @@ public: const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap, const SalBitmap* pAlphaBitmap, double fAlpha) override; - bool hasFastDrawTransformedBitmap() const override; - bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 716c9aa934a6..121f7044ca5c 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -430,7 +430,7 @@ public: double fAlpha, const OutputDevice& rOutDev ); - bool HasFastDrawTransformedBitmap() const; + bool ImplementsFastDrawTransformedBitmap(bool bTestAllowed) const; bool DrawAlphaRect( tools::Long nX, tools::Long nY, @@ -600,10 +600,6 @@ protected: const SalBitmap* pAlphaBitmap, double fAlpha) = 0; - /// Used e.g. by canvas to know whether to cache the drawing. - /// See also tdf#138068. - virtual bool hasFastDrawTransformedBitmap() const = 0; - /** Render solid rectangle with given transparency * * @param nX Top left coordinate of rectangle @@ -629,6 +625,10 @@ private: bool m_bLastMirrorDeviceLTRButBiDiRtlSet; protected: + /// check/remember if FastDraw is implemented for this SalGraphics + bool m_bFastDrawTransformedBitmapChecked; + bool m_bFastDrawTransformedBitmap; + /// flags which hold the SetAntialiasing() value from OutputDevice bool m_bAntiAlias : 1; @@ -894,11 +894,6 @@ public: return GetImpl()->drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha); } - bool hasFastDrawTransformedBitmap() const override - { - return GetImpl()->hasFastDrawTransformedBitmap(); - } - bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override { diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx index cb4bc35bd942..035f896b2456 100644 --- a/vcl/inc/salgdiimpl.hxx +++ b/vcl/inc/salgdiimpl.hxx @@ -212,10 +212,6 @@ public: const SalBitmap* pAlphaBitmap, double fAlpha) = 0; - /// Used e.g. by canvas to know whether to cache the drawing. - /// See also tdf#138068. - virtual bool hasFastDrawTransformedBitmap() const = 0; - virtual bool drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index b5144a249207..6db0e87cdb99 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -173,8 +173,6 @@ public: const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap, const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; - /** Render solid rectangle with given transparency @param nX Top left coordinate of rectangle diff --git a/vcl/inc/unx/GenPspGfxBackend.hxx b/vcl/inc/unx/GenPspGfxBackend.hxx index a37ee433e6eb..181d9f7ab95d 100644 --- a/vcl/inc/unx/GenPspGfxBackend.hxx +++ b/vcl/inc/unx/GenPspGfxBackend.hxx @@ -111,8 +111,6 @@ public: const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap, const SalBitmap* pAlphaBitmap, double fAlpha) override; - bool hasFastDrawTransformedBitmap() const override; - bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 2a1a9945bd17..92c638ba660a 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -253,8 +253,6 @@ public: const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; - virtual bool drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index b472ece0a256..065e7e25aa5a 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -309,8 +309,6 @@ public: const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; - virtual bool drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency ) override; private: diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx index f87de50827df..cbbe2d819c96 100644 --- a/vcl/qt5/QtGraphics_GDI.cxx +++ b/vcl/qt5/QtGraphics_GDI.cxx @@ -661,6 +661,7 @@ bool QtGraphicsBackend::drawTransformedBitmap(const basegfx::B2DPoint& rNull, { if (fAlpha != 1.0) return false; + QImage aImage; if (pAlphaBitmap && !getAlphaImage(rSourceBitmap, *pAlphaBitmap, aImage)) return false; @@ -681,8 +682,6 @@ bool QtGraphicsBackend::drawTransformedBitmap(const basegfx::B2DPoint& rNull, return true; } -bool QtGraphicsBackend::hasFastDrawTransformedBitmap() const { return false; } - bool QtGraphicsBackend::drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) { diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index 056d2cd0e32f..060ca471aef8 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -1299,8 +1299,6 @@ bool AquaGraphicsBackend::drawTransformedBitmap(const basegfx::B2DPoint& rNull, return true; } -bool AquaGraphicsBackend::hasFastDrawTransformedBitmap() const { return false; } - bool AquaGraphicsBackend::drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) { diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 593e2ffb57e4..9e022a02dec6 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -1829,13 +1829,6 @@ void SkiaSalGraphicsImpl::drawShader(const SalTwoRect& rPosAry, const sk_sp<SkSh postDraw(); } -bool SkiaSalGraphicsImpl::hasFastDrawTransformedBitmap() const -{ - // Return true even in raster mode, even that way Skia is faster than e.g. GraphicObject - // trying to handle stuff manually. - return true; -} - // Whether applying matrix needs image smoothing for the transformation. static bool matrixNeedsHighQuality(const SkMatrix& matrix) { diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index aafa8f157e70..15a1a1384540 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -54,6 +54,8 @@ SalGraphics::SalGraphics() m_aLastMirrorW(0), m_nLastMirrorDeviceLTRButBiDiRtlTranslate(0), m_bLastMirrorDeviceLTRButBiDiRtlSet(false), + m_bFastDrawTransformedBitmapChecked(false), + m_bFastDrawTransformedBitmap(false), m_bAntiAlias(false) { // read global RTL settings @@ -842,6 +844,9 @@ bool SalGraphics::DrawTransformedBitmap( double fAlpha, const OutputDevice& rOutDev) { + bool bRetval(false); + bool bDone(false); + if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() ) { // mirroring set @@ -856,16 +861,49 @@ bool SalGraphics::DrawTransformedBitmap( basegfx::B2DPoint aX = aTranslateToMirroredBounds * rX; basegfx::B2DPoint aY = aTranslateToMirroredBounds * rY; - return drawTransformedBitmap(aNull, aX, aY, rSourceBitmap, pAlphaBitmap, fAlpha); + bRetval = drawTransformedBitmap(aNull, aX, aY, rSourceBitmap, pAlphaBitmap, fAlpha); + bDone = true; } } - return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha); + if(!bDone) + { + bRetval = drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha); + } + + if(bRetval && !m_bFastDrawTransformedBitmap) + { + // we had a sucessful call, note it for this SalGraphics + m_bFastDrawTransformedBitmap = true; + } + + return bRetval; } -bool SalGraphics::HasFastDrawTransformedBitmap() const +bool SalGraphics::ImplementsFastDrawTransformedBitmap(bool bTestAllowed) const { - return hasFastDrawTransformedBitmap(); + // do not check when we already had a sucessful usage of drawTransformedBitmap (see above) + // only check if calling OutputDevice is not empty (bTestAllowed) + // check only once using the direct check method (see below) + if(!m_bFastDrawTransformedBitmap && bTestAllowed && !m_bFastDrawTransformedBitmapChecked) + { + // for check and to not change anything, get the top-left pixel as SalBitmap + // and try to paint it again. This avoids an extra virtual method hat would need + // to be implemened at all backends and cald all the time (virual calls). + // Nothing simpler came to my mind, maybe there is something... + SalGraphics* that(const_cast<SalGraphics*>(this)); + std::shared_ptr<SalBitmap> aTest(that->getBitmap(0, 0, 1, 1)); + that->m_bFastDrawTransformedBitmapChecked = true; + that->m_bFastDrawTransformedBitmap = that->drawTransformedBitmap( + basegfx::B2DPoint::getEmptyPoint(), + basegfx::B2DPoint(1.0, 0.0), + basegfx::B2DPoint(0.0, 1.0), + *aTest, + nullptr, + 1.0); + } + + return m_bFastDrawTransformedBitmap; } bool SalGraphics::DrawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 53a9f774b71d..2c6d3a50a7d9 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -691,18 +691,6 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, mpMetaFile = pOldMetaFile; } -bool OutputDevice::HasFastDrawTransformedBitmap() const -{ - if( ImplIsRecordLayout() ) - return false; - - if (!mpGraphics && !AcquireGraphics()) - return false; - assert(mpGraphics); - - return mpGraphics->HasFastDrawTransformedBitmap(); -} - 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 7855d1ae5613..d5d35b762ede 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -525,7 +525,7 @@ void OutputDevice::DrawTransformedBitmapEx( if(rtl::math::approxEqual( fAlpha, 1.0 )) fAlpha = 1.0; // avoid the need for approxEqual in backends - if(bTryDirectPaint && mpGraphics->HasFastDrawTransformedBitmap() && DrawTransformBitmapExDirect(aFullTransform, bitmapEx)) + if(bTryDirectPaint && DrawTransformBitmapExDirect(aFullTransform, bitmapEx)) return; // decompose matrix to check rotation and shear @@ -689,4 +689,9 @@ void OutputDevice::DrawTransformedBitmapEx( DrawBitmapEx(aDestPt, aDestSize, aTransformed); } +bool OutputDevice::ImplementsFastDrawTransformedBitmap() const +{ + return mpGraphics->ImplementsFastDrawTransformedBitmap(!GetOutputSizePixel().IsEmpty()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 53226821b4a1..7c167255d33b 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -852,11 +852,6 @@ bool X11SalGraphicsImpl::drawTransformedBitmap( return false; } -bool X11SalGraphicsImpl::hasFastDrawTransformedBitmap() const -{ - return false; -} - bool X11SalGraphicsImpl::drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency ) { diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx index 6257b47d613d..56cfba5ba371 100644 --- a/vcl/unx/generic/gdi/gdiimpl.hxx +++ b/vcl/unx/generic/gdi/gdiimpl.hxx @@ -272,8 +272,6 @@ public: const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; - /** Render solid rectangle with given transparency @param nTransparency diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index cfdb272005a5..648de56744a0 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -139,12 +139,11 @@ bool X11SalGraphics::drawTransformedBitmap( const SalBitmap* pAlphaBitmap, double fAlpha) { - return mxImpl->drawTransformedBitmap( rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha ); -} + // called mxImpl->drawTransformedBitmap anyways returns false, but spares a call + if( fAlpha != 1.0 ) + return false; -bool X11SalGraphics::hasFastDrawTransformedBitmap() const -{ - return mxImpl->hasFastDrawTransformedBitmap(); + return mxImpl->drawTransformedBitmap( rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha ); } bool X11SalGraphics::drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, diff --git a/vcl/unx/generic/print/GenPspGfxBackend.cxx b/vcl/unx/generic/print/GenPspGfxBackend.cxx index 7b461ff4f5c6..2201c54c69d8 100644 --- a/vcl/unx/generic/print/GenPspGfxBackend.cxx +++ b/vcl/unx/generic/print/GenPspGfxBackend.cxx @@ -387,8 +387,6 @@ bool GenPspGfxBackend::drawTransformedBitmap(const basegfx::B2DPoint& /*rNull*/, return false; } -bool GenPspGfxBackend::hasFastDrawTransformedBitmap() const { return false; } - bool GenPspGfxBackend::drawAlphaRect(tools::Long /*nX*/, tools::Long /*nY*/, tools::Long /*nWidth*/, tools::Long /*nHeight*/, sal_uInt8 /*nTransparency*/) { diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 2c418732561b..5d0bab4ebaac 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -2714,11 +2714,6 @@ bool WinSalGraphicsImpl::drawTransformedBitmap( return false; } -bool WinSalGraphicsImpl::hasFastDrawTransformedBitmap() const -{ - return false; -} - bool WinSalGraphicsImpl::drawGradient(const tools::PolyPolygon& /*rPolygon*/, const Gradient& /*rGradient*/) { diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx index 86342533fc6c..697ae97dde17 100644 --- a/vcl/win/gdi/gdiimpl.hxx +++ b/vcl/win/gdi/gdiimpl.hxx @@ -228,8 +228,6 @@ public: const SalBitmap* pAlphaBitmap, double fAlpha) override; - virtual bool hasFastDrawTransformedBitmap() const override; - /** Render solid rectangle with given transparency @param nTransparency diff --git a/vcl/win/gdi/salgdi_gdiplus.cxx b/vcl/win/gdi/salgdi_gdiplus.cxx index 13452f5c7a6e..bbf4889c14f4 100644 --- a/vcl/win/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/gdi/salgdi_gdiplus.cxx @@ -92,13 +92,12 @@ bool WinSalGraphics::drawTransformedBitmap( const SalBitmap* pAlphaBitmap, double fAlpha) { + // called mpImpl->drawTransformedBitmap also checks this, but spares a call + if( fAlpha != 1.0 ) + return false; + return mpImpl->drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha); } -bool WinSalGraphics::hasFastDrawTransformedBitmap() const -{ - return mpImpl->hasFastDrawTransformedBitmap(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |