[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dbates at webkit.org dbates at webkit.org
Wed Dec 22 13:36:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f196819f691cd54c9cc9b0b4b1f88e39c84ba188
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 04:27:36 2010 +0000

    2010-09-20  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Dan Bernstein.
    
            Cleanup: Extract common border radii expansion code in
            RenderBoxModelObject::paintBoxShadow() into function
            https://bugs.webkit.org/show_bug.cgi?id=45934
    
            Extracted code for expanding and clamping the border radii
            into common function to remove duplicate code.
    
            No functionality was changed. So, no new tests.
    
            * rendering/RenderBoxModelObject.cpp:
            (WebCore::uniformlyExpandBorderRadii): Added.
            (WebCore::RenderBoxModelObject::paintBoxShadow): Moved common code to uniformlyExpandBorderRadii().
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 723133e..77ef188 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-20  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Dan Bernstein.
+
+        Cleanup: Extract common border radii expansion code in
+        RenderBoxModelObject::paintBoxShadow() into function
+        https://bugs.webkit.org/show_bug.cgi?id=45934
+
+        Extracted code for expanding and clamping the border radii
+        into common function to remove duplicate code.
+
+        No functionality was changed. So, no new tests.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::uniformlyExpandBorderRadii): Added.
+        (WebCore::RenderBoxModelObject::paintBoxShadow): Moved common code to uniformlyExpandBorderRadii().
+
 2010-09-20  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by James Robinson.
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index f4c2d2a..74de8a8 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -1590,6 +1590,18 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
     graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches);
 }
 
+static inline void uniformlyExpandBorderRadii(int delta, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight)
+{
+    topLeft.expand(delta, delta);
+    topLeft.clampNegativeToZero();
+    topRight.expand(delta, delta);
+    topRight.clampNegativeToZero();
+    bottomLeft.expand(delta, delta);
+    bottomLeft.clampNegativeToZero();
+    bottomRight.expand(delta, delta);
+    bottomRight.clampNegativeToZero();
+}
+
 void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
 {
     // FIXME: Deal with border-image.  Would be great to use border-image as a mask.
@@ -1673,37 +1685,15 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
                 IntSize bottomLeftToClipOut = bottomLeft;
                 IntSize bottomRightToClipOut = bottomRight;
 
-                if (shadowSpread < 0) {
-                    topLeft.expand(shadowSpread, shadowSpread);
-                    topLeft.clampNegativeToZero();
-
-                    topRight.expand(shadowSpread, shadowSpread);
-                    topRight.clampNegativeToZero();
-
-                    bottomLeft.expand(shadowSpread, shadowSpread);
-                    bottomLeft.clampNegativeToZero();
-
-                    bottomRight.expand(shadowSpread, shadowSpread);
-                    bottomRight.clampNegativeToZero();
-                }
+                if (shadowSpread < 0)
+                    uniformlyExpandBorderRadii(shadowSpread, topLeft, topRight, bottomLeft, bottomRight);
 
                 // If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
                 // when painting the shadow. On the other hand, it introduces subpixel gaps along the
                 // corners. Those are avoided by insetting the clipping path by one pixel.
                 if (hasOpaqueBackground) {
                     rectToClipOut.inflate(-1);
-
-                    topLeftToClipOut.expand(-1, -1);
-                    topLeftToClipOut.clampNegativeToZero();
-
-                    topRightToClipOut.expand(-1, -1);
-                    topRightToClipOut.clampNegativeToZero();
-
-                    bottomLeftToClipOut.expand(-1, -1);
-                    bottomLeftToClipOut.clampNegativeToZero();
-
-                    bottomRightToClipOut.expand(-1, -1);
-                    bottomRightToClipOut.clampNegativeToZero();
+                    uniformlyExpandBorderRadii(-1, topLeftToClipOut, topRightToClipOut, bottomLeftToClipOut, bottomRightToClipOut);
                 }
 
                 if (!rectToClipOut.isEmpty())
@@ -1769,19 +1759,8 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
             context->addPath(Path::createRectangle(outerRect));
 
             if (hasBorderRadius) {
-                if (shadowSpread > 0) {
-                    topLeft.expand(-shadowSpread, -shadowSpread);
-                    topLeft.clampNegativeToZero();
-
-                    topRight.expand(-shadowSpread, -shadowSpread);
-                    topRight.clampNegativeToZero();
-
-                    bottomLeft.expand(-shadowSpread, -shadowSpread);
-                    bottomLeft.clampNegativeToZero();
-
-                    bottomRight.expand(-shadowSpread, -shadowSpread);
-                    bottomRight.clampNegativeToZero();
-                }
+                if (shadowSpread > 0)
+                    uniformlyExpandBorderRadii(-shadowSpread, topLeft, topRight, bottomLeft, bottomRight);
                 context->addPath(Path::createRoundedRectangle(holeRect, topLeft, topRight, bottomLeft, bottomRight));
             } else
                 context->addPath(Path::createRectangle(holeRect));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list