Diff
Modified: trunk/Source/WebCore/ChangeLog (89973 => 89974)
--- trunk/Source/WebCore/ChangeLog 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/ChangeLog 2011-06-28 23:36:28 UTC (rev 89974)
@@ -2,6 +2,34 @@
Reviewed by Eric Seidel.
+ Switch PaintMask* to new layout types
+ https://bugs.webkit.org/show_bug.cgi?id=63576
+
+ Switching paintMask* to layout type abstraction from more integral types.
+
+ No new tests as this is just moving to an abstraction.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintMask):
+ * rendering/InlineFlowBox.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintMask):
+ (WebCore::RenderBox::paintMaskImages):
+ * rendering/RenderBox.h:
+ * rendering/RenderFieldset.cpp:
+ (WebCore::RenderFieldset::paintMask):
+ * rendering/RenderFieldset.h:
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::paintMask):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::paintMask):
+ * rendering/RenderTableCell.h:
+
+2011-06-28 Levi Weintraub <[email protected]>
+
+ Reviewed by Eric Seidel.
+
Switch paintFillLayer* to new layout types
https://bugs.webkit.org/show_bug.cgi?id=63570
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (89973 => 89974)
--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2011-06-28 23:36:28 UTC (rev 89974)
@@ -1163,20 +1163,20 @@
}
}
-void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
+void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
// Pixel snap mask painting.
- IntRect frameRect = roundedFrameRect();
+ LayoutRect frameRect = roundedFrameRect();
constrainToLineTopAndBottomIfNeeded(frameRect);
// Move x/y to our coordinates.
- IntRect localRect(frameRect);
+ LayoutRect localRect(frameRect);
flipForWritingMode(localRect);
- IntPoint adjustedPaintOffset = paintOffset + localRect.location();
+ LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image();
@@ -1197,7 +1197,7 @@
}
}
- IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size());
+ LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp);
bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom());
@@ -1207,24 +1207,24 @@
// The simple case is where we are the only box for this object. In those
// cases only a single call to draw is required.
if (!prevLineBox() && !nextLineBox()) {
- boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
} else {
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
- int logicalOffsetOnLine = 0;
+ LayoutUnit logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
logicalOffsetOnLine += curr->logicalWidth();
- int totalLogicalWidth = logicalOffsetOnLine;
+ LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
totalLogicalWidth += curr->logicalWidth();
- int stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
- int stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
- int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
- int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
+ LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
+ LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
+ LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
+ LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->clip(paintRect);
- boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);
}
if (pushTransparencyLayer)
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (89973 => 89974)
--- trunk/Source/WebCore/rendering/InlineFlowBox.h 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h 2011-06-28 23:36:28 UTC (rev 89974)
@@ -104,7 +104,7 @@
IntRect roundedFrameRect() const;
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, const IntPoint&);
+ virtual void paintMask(PaintInfo&, const LayoutPoint&);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&);
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-28 23:36:28 UTC (rev 89974)
@@ -878,12 +878,12 @@
paintInfo.context->endTransparencyLayer();
}
-void RenderBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
+void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
return;
- IntRect paintRect = IntRect(paintOffset, size());
+ LayoutRect paintRect = LayoutRect(paintOffset, size());
// border-fit can adjust where we paint our border and background. If set, we snugly fit our line box descendants. (The iChat
// balloon layout is an example of this).
@@ -892,7 +892,7 @@
paintMaskImages(paintInfo, paintRect);
}
-void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const IntRect& paintRect)
+void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
{
// Figure out if we need to push a transparency layer to render our mask.
bool pushTransparencyLayer = false;
Modified: trunk/Source/WebCore/rendering/RenderBox.h (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-06-28 23:36:28 UTC (rev 89974)
@@ -354,7 +354,7 @@
virtual void paintObject(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, const IntPoint&);
+ virtual void paintMask(PaintInfo&, const LayoutPoint&);
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
// Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted
@@ -420,7 +420,7 @@
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
- void paintMaskImages(const PaintInfo&, const IntRect&);
+ void paintMaskImages(const PaintInfo&, const LayoutRect&);
#if PLATFORM(MAC)
void paintCustomHighlight(const IntPoint&, const AtomicString& type, bool behindText);
Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderFieldset.cpp 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp 2011-06-28 23:36:28 UTC (rev 89974)
@@ -168,12 +168,12 @@
paintBorder(paintInfo.context, paintRect, style());
}
-void RenderFieldset::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
+void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
- IntRect paintRect = IntRect(paintOffset, size());
+ LayoutRect paintRect = LayoutRect(paintOffset, size());
RenderBox* legend = findLegend();
if (!legend)
return RenderBlock::paintMask(paintInfo, paintOffset);
@@ -182,11 +182,11 @@
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
if (style()->isHorizontalWritingMode()) {
- int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
+ LayoutUnit yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
paintRect.expand(0, -yOff);
paintRect.move(0, yOff);
} else {
- int xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
+ LayoutUnit xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
paintRect.expand(-xOff, 0);
paintRect.move(xOff, 0);
}
Modified: trunk/Source/WebCore/rendering/RenderFieldset.h (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderFieldset.h 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderFieldset.h 2011-06-28 23:36:28 UTC (rev 89974)
@@ -45,7 +45,7 @@
virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true; }
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, const IntPoint&);
+ virtual void paintMask(PaintInfo&, const LayoutPoint&);
};
inline RenderFieldset* toRenderFieldset(RenderObject* object)
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2011-06-28 23:36:28 UTC (rev 89974)
@@ -572,12 +572,12 @@
paintBorder(paintInfo.context, rect, style());
}
-void RenderTable::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
+void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
- IntRect rect(paintOffset, size());
+ LayoutRect rect(paintOffset, size());
subtractCaptionRect(rect);
paintMaskImages(paintInfo, rect);
Modified: trunk/Source/WebCore/rendering/RenderTable.h (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderTable.h 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderTable.h 2011-06-28 23:36:28 UTC (rev 89974)
@@ -217,7 +217,7 @@
virtual void paint(PaintInfo&, const IntPoint&);
virtual void paintObject(PaintInfo&, const IntPoint&);
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, const IntPoint&);
+ virtual void paintMask(PaintInfo&, const LayoutPoint&);
virtual void layout();
virtual void computePreferredLogicalWidths();
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2011-06-28 23:36:28 UTC (rev 89974)
@@ -1019,7 +1019,7 @@
paintBorder(paintInfo.context, paintRect, style());
}
-void RenderTableCell::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
+void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
@@ -1028,7 +1028,7 @@
if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
return;
- paintMaskImages(paintInfo, IntRect(paintOffset, size()));
+ paintMaskImages(paintInfo, LayoutRect(paintOffset, size()));
}
void RenderTableCell::scrollbarsChanged(bool horizontalScrollbarChanged, bool verticalScrollbarChanged)
Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (89973 => 89974)
--- trunk/Source/WebCore/rendering/RenderTableCell.h 2011-06-28 23:26:54 UTC (rev 89973)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h 2011-06-28 23:36:28 UTC (rev 89974)
@@ -143,7 +143,7 @@
virtual void computeLogicalWidth();
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, const IntPoint&);
+ virtual void paintMask(PaintInfo&, const LayoutPoint&);
virtual IntSize offsetFromContainer(RenderObject*, const IntPoint&) const;
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);