[Libreoffice-commits] core.git: drawinglayer/source

Armin Le Grand alg at apache.org
Thu Jun 13 08:01:33 PDT 2013


 drawinglayer/source/processor2d/vclhelperbitmaprender.cxx |    9 ++++-
 drawinglayer/source/processor2d/vclprocessor2d.cxx        |   23 ++++++++++----
 2 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit e08407052f556c981e533f532815125769212685
Author: Armin Le Grand <alg at apache.org>
Date:   Tue Jan 15 08:19:38 2013 +0000

    Resolves: #i121534# only handle bitmaps which are inside visible area
    
    (cherry picked from commit ad026d3b68d5d0d527eed591b3c6f8247bec641b)
    
    Change-Id: I2f4ca680a003e1c58d9cbefa3bee81bcc117916b

diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
index 598b7d1..4e67fa7 100644
--- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
@@ -74,7 +74,14 @@ namespace drawinglayer
         }
 
         // draw bitmap
-        rOutDev.DrawBitmapEx(aPoint, aSize, aContent);
+        if(aSize == aContent.GetSizePixel())
+        {
+            rOutDev.DrawBitmapEx(aPoint, aContent);
+        }
+        else
+        {
+            rOutDev.DrawBitmapEx(aPoint, aSize, aContent);
+        }
     }
 
     void RenderBitmapPrimitive2D_self(
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 533f2c2..759454a 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -415,10 +415,24 @@ namespace drawinglayer
         // direct draw of transformed BitmapEx primitive
         void VclProcessor2D::RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate)
         {
-            // create local transform
-            basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
+            // check local ViewPort
+            const basegfx::B2DRange& rDiscreteViewPort(getViewInformation2D().getDiscreteViewport());
+            const basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
+
+            if(!rDiscreteViewPort.isEmpty())
+            {
+                // check if we are visible
+                basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+                aUnitRange.transform(aLocalTransform);
+
+                if(!aUnitRange.overlaps(rDiscreteViewPort))
+                {
+                    return;
+                }
+            }
+
             BitmapEx aBitmapEx(rBitmapCandidate.getBitmapEx());
-            bool bPainted(false);
 
             if(maBColorModifierStack.count())
             {
@@ -435,11 +449,10 @@ namespace drawinglayer
                     mpOutputDevice->SetLineColor();
                     mpOutputDevice->DrawPolygon(aPolygon);
 
-                    bPainted = true;
+                    return;
                 }
             }
 
-            if(!bPainted)
             {
                 static bool bForceUseOfOwnTransformer(false);
 


More information about the Libreoffice-commits mailing list