diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2021-12-10 16:36:11 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2021-12-10 17:51:12 +0100 |
commit | 2c6e2fa596d4ecb22adb062a837f1bbf4384fed2 (patch) | |
tree | f2a588a1bbaa54faf5633dfdcce8e199322d639c /vcl/source | |
parent | 6494fba15ea93283b625bf6bdb4666709f22439f (diff) |
Revert "Re-Enable DrawTransformBitmapExDirect for render backends"
This reverts commit 7e5af164b7d293dd410710bed411e1ca64bbecf7.
Reason for revert: Not the best/effective way to clear out the stuff remaining to be done, would need additional stuff
Change-Id: Ia6ab90384da29a5e34eff0ab8881bad2ab49c58c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126601
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'vcl/source')
-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 |
3 files changed, 17 insertions, 48 deletions
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 15a1a1384540..aafa8f157e70 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -54,8 +54,6 @@ SalGraphics::SalGraphics() m_aLastMirrorW(0), m_nLastMirrorDeviceLTRButBiDiRtlTranslate(0), m_bLastMirrorDeviceLTRButBiDiRtlSet(false), - m_bFastDrawTransformedBitmapChecked(false), - m_bFastDrawTransformedBitmap(false), m_bAntiAlias(false) { // read global RTL settings @@ -844,9 +842,6 @@ bool SalGraphics::DrawTransformedBitmap( double fAlpha, const OutputDevice& rOutDev) { - bool bRetval(false); - bool bDone(false); - if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() ) { // mirroring set @@ -861,49 +856,16 @@ bool SalGraphics::DrawTransformedBitmap( basegfx::B2DPoint aX = aTranslateToMirroredBounds * rX; basegfx::B2DPoint aY = aTranslateToMirroredBounds * rY; - bRetval = drawTransformedBitmap(aNull, aX, aY, rSourceBitmap, pAlphaBitmap, fAlpha); - bDone = true; + return drawTransformedBitmap(aNull, aX, aY, 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; + return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha); } -bool SalGraphics::ImplementsFastDrawTransformedBitmap(bool bTestAllowed) const +bool SalGraphics::HasFastDrawTransformedBitmap() const { - // 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; + return hasFastDrawTransformedBitmap(); } 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 2c6d3a50a7d9..53a9f774b71d 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -691,6 +691,18 @@ 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 d5d35b762ede..7855d1ae5613 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 && DrawTransformBitmapExDirect(aFullTransform, bitmapEx)) + if(bTryDirectPaint && mpGraphics->HasFastDrawTransformedBitmap() && DrawTransformBitmapExDirect(aFullTransform, bitmapEx)) return; // decompose matrix to check rotation and shear @@ -689,9 +689,4 @@ 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: */ |