Title: [110629] trunk/Source/WebCore
Revision
110629
Author
[email protected]
Date
2012-03-13 15:53:35 -0700 (Tue, 13 Mar 2012)

Log Message

Revert RenderLayer::absoluteBoundingBox to an IntRect
https://bugs.webkit.org/show_bug.cgi?id=81017

Reviewed by Eric Seidel.

Reverting RenderLayer::absoluteBoundingBox to an (pixel snapped) IntRect. Whenever
possible, we use integers representing for absolute coordinates. This is especially
relevant for methods, such as this one, that are exported and used in platform code.

No new tests. No change in behavior.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::absoluteBoundingBox):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): This intersects
the absolute bounding box with the FrameView, which uses all integer values. It's
the only use of absoluteBoundingBox in WebCore.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110628 => 110629)


--- trunk/Source/WebCore/ChangeLog	2012-03-13 22:51:44 UTC (rev 110628)
+++ trunk/Source/WebCore/ChangeLog	2012-03-13 22:53:35 UTC (rev 110629)
@@ -1,3 +1,25 @@
+2012-03-13  Levi Weintraub  <[email protected]>
+
+        Revert RenderLayer::absoluteBoundingBox to an IntRect
+        https://bugs.webkit.org/show_bug.cgi?id=81017
+
+        Reviewed by Eric Seidel.
+
+        Reverting RenderLayer::absoluteBoundingBox to an (pixel snapped) IntRect. Whenever
+        possible, we use integers representing for absolute coordinates. This is especially
+        relevant for methods, such as this one, that are exported and used in platform code.
+
+        No new tests. No change in behavior.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::absoluteBoundingBox):
+        * rendering/RenderLayer.h:
+        (RenderLayer):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForPosition): This intersects
+        the absolute bounding box with the FrameView, which uses all integer values. It's
+        the only use of absoluteBoundingBox in WebCore.
+
 2012-03-13  Nat Duca  <[email protected]>
 
         [chromium] vsync ticks are needed in invisible tabs when we are still updating resources

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (110628 => 110629)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-03-13 22:51:44 UTC (rev 110628)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-03-13 22:53:35 UTC (rev 110629)
@@ -3919,9 +3919,9 @@
     return result;
 }
 
-LayoutRect RenderLayer::absoluteBoundingBox() const
+IntRect RenderLayer::absoluteBoundingBox() const
 {
-    return boundingBox(root());
+    return pixelSnappedIntRect(boundingBox(root()));
 }
 
 void RenderLayer::clearClipRectsIncludingDescendants()

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (110628 => 110629)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2012-03-13 22:51:44 UTC (rev 110628)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2012-03-13 22:53:35 UTC (rev 110629)
@@ -475,8 +475,8 @@
     LayoutRect boundingBox(const RenderLayer* rootLayer) const;
     // Bounding box in the coordinates of this layer.
     LayoutRect localBoundingBox() const;
-    // Bounding box relative to the root.
-    LayoutRect absoluteBoundingBox() const;
+    // Pixel snapped bounding box relative to the root.
+    IntRect absoluteBoundingBox() const;
 
     void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (110628 => 110629)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-13 22:51:44 UTC (rev 110628)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-03-13 22:53:35 UTC (rev 110629)
@@ -1610,7 +1610,7 @@
 
     // Fixed position elements that are invisible in the current view don't get their own layer.
     FrameView* frameView = m_renderView->frameView();
-    if (frameView && !layer->absoluteBoundingBox().intersects(LayoutRect(frameView->scrollXForFixedPosition(), frameView->scrollYForFixedPosition(), frameView->layoutWidth(), frameView->layoutHeight())))
+    if (frameView && !layer->absoluteBoundingBox().intersects(IntRect(frameView->scrollXForFixedPosition(), frameView->scrollYForFixedPosition(), frameView->layoutWidth(), frameView->layoutHeight())))
         return false;
 
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to