summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-03-16 02:22:20 +1100
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-03-22 04:17:13 +0000
commitd4855da9e9718b31b371376ee8a469e9e26495af (patch)
tree32f0e4e8b640618d25a982b809b9106c90e193a5
parent0e0755e3903d54ec3942094060ca84e37e78264b (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>
-rw-r--r--include/vcl/outdev.hxx3
-rw-r--r--include/vcl/print.hxx1
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/source/gdi/outdev2.cxx36
-rw-r--r--vcl/source/window/window.cxx33
5 files changed, 50 insertions, 25 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 933f199419ae..76f6011f3b59 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1036,7 +1036,10 @@ public:
void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
sal_uInt16 nFlags = 0 );
+protected:
+ virtual void CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags);
+public:
void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index deade5f894db..287152171b43 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -285,7 +285,6 @@ protected:
virtual void ImplPrintMask ( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
-
bool DrawTransformBitmapExDirect(
const basegfx::B2DHomMatrix& aFullTransform,
const BitmapEx& rBitmapEx);
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8d76850eb7fc..007cf8888e44 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -578,6 +578,8 @@ protected:
virtual sal_uInt16 getDefaultAccessibleRole() const;
virtual OUString getDefaultAccessibleName() const;
+ virtual void CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags);
+
public:
bool HasMirroredGraphics() const;
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;