Title: [107889] trunk/Source/WebCore
Revision
107889
Author
[email protected]
Date
2012-02-15 23:04:15 -0800 (Wed, 15 Feb 2012)

Log Message

Convert RenderFrameSet to LayoutUnits in preparation for turning on subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=78526

Reviewed by Eric Seidel.

Revert paintColumnBorder and paintRowBorder to IntRect and pixel snap in
paint before calling them. This way the rounding logic is contained in a
single place (in paint).

No new tests, no new functionality.

* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
(WebCore::RenderFrameSet::paint):
(WebCore::RenderFrameSet::getCursor):
* rendering/RenderFrameSet.h:
(RenderFrameSet):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107888 => 107889)


--- trunk/Source/WebCore/ChangeLog	2012-02-16 06:47:29 UTC (rev 107888)
+++ trunk/Source/WebCore/ChangeLog	2012-02-16 07:04:15 UTC (rev 107889)
@@ -1,3 +1,24 @@
+2012-02-15  Emil A Eklund  <[email protected]>
+
+        Convert RenderFrameSet to LayoutUnits in preparation for turning on subpixel layout
+        https://bugs.webkit.org/show_bug.cgi?id=78526
+
+        Reviewed by Eric Seidel.
+
+        Revert paintColumnBorder and paintRowBorder to IntRect and pixel snap in
+        paint before calling them. This way the rounding logic is contained in a
+        single place (in paint).
+
+        No new tests, no new functionality.
+
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::paintColumnBorder):
+        (WebCore::RenderFrameSet::paintRowBorder):
+        (WebCore::RenderFrameSet::paint):
+        (WebCore::RenderFrameSet::getCursor):
+        * rendering/RenderFrameSet.h:
+        (RenderFrameSet):
+
 2012-02-15  Emil A Eklund  <[email protected]> and Levi Weintraub  <[email protected]>
 
         Add FractionalLayoutPoint/Size/Rect for sub-pixel layout

Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (107888 => 107889)


--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2012-02-16 06:47:29 UTC (rev 107888)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2012-02-16 07:04:15 UTC (rev 107889)
@@ -80,9 +80,9 @@
     return Color(208, 208, 208);
 }
 
-void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
+void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
 {
-    if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
+    if (!paintInfo.rect.intersects(borderRect))
         return;
         
     // FIXME: We should do something clever when borders from distinct framesets meet at a join.
@@ -100,9 +100,9 @@
     }
 }
 
-void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
+void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
 {
-    if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
+    if (!paintInfo.rect.intersects(borderRect))
         return;
 
     // FIXME: We should do something clever when borders from distinct framesets meet at a join.
@@ -142,7 +142,7 @@
             child->paint(paintInfo, adjustedPaintOffset);
             xPos += m_cols.m_sizes[c];
             if (borderThickness && m_cols.m_allowBorder[c + 1]) {
-                paintColumnBorder(paintInfo, LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffset.y() + yPos, borderThickness, height()));
+                paintColumnBorder(paintInfo, pixelSnappedIntRect(LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffset.y() + yPos, borderThickness, height())));
                 xPos += borderThickness;
             }
             child = child->nextSibling();
@@ -151,7 +151,7 @@
         }
         yPos += m_rows.m_sizes[r];
         if (borderThickness && m_rows.m_allowBorder[r + 1]) {
-            paintRowBorder(paintInfo, LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yPos, width(), borderThickness));
+            paintRowBorder(paintInfo, pixelSnappedIntRect(LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yPos, width(), borderThickness)));
             yPos += borderThickness;
         }
     }
@@ -802,11 +802,12 @@
 
 CursorDirective RenderFrameSet::getCursor(const LayoutPoint& point, Cursor& cursor) const
 {
-    if (canResizeRow(roundedIntPoint(point))) {
+    IntPoint roundedPoint = roundedIntPoint(point);
+    if (canResizeRow(roundedPoint)) {
         cursor = rowResizeCursor();
         return SetCursor;
     }
-    if (canResizeColumn(point)) {
+    if (canResizeColumn(roundedPoint)) {
         cursor = columnResizeCursor();
         return SetCursor;
     }

Modified: trunk/Source/WebCore/rendering/RenderFrameSet.h (107888 => 107889)


--- trunk/Source/WebCore/rendering/RenderFrameSet.h	2012-02-16 06:47:29 UTC (rev 107888)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.h	2012-02-16 07:04:15 UTC (rev 107889)
@@ -68,8 +68,8 @@
     bool isResizingRow() const;
     bool isResizingColumn() const;
 
-    bool canResizeRow(const LayoutPoint&) const;
-    bool canResizeColumn(const LayoutPoint&) const;
+    bool canResizeRow(const IntPoint&) const;
+    bool canResizeColumn(const IntPoint&) const;
 
     void notifyFrameEdgeInfoChanged();
 
@@ -119,8 +119,8 @@
     void startResizing(GridAxis&, int position);
     void continueResizing(GridAxis&, int position);
 
-    void paintRowBorder(const PaintInfo&, const LayoutRect&);
-    void paintColumnBorder(const PaintInfo&, const LayoutRect&);
+    void paintRowBorder(const PaintInfo&, const IntRect&);
+    void paintColumnBorder(const PaintInfo&, const IntRect&);
 
     RenderObjectChildList m_children;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to