diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-23 22:31:36 +1100 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-24 11:52:50 +0000 |
commit | eb5242851d8242fbadca7ac8fde7b633b207ba90 (patch) | |
tree | 33968bd5cd93509fca434510e9dd2df05915a7c8 | |
parent | 5e3aa91c77374b555277964b6707252bdc12ac21 (diff) |
fdo#74702 GetPaintArea protected function introduced
GetPaintArea has been introduced for Window - we intersect with the
available paintable boundary to get the actual paintable area needed.
For OutputDevice, GetPaintArea just returns the same area.
Change-Id: If38b09eb54d516d189cedf8bba15b184e6b6f7d5
Reviewed-on: https://gerrit.libreoffice.org/8727
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r-- | include/vcl/outdev.hxx | 1 | ||||
-rw-r--r-- | include/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 13 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 10 |
4 files changed, 18 insertions, 7 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e82cb1ddb94d..c1ac7f3533c8 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -736,6 +736,7 @@ public: SAL_DLLPRIVATE void ImplDrawAlpha ( const Bitmap& rBmp, const AlphaMask& rAlpha, const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + virtual Rectangle& GetPaintArea ( Rectangle& rDstRect ); SAL_DLLPRIVATE Bitmap ImplBlend ( Bitmap aBmp, BitmapReadAccess* pP, BitmapReadAccess* pA, diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 007cf8888e44..d41f0f52c608 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -579,6 +579,7 @@ protected: virtual OUString getDefaultAccessibleName() const; virtual void CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags); + virtual Rectangle& GetPaintArea ( Rectangle& rDstRect ); public: bool HasMirroredGraphics() const; diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 51ee4834ad57..06593b7e95c0 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1992,6 +1992,11 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp, return res; } +Rectangle& OutputDevice::GetPaintArea( Rectangle& rDstRect ) +{ + return rDstRect; +} + void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha, const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ) @@ -2003,13 +2008,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha, const bool bHMirr = aOutSz.Width() < 0; const bool bVMirr = aOutSz.Height() < 0; - if( OUTDEV_WINDOW == meOutDevType ) - { - const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() ); - - if( !aPaintRgn.IsNull() ) - aDstRect.Intersection( LogicToPixel( aPaintRgn.GetBoundRect() ) ); - } + aDstRect = GetPaintArea(aDstRect); if( bHMirr ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1e6a339caf2c..49716ed8fa37 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -446,6 +446,16 @@ void Window::CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags ) OutputDevice::CopyAreaFinal(aPosAry, nFlags); } +Rectangle& Window::GetPaintArea( Rectangle& rDstRect ) +{ + const Region aPaintRgn( GetPaintRegion() ); + + if( !aPaintRgn.IsNull() ) + rDstRect.Intersection( LogicToPixel( aPaintRgn.GetBoundRect() ) ); + + return rDstRect; +} + void Window::ImplReleaseGraphics( bool bRelease ) { DBG_TESTSOLARMUTEX(); |