[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Fri Mar 21 21:17:39 PDT 2014
include/vcl/outdev.hxx | 3 +++
include/vcl/print.hxx | 1 -
include/vcl/window.hxx | 2 ++
vcl/source/gdi/outdev2.cxx | 36 +++++++++++++-----------------------
vcl/source/window/window.cxx | 33 ++++++++++++++++++++++++++++++++-
5 files changed, 50 insertions(+), 25 deletions(-)
New commits:
commit d4855da9e9718b31b371376ee8a469e9e26495af
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun Mar 16 02:22:20 2014 +1100
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 at gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 933f199..76f6011 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 deade5f..2871521 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 8d76850..007cf88 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 fc1aaae..4d2cf6d 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 dbb2c5f..8c8106f 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;
More information about the Libreoffice-commits
mailing list