Title: [95778] trunk/Source/WebCore
Revision
95778
Author
da...@apple.com
Date
2011-09-22 20:21:12 -0700 (Thu, 22 Sep 2011)

Log Message

Remove unneeded type conversion from background bleed code
https://bugs.webkit.org/show_bug.cgi?id=68669

Reviewed by Geoffrey Garen.

* rendering/RenderBoxModelObject.cpp:
(WebCore::backgroundRectAdjustedForBleedAvoidance): Use ceil instead of ceilf
and eliminate superflous conversion to float and use of FloatSize. Also added
a "why" comment.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95777 => 95778)


--- trunk/Source/WebCore/ChangeLog	2011-09-23 03:00:38 UTC (rev 95777)
+++ trunk/Source/WebCore/ChangeLog	2011-09-23 03:21:12 UTC (rev 95778)
@@ -1,5 +1,17 @@
 2011-09-22  Darin Adler  <da...@apple.com>
 
+        Remove unneeded type conversion from background bleed code
+        https://bugs.webkit.org/show_bug.cgi?id=68669
+
+        Reviewed by Geoffrey Garen.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::backgroundRectAdjustedForBleedAvoidance): Use ceil instead of ceilf
+        and eliminate superflous conversion to float and use of FloatSize. Also added
+        a "why" comment.
+
+2011-09-22  Darin Adler  <da...@apple.com>
+
         Refactor checks for antialiasing lines to share a single function
         https://bugs.webkit.org/show_bug.cgi?id=68666
 

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (95777 => 95778)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-09-23 03:00:38 UTC (rev 95777)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-09-23 03:21:12 UTC (rev 95778)
@@ -586,12 +586,11 @@
     if (bleedAvoidance != BackgroundBleedShrinkBackground)
         return borderRect;
 
+    // We shrink the rectangle by one pixel on each side because the bleed is one pixel maximum.
+    AffineTransform transform = context->getCTM();
     LayoutRect adjustedRect = borderRect;
-    // We need to shrink the border by one device pixel on each side.
-    AffineTransform ctm = context->getCTM();
-    FloatSize contextScale(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale()));
-    adjustedRect.inflateX(-ceilf(1 / contextScale.width()));
-    adjustedRect.inflateY(-ceilf(1 / contextScale.height()));
+    adjustedRect.inflateX(-ceil(1 / transform.xScale()));
+    adjustedRect.inflateY(-ceil(1 / transform.yScale()));
     return adjustedRect;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to