diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-16 02:22:20 +1100 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-22 04:17:13 +0000 |
commit | d4855da9e9718b31b371376ee8a469e9e26495af (patch) | |
tree | 32f0e4e8b640618d25a982b809b9106c90e193a5 /vcl/source | |
parent | 0e0755e3903d54ec3942094060ca84e37e78264b (diff) |
fdo#74702 Moved CopyArea() Window specific function
There is Window specific code in OutputDevice::CopyArea(...).
I have moved this to a protected function CopyAreaFinal(...).
Conflicts:
include/vcl/print.hxx
vcl/source/gdi/outdev2.cxx
Change-Id: I9098ec960527a2aca6154ac6e791b947a8e4f78e
Reviewed-on: https://gerrit.libreoffice.org/8605
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 36 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 33 |
2 files changed, 45 insertions, 24 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index fc1aaaebc9db..4d2cf6dce91a 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -369,32 +369,10 @@ void OutputDevice::CopyArea( const Point& rDestPt, const Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); - const Rectangle aSrcRect( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ), - Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) ); ImplAdjustTwoRect( aPosAry, aSrcOutRect ); - if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) - { - if ( (meOutDevType == OUTDEV_WINDOW) && (nFlags & COPYAREA_WINDOWINVALIDATE) ) - { - ((Window*)this)->ImplMoveAllInvalidateRegions( aSrcRect, - aPosAry.mnDestX-aPosAry.mnSrcX, - aPosAry.mnDestY-aPosAry.mnSrcY, - false ); - - mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY, - aPosAry.mnSrcX, aPosAry.mnSrcY, - aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, - SAL_COPYAREA_WINDOWINVALIDATE, this ); - } - else - { - aPosAry.mnDestWidth = aPosAry.mnSrcWidth; - aPosAry.mnDestHeight = aPosAry.mnSrcHeight; - mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); - } - } + CopyAreaFinal ( aPosAry, nFlags ); } SetRasterOp( eOldRop ); @@ -403,6 +381,18 @@ void OutputDevice::CopyArea( const Point& rDestPt, mpAlphaVDev->CopyArea( rDestPt, rSrcPt, rSrcSize, nFlags ); } +void OutputDevice::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags ) +{ + (void) nFlags; + + if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) + { + aPosAry.mnDestWidth = aPosAry.mnSrcWidth; + aPosAry.mnDestHeight = aPosAry.mnSrcHeight; + mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); + } +} + void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize, const OutputDevice& rOutDev, const Region& rRegion ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index dbb2c5f3b476..8c8106f75eec 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -420,6 +420,37 @@ bool Window::ImplInitGraphics() const return mpGraphics ? true : false; } +void Window::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags ) +{ + + const Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ), + Size( mnOutWidth, mnOutHeight ) ); + const Rectangle aSrcRect ( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ), + Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) ); + + if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) + { + if ( nFlags & COPYAREA_WINDOWINVALIDATE ) + { + ImplMoveAllInvalidateRegions( aSrcRect, + aPosAry.mnDestX-aPosAry.mnSrcX, + aPosAry.mnDestY-aPosAry.mnSrcY, + false ); + + mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY, + aPosAry.mnSrcX, aPosAry.mnSrcY, + aPosAry.mnSrcWidth, aPosAry.mnSrcHeight, + SAL_COPYAREA_WINDOWINVALIDATE, this ); + } + else + { + aPosAry.mnDestWidth = aPosAry.mnSrcWidth; + aPosAry.mnDestHeight = aPosAry.mnSrcHeight; + mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); + } + } +} + void Window::ImplReleaseGraphics( bool bRelease ) { DBG_TESTSOLARMUTEX(); @@ -988,7 +1019,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste mpWindowImpl->mpFrameData->mpMouseMoveWin = NULL; mpWindowImpl->mpFrameData->mpMouseDownWin = NULL; mpWindowImpl->mpFrameData->mpFirstBackWin = NULL; - mpWindowImpl->mpFrameData->mpFontCollection = pSVData->maGDIData.mpScreenFontList; + mpWindowImpl->mpFrameData->mpFontCollection = pSVData->maGDIData.mpScreenFontList; mpWindowImpl->mpFrameData->mpFontCache = pSVData->maGDIData.mpScreenFontCache; mpWindowImpl->mpFrameData->mnAllSaveBackSize = 0; mpWindowImpl->mpFrameData->mnFocusId = 0; |