diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 15:34:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 16:02:49 +0000 |
commit | 3fde719130781fc509241a66d08a8f57ba95354f (patch) | |
tree | 0738eaeac1f7d838cef28248cd7e015b701bc58d /vcl/headless | |
parent | 465359c35fcd8c30a2bedd3d0beb07c0c1c36cba (diff) |
the clipping must be against the original device
seeing as the clipping replaces the old clipping and doesn't
further subset the clipping
and presumably, the same must be true for "unclipping"
the device
This nearly killed me to debug and is a crucial bit to make the gtk3 thing work
right.
Change-Id: I21629ef7c8a19b720d05d4e4938f40d4776bee76
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index a0bea2ba2cad..ea043b1b070b 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -240,6 +240,8 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IBox &aRange, SvpSalGraphi { if( aHitRect.IsInside( aRect ) ) { + //The region to be painted (aRect) is equal to or inside the + //current clipping region // fprintf (stderr, " is inside ! avoid deeper clip ...\n"); return false; } @@ -276,6 +278,7 @@ bool SvpSalGraphics::setClipRegion( const vcl::Region& i_rClip ) m_aClipMap.reset(); if( i_rClip.IsEmpty() ) { + m_aDevice = m_aOrigDevice; m_bClipSetup = true; return true; } @@ -283,8 +286,9 @@ bool SvpSalGraphics::setClipRegion( const vcl::Region& i_rClip ) RectangleVector aRectangles; i_rClip.GetRegionRectangles(aRectangles); - if(1 == aRectangles.size()) + if (1 == aRectangles.size()) { + //simplest case, subset the device to clip bounds m_aClipMap.reset(); const Rectangle& aBoundRect = aRectangles[0]; @@ -295,7 +299,14 @@ bool SvpSalGraphics::setClipRegion( const vcl::Region& i_rClip ) m_bClipSetup = true; } else + { + //more complex, either setup and tear down temporary + //subsets of the original device around render calls + //or generate m_aClipMap and pass that to basebmp + //calls + m_aDevice = m_aOrigDevice; m_bClipSetup = false; + } return true; } |