Modified: trunk/Source/WebCore/ChangeLog (88195 => 88196)
--- trunk/Source/WebCore/ChangeLog 2011-06-06 22:13:08 UTC (rev 88195)
+++ trunk/Source/WebCore/ChangeLog 2011-06-06 22:27:19 UTC (rev 88196)
@@ -1,3 +1,20 @@
+2011-06-06 Levi Weintraub <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Switch InlineFlowBox::paintMask to use IntPoint
+ https://bugs.webkit.org/show_bug.cgi?id=62156
+
+ Switching InlineFlowBox::paintMask to take an IntPoint representing the paint
+ offset instead of a pair of ints.
+
+ No new tests as this is simple refactoring.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ (WebCore::InlineFlowBox::paintMask):
+ * rendering/InlineFlowBox.h:
+
2011-06-06 Emil A Eklund <[email protected]>
Reviewed by Eric Seidel.
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (88195 => 88196)
--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2011-06-06 22:13:08 UTC (rev 88195)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2011-06-06 22:27:19 UTC (rev 88196)
@@ -991,7 +991,7 @@
paintInfo.outlineObjects->add(inlineFlow);
}
} else if (paintInfo.phase == PaintPhaseMask) {
- paintMask(paintInfo, paintOffset.x(), paintOffset.y());
+ paintMask(paintInfo, paintOffset);
return;
} else {
// Paint our background, border and box-shadow.
@@ -1163,7 +1163,7 @@
}
}
-void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
+void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
{
if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
@@ -1176,8 +1176,7 @@
// Move x/y to our coordinates.
IntRect localRect(frameRect);
flipForWritingMode(localRect);
- tx += localRect.x();
- ty += localRect.y();
+ IntPoint adjustedPaintOffset = paintOffset + localRect.location();
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image();
@@ -1198,7 +1197,7 @@
}
}
- IntRect paintRect = IntRect(IntPoint(tx, ty), frameRect.size());
+ IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size());
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp);
bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom());
@@ -1208,7 +1207,7 @@
// 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(IntPoint(tx, ty), frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(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.
@@ -1218,8 +1217,8 @@
int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
totalLogicalWidth += curr->logicalWidth();
- int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0);
- int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine);
+ 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;
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (88195 => 88196)
--- trunk/Source/WebCore/rendering/InlineFlowBox.h 2011-06-06 22:13:08 UTC (rev 88195)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h 2011-06-06 22:27:19 UTC (rev 88196)
@@ -104,7 +104,7 @@
IntRect roundedFrameRect() const;
virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
- virtual void paintMask(PaintInfo&, int tx, int ty);
+ virtual void paintMask(PaintInfo&, const IntPoint&);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&);