summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-06-02 08:29:34 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-07-19 23:40:52 +1000
commitf3c96bad9d9d9c8e4c51972ed09224bf0dea7f4c (patch)
tree647488f7ecd97dce194c5faddc3996b66eb57aae
parent2b2d85e9c4d41d89f4639d02fe19475a17b62a88 (diff)
vcl: move ImplIntersectWindowRegion to ClipManager
Moved Window::ImplIntersectWindowRegion() to ClipManager::Intersect(). Change-Id: I1893e5934c18404427b6975f580e8f698c6c590b
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/inc/clipmgr.hxx1
-rw-r--r--vcl/source/window/clipmgr.cxx8
-rw-r--r--vcl/source/window/clipping.cxx20
4 files changed, 17 insertions, 14 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 55fa90716a53..c79b50690325 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -521,8 +521,6 @@ private:
SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjClip();
- SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion );
-
SAL_DLLPRIVATE void ImplClipAllChildren( Region& rRegion );
SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion );
diff --git a/vcl/inc/clipmgr.hxx b/vcl/inc/clipmgr.hxx
index 6b00969f6607..23e8cd9736a1 100644
--- a/vcl/inc/clipmgr.hxx
+++ b/vcl/inc/clipmgr.hxx
@@ -51,6 +51,7 @@ public:
bool ClipChildren( Window *pWindow, Region& rRegion );
Region* GetChildClipRegion( Window* pWindow );
+ void Intersect( Window* pWindow, Region& rRegion );
void Exclude( Window *pWindow, Region& rRegion );
};
diff --git a/vcl/source/window/clipmgr.cxx b/vcl/source/window/clipmgr.cxx
index 40711d7aa932..ad00d709004b 100644
--- a/vcl/source/window/clipmgr.cxx
+++ b/vcl/source/window/clipmgr.cxx
@@ -148,6 +148,14 @@ Region* ClipManager::GetChildClipRegion( Window* pWindow )
return &pWindow->mpWindowImpl->maWinClipRegion;
}
+void ClipManager::Intersect( Window* pWindow, Region& rRegion )
+{
+ rRegion.Intersect( Rectangle( Point( pWindow->mnOutOffX, pWindow->mnOutOffY ),
+ pWindow->GetOutputSizePixel() ) );
+ if ( pWindow->mpWindowImpl->mbWinRegion )
+ rRegion.Intersect( pWindow->ImplPixelToDevicePixel( pWindow->mpWindowImpl->maWinRegion ) );
+}
+
void ClipManager::Exclude( Window *pWindow, Region& rRegion )
{
if ( pWindow->mpWindowImpl->mbWinRegion )
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index 24514e28ae70..1ac5b2773cf2 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -414,23 +414,17 @@ bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
return mpWindowImpl->mpFrameWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller );
}
-void Window::ImplIntersectWindowRegion( Region& rRegion )
-{
- rRegion.Intersect( Rectangle( Point( mnOutOffX, mnOutOffY ),
- Size( mnOutWidth, mnOutHeight ) ) );
- if ( mpWindowImpl->mbWinRegion )
- rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
-}
-
void Window::ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion )
{
+ ClipManager *clipMgr = ClipManager::GetInstance();
+
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
{
Region aTempRegion( rInterRegion );
- pWindow->ImplIntersectWindowRegion( aTempRegion );
+ clipMgr->Intersect( pWindow, aTempRegion );
rRegion.Union( aTempRegion );
pWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
}
@@ -441,10 +435,12 @@ void Window::ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Re
void Window::ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion )
{
+ ClipManager *clipMgr = ClipManager::GetInstance();
+
if ( mpWindowImpl->mbReallyVisible )
{
Region aTempRegion( rInterRegion );
- ImplIntersectWindowRegion( aTempRegion );
+ clipMgr->Intersect( this, aTempRegion );
rRegion.Union( aTempRegion );
}
@@ -527,7 +523,7 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
if ( pWindow->mpWindowImpl->mbReallyVisible && (pWindow != this) )
{
aTempRegion = aRegion;
- pWindow->ImplIntersectWindowRegion( aTempRegion );
+ clipMgr->Intersect( pWindow, aTempRegion );
rRegion.Union( aTempRegion );
}
pWindow = pWindow->mpWindowImpl->mpNext;
@@ -543,7 +539,7 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
if ( pWindow->mpWindowImpl->mbReallyVisible )
{
aTempRegion = aRegion;
- pWindow->ImplIntersectWindowRegion( aTempRegion );
+ clipMgr->Intersect( pWindow, aTempRegion );
rRegion.Union( aTempRegion );
}
pWindow = pWindow->mpWindowImpl->mpNext;