Title: [91417] trunk/Source/WebCore
Revision
91417
Author
[email protected]
Date
2011-07-20 16:18:27 -0700 (Wed, 20 Jul 2011)

Log Message

Bring Int/Float graphics classes closer to parity
https://bugs.webkit.org/show_bug.cgi?id=64833

Reviewed by James Robinson.

In preparation of switching to Floating point data structures, bringing the
functionality and method names of the Int/Float graphics classes close together.

Also fixing some compiler errors when using Floats for layout units along the way.

No new tests, no functionality change.

* page/FrameView.cpp:
(WebCore::FrameView::convertFromRenderer):
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/ScrollView.h:
(WebCore::ScrollView::convertChildToSelf):
(WebCore::ScrollView::convertSelfToChild):
* platform/graphics/FloatPoint.h:
(WebCore::operator-): Adding a single-parameter version.
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::isZero): Adding isZero that uses epsilon for floats.
* platform/graphics/FloatSize.h:
* platform/graphics/IntPoint.h:
(WebCore::IntPoint::moveBy): Renaming IntPoint version to moveBy to mirror FloatPoint.
* platform/graphics/RoundedRect.cpp:
(WebCore::RoundedRect::Radii::expand): Switching to specific templatized max.
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::requestedRegionOfInputImageData):
* rendering/RenderBlock.cpp: Moving outstanding Int* functions to Layout units.
(WebCore::RenderBlock::paintContinuationOutlines):
(WebCore::RenderBlock::logicalRectToPhysicalRect):
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionForPoint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::subtractCaptionRect):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::styleOrColLogicalWidth):
(WebCore::RenderTableCell::setOverrideSizeFromRowHeight):
(WebCore::RenderTableCell::paintCollapsedBorder):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableCell.h:
* rendering/RenderView.h:
(WebCore::RenderView::pushLayoutState):
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::paddedLayoutOverflowRect):
(WebCore::setAscentAndDescent):
* rendering/RootInlineBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91416 => 91417)


--- trunk/Source/WebCore/ChangeLog	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/ChangeLog	2011-07-20 23:18:27 UTC (rev 91417)
@@ -1,3 +1,59 @@
+2011-07-20  Levi Weintraub  <[email protected]>
+
+        Bring Int/Float graphics classes closer to parity
+        https://bugs.webkit.org/show_bug.cgi?id=64833
+
+        Reviewed by James Robinson.
+
+        In preparation of switching to Floating point data structures, bringing the
+        functionality and method names of the Int/Float graphics classes close together.
+
+        Also fixing some compiler errors when using Floats for layout units along the way.
+
+        No new tests, no functionality change.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::convertFromRenderer):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::wheelEvent):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::convertChildToSelf):
+        (WebCore::ScrollView::convertSelfToChild):
+        * platform/graphics/FloatPoint.h:
+        (WebCore::operator-): Adding a single-parameter version.
+        * platform/graphics/FloatSize.cpp:
+        (WebCore::FloatSize::isZero): Adding isZero that uses epsilon for floats.
+        * platform/graphics/FloatSize.h:
+        * platform/graphics/IntPoint.h:
+        (WebCore::IntPoint::moveBy): Renaming IntPoint version to moveBy to mirror FloatPoint.
+        * platform/graphics/RoundedRect.cpp:
+        (WebCore::RoundedRect::Radii::expand): Switching to specific templatized max.
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::requestedRegionOfInputImageData):
+        * rendering/RenderBlock.cpp: Moving outstanding Int* functions to Layout units.
+        (WebCore::RenderBlock::paintContinuationOutlines):
+        (WebCore::RenderBlock::logicalRectToPhysicalRect):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::positionForPoint):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::subtractCaptionRect):
+        * rendering/RenderTable.h:
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::styleOrColLogicalWidth):
+        (WebCore::RenderTableCell::setOverrideSizeFromRowHeight):
+        (WebCore::RenderTableCell::paintCollapsedBorder):
+        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+        * rendering/RenderTableCell.h:
+        * rendering/RenderView.h:
+        (WebCore::RenderView::pushLayoutState):
+        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
+        (WebCore::LayoutStateMaintainer::push):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::paddedLayoutOverflowRect):
+        (WebCore::setAscentAndDescent):
+        * rendering/RootInlineBox.h:
+
 2011-07-20  Scott Graham  <[email protected]>
 
         mouseover reporting incorrect mouse button, when the button isn't

Modified: trunk/Source/WebCore/page/FrameView.cpp (91416 => 91417)


--- trunk/Source/WebCore/page/FrameView.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/page/FrameView.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -2703,7 +2703,7 @@
     IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, false, true /* use transforms */));
 
     // Convert from page ("absolute") to FrameView coordinates.
-    point.move(-scrollPosition());
+    point.moveBy(-scrollPosition());
     return point;
 }
 

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (91416 => 91417)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -1142,7 +1142,7 @@
 {
     // Scrollbars won't be transformed within us
     IntPoint newPoint = localPoint;
-    newPoint.move(scrollbar->location());
+    newPoint.moveBy(scrollbar->location());
     return newPoint;
 }
 
@@ -1150,7 +1150,7 @@
 {
     IntPoint newPoint = parentPoint;
     // Scrollbars won't be transformed within us
-    newPoint.move(-scrollbar->location());
+    newPoint.moveBy(-scrollbar->location());
     return newPoint;
 }
 

Modified: trunk/Source/WebCore/platform/ScrollView.h (91416 => 91417)


--- trunk/Source/WebCore/platform/ScrollView.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/ScrollView.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -243,7 +243,7 @@
         IntPoint newPoint = point;
         if (!isScrollViewScrollbar(child))
             newPoint = point - scrollOffset();
-        newPoint.move(child->location());
+        newPoint.moveBy(child->location());
         return newPoint;
     }
 
@@ -252,7 +252,7 @@
         IntPoint newPoint = point;
         if (!isScrollViewScrollbar(child))
             newPoint = point + scrollOffset();
-        newPoint.move(-child->location());
+        newPoint.moveBy(-child->location());
         return newPoint;
     }
 

Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/FloatPoint.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -212,6 +212,11 @@
     return FloatPoint(a.x() - b.width(), a.y() - b.height());
 }
 
+inline FloatPoint operator-(const FloatPoint& a)
+{
+    return FloatPoint(-a.x(), -a.y());
+}
+
 inline bool operator==(const FloatPoint& a, const FloatPoint& b)
 {
     return a.x() == b.x() && a.y() == b.y();

Modified: trunk/Source/WebCore/platform/graphics/FloatSize.cpp (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/FloatSize.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -29,8 +29,11 @@
 
 #include "FloatConversion.h"
 #include "IntSize.h"
+#include <limits>
 #include <math.h>
 
+using namespace std;
+
 namespace WebCore {
 
 FloatSize::FloatSize(const IntSize& size) : m_width(size.width()), m_height(size.height())
@@ -42,6 +45,11 @@
     return sqrtf(diagonalLengthSquared());
 }
 
+bool FloatSize::isZero() const
+{
+    return fabs(m_width) < numeric_limits<float>::epsilon() && fabs(m_height) < numeric_limits<float>::epsilon();
+}
+
 FloatSize FloatSize::narrowPrecision(double width, double height)
 {
     return FloatSize(narrowPrecisionToFloat(width), narrowPrecisionToFloat(height));

Modified: trunk/Source/WebCore/platform/graphics/FloatSize.h (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/FloatSize.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -62,6 +62,7 @@
     void setHeight(float height) { m_height = height; }
 
     bool isEmpty() const { return m_width <= 0 || m_height <= 0; }
+    bool isZero() const;
 
     float aspectRatio() const { return m_width / m_height; }
 

Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/IntPoint.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -91,7 +91,7 @@
     void setY(int y) { m_y = y; }
 
     void move(const IntSize& s) { move(s.width(), s.height()); } 
-    void move(const IntPoint& offset) { move(offset.x(), offset.y()); }
+    void moveBy(const IntPoint& offset) { move(offset.x(), offset.y()); }
     void move(int dx, int dy) { m_x += dx; m_y += dy; }
     void scale(float sx, float sy)
     {

Modified: trunk/Source/WebCore/platform/graphics/RoundedRect.cpp (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/RoundedRect.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/RoundedRect.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -61,17 +61,17 @@
 
 void RoundedRect::Radii::expand(LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth)
 {
-    m_topLeft.setWidth(max(0, m_topLeft.width() + leftWidth));
-    m_topLeft.setHeight(max(0, m_topLeft.height() + topWidth));
+    m_topLeft.setWidth(max<LayoutUnit>(0, m_topLeft.width() + leftWidth));
+    m_topLeft.setHeight(max<LayoutUnit>(0, m_topLeft.height() + topWidth));
 
-    m_topRight.setWidth(max(0, m_topRight.width() + rightWidth));
-    m_topRight.setHeight(max(0, m_topRight.height() + topWidth));
+    m_topRight.setWidth(max<LayoutUnit>(0, m_topRight.width() + rightWidth));
+    m_topRight.setHeight(max<LayoutUnit>(0, m_topRight.height() + topWidth));
 
-    m_bottomLeft.setWidth(max(0, m_bottomLeft.width() + leftWidth));
-    m_bottomLeft.setHeight(max(0, m_bottomLeft.height() + bottomWidth));
+    m_bottomLeft.setWidth(max<LayoutUnit>(0, m_bottomLeft.width() + leftWidth));
+    m_bottomLeft.setHeight(max<LayoutUnit>(0, m_bottomLeft.height() + bottomWidth));
 
-    m_bottomRight.setWidth(max(0, m_bottomRight.width() + rightWidth));
-    m_bottomRight.setHeight(max(0, m_bottomRight.height() + bottomWidth));
+    m_bottomRight.setWidth(max<LayoutUnit>(0, m_bottomRight.width() + rightWidth));
+    m_bottomRight.setHeight(max<LayoutUnit>(0, m_bottomRight.height() + bottomWidth));
 }
 
 void RoundedRect::inflateWithRadii(LayoutUnit size)

Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (91416 => 91417)


--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -69,7 +69,7 @@
 {
     ASSERT(hasResult());
     IntPoint location = m_absolutePaintRect.location();
-    location.move(-effectRect.location());
+    location.moveBy(-effectRect.location());
     return IntRect(location, m_absolutePaintRect.size());
 }
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -2701,7 +2701,7 @@
         RenderInline* flow = *it;
         RenderBlock* block = flow->containingBlock();
         for ( ; block && block != this; block = block->containingBlock())
-            accumulatedPaintOffset.move(block->location());
+            accumulatedPaintOffset.moveBy(block->location());
         ASSERT(block);   
         flow->paintOutline(info.context, accumulatedPaintOffset);
     }
@@ -2807,13 +2807,13 @@
     return rootBlock->isHorizontalWritingMode() ? offsetFromRootBlock.width() : offsetFromRootBlock.height();
 }
 
-IntRect RenderBlock::logicalRectToPhysicalRect(const IntPoint& rootBlockPhysicalPosition, const IntRect& logicalRect)
+LayoutRect RenderBlock::logicalRectToPhysicalRect(const LayoutPoint& rootBlockPhysicalPosition, const LayoutRect& logicalRect)
 {
-    IntRect result;
+    LayoutRect result;
     if (isHorizontalWritingMode())
         result = logicalRect;
     else
-        result = IntRect(logicalRect.y(), logicalRect.x(), logicalRect.height(), logicalRect.width());
+        result = LayoutRect(logicalRect.y(), logicalRect.x(), logicalRect.height(), logicalRect.width());
     flipForWritingMode(result);
     result.moveBy(rootBlockPhysicalPosition);
     return result;

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -141,7 +141,7 @@
     LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
                                         RenderObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*);
     void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);
-    IntRect logicalRectToPhysicalRect(const IntPoint& physicalPosition, const IntRect& logicalRect);
+    LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, const LayoutRect& logicalRect);
         
     // Helper methods for computing line counts and heights for line counts.
     RootInlineBox* lineAtIndex(int);

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -3120,7 +3120,7 @@
     RenderBox* closestRenderer = 0;
     LayoutPoint adjustedPoint = point;
     if (isTableRow())
-        adjustedPoint.move(location());
+        adjustedPoint.moveBy(location());
 
     for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject->nextSibling()) {
         if ((!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isBlockFlow() )

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -531,12 +531,12 @@
         paintOutline(paintInfo.context, LayoutRect(paintOffset, size()));
 }
 
-void RenderTable::subtractCaptionRect(IntRect& rect) const
+void RenderTable::subtractCaptionRect(LayoutRect& rect) const
 {
     if (!m_caption)
         return;
 
-    int captionLogicalHeight = m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter();
+    LayoutUnit captionLogicalHeight = m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter();
     bool captionIsBefore = (m_caption->style()->captionSide() != CAPBOTTOM) ^ style()->isFlippedBlocksWritingMode();
     if (style()->isHorizontalWritingMode()) {
         rect.setHeight(rect.height() - captionLogicalHeight);

Modified: trunk/Source/WebCore/rendering/RenderTable.h (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderTable.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderTable.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -216,8 +216,8 @@
 
     virtual void paint(PaintInfo&, const LayoutPoint&);
     virtual void paintObject(PaintInfo&, const LayoutPoint&);
-    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
-    virtual void paintMask(PaintInfo&, const IntPoint&);
+    virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
+    virtual void paintMask(PaintInfo&, const LayoutPoint&);
     virtual void layout();
     virtual void computePreferredLogicalWidths();
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
@@ -235,7 +235,7 @@
 
     virtual void addOverflowFromChildren();
 
-    void subtractCaptionRect(IntRect&) const;
+    void subtractCaptionRect(LayoutRect&) const;
 
     void recalcCaption(RenderBlock*) const;
     void recalcSections() const;

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -115,7 +115,7 @@
         // Percentages don't need to be handled since they're always treated this way (even when specified on the cells).
         // See Bugzilla bug 8126 for details.
         if (colWidthSum.isFixed() && colWidthSum.value() > 0)
-            colWidthSum = Length(max(0, colWidthSum.value() - borderAndPaddingLogicalWidth()), Fixed);
+            colWidthSum = Length(max<LayoutUnit>(0, colWidthSum.value() - borderAndPaddingLogicalWidth()), Fixed);
         return colWidthSum;
     }
 
@@ -215,7 +215,7 @@
 void RenderTableCell::setOverrideSizeFromRowHeight(int rowHeight)
 {
     clearIntrinsicPadding();
-    RenderBlock::setOverrideSize(LayoutSize(0, max(0, rowHeight - borderBefore() - paddingBefore() - borderAfter() - paddingAfter())));
+    RenderBlock::setOverrideSize(LayoutSize(0, max<LayoutUnit>(0, rowHeight - borderBefore() - paddingBefore() - borderAfter() - paddingAfter())));
 }
 
 LayoutSize RenderTableCell::offsetFromContainer(RenderObject* o, const LayoutPoint& point) const
@@ -912,7 +912,7 @@
         compareBorderStylesForQSort);
 }
 
-void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, const IntRect& paintRect)
+void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, const LayoutRect& paintRect)
 {
     if (!table()->currentBorderStyle() || graphicsContext->paintingDisabled())
         return;
@@ -978,7 +978,7 @@
 
     LayoutPoint adjustedPaintOffset = paintOffset;
     if (backgroundObject != this)
-        adjustedPaintOffset.move(location());
+        adjustedPaintOffset.moveBy(location());
 
     Color c = backgroundObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
     const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers();

Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderTableCell.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -96,7 +96,7 @@
 
     virtual void paint(PaintInfo&, const LayoutPoint&);
 
-    void paintBackgroundsBehindCell(PaintInfo&, const IntPoint&, RenderObject* backgroundObject);
+    void paintBackgroundsBehindCell(PaintInfo&, const LayoutPoint&, RenderObject* backgroundObject);
 
     int cellBaselinePosition() const;
 
@@ -150,7 +150,7 @@
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
 
-    void paintCollapsedBorder(GraphicsContext*, const IntRect&);
+    void paintCollapsedBorder(GraphicsContext*, const LayoutRect&);
 
     int m_row;
     int m_column;

Modified: trunk/Source/WebCore/rendering/RenderView.h (91416 => 91417)


--- trunk/Source/WebCore/rendering/RenderView.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RenderView.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -173,7 +173,7 @@
     virtual RenderBlock* containingBlock() const;
 
     // These functions may only be accessed by LayoutStateMaintainer.
-    bool pushLayoutState(RenderBox* renderer, const IntSize& offset, int pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
+    bool pushLayoutState(RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
     {
         // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
         if (!doingFullRepaint() || renderer->hasColumns() || m_layoutState->isPaginated()) {
@@ -266,7 +266,7 @@
     WTF_MAKE_NONCOPYABLE(LayoutStateMaintainer);
 public:
     // ctor to push now
-    LayoutStateMaintainer(RenderView* view, RenderBox* root, IntSize offset, bool disableState = false, int pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
+    LayoutStateMaintainer(RenderView* view, RenderBox* root, LayoutSize offset, bool disableState = false, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
         : m_view(view)
         , m_disabled(disableState)
         , m_didStart(false)
@@ -291,7 +291,7 @@
         ASSERT(m_didStart == m_didEnd);   // if this fires, it means that someone did a push(), but forgot to pop().
     }
 
-    void push(RenderBox* root, IntSize offset, int pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
+    void push(RenderBox* root, LayoutSize offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0)
     {
         ASSERT(!m_didStart);
         // We push state even if disabled, because we still need to store layoutDelta

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (91416 => 91417)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-07-20 23:18:27 UTC (rev 91417)
@@ -532,28 +532,29 @@
     block()->lineBoxes()->attachLineBox(this);
 }
 
-IntRect RootInlineBox::paddedLayoutOverflowRect(int endPadding) const
+LayoutRect RootInlineBox::paddedLayoutOverflowRect(LayoutUnit endPadding) const
 {
-    IntRect lineLayoutOverflow = layoutOverflowRect(lineTop(), lineBottom());
+    LayoutRect lineLayoutOverflow = layoutOverflowRect(lineTop(), lineBottom());
     if (!endPadding)
         return lineLayoutOverflow;
     
+    // FIXME: Audit whether to use pixel snapped values when not using integers for layout: https://bugs.webkit.org/show_bug.cgi?id=63656
     if (isHorizontal()) {
         if (isLeftToRightDirection())
-            lineLayoutOverflow.shiftMaxXEdgeTo(max(lineLayoutOverflow.maxX(), pixelSnappedLogicalRight() + endPadding));
+            lineLayoutOverflow.shiftMaxXEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxX(), pixelSnappedLogicalRight() + endPadding));
         else
-            lineLayoutOverflow.shiftXEdgeTo(min(lineLayoutOverflow.x(), pixelSnappedLogicalLeft() - endPadding));
+            lineLayoutOverflow.shiftXEdgeTo(min<LayoutUnit>(lineLayoutOverflow.x(), pixelSnappedLogicalLeft() - endPadding));
     } else {
         if (isLeftToRightDirection())
-            lineLayoutOverflow.shiftMaxYEdgeTo(max(lineLayoutOverflow.maxY(), pixelSnappedLogicalRight() + endPadding));
+            lineLayoutOverflow.shiftMaxYEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxY(), pixelSnappedLogicalRight() + endPadding));
         else
-            lineLayoutOverflow.shiftYEdgeTo(min(lineLayoutOverflow.y(), pixelSnappedLogicalLeft() - endPadding));
+            lineLayoutOverflow.shiftYEdgeTo(min<LayoutUnit>(lineLayoutOverflow.y(), pixelSnappedLogicalLeft() - endPadding));
     }
     
     return lineLayoutOverflow;
 }
 
-static void setAscentAndDescent(int& ascent, int& descent, int newAscent, int newDescent, bool& ascentDescentSet)
+static void setAscentAndDescent(LayoutUnit& ascent, LayoutUnit& descent, LayoutUnit newAscent, LayoutUnit newDescent, bool& ascentDescentSet)
 {
     if (!ascentDescentSet) {
         ascentDescentSet = true;

Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (91416 => 91417)


--- trunk/Source/WebCore/rendering/RootInlineBox.h	2011-07-20 23:15:31 UTC (rev 91416)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h	2011-07-20 23:18:27 UTC (rev 91417)
@@ -138,7 +138,7 @@
     bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; }
     bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; }
 
-    IntRect paddedLayoutOverflowRect(int endPadding) const;
+    LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const;
 
     void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, LayoutUnit& ascent, LayoutUnit& descent, bool& affectsAscent, bool& affectsDescent) const;
     LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to