[Libreoffice-commits] core.git: vcl/headless

Caolán McNamara caolanm at redhat.com
Wed Mar 11 09:03:17 PDT 2015


 vcl/headless/svpgdi.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 3fde719130781fc509241a66d08a8f57ba95354f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 11 15:34:04 2015 +0000

    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

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index a0bea2b..ea043b1 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;
 }


More information about the Libreoffice-commits mailing list