2011-06-02 Levi Weintraub <leviw@chromium.org>
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2011 02:41:09 +0000 (02:41 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2011 02:41:09 +0000 (02:41 +0000)
        Reviewed by Eric Seidel.

        Switch paintReplaced to use IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=61891

        Switching paintReplaced to use IntPoint to represent the paint offset instead
        of a pair of ints.

        Also renaming the IntPoint flavor of IntRect::move to moveBy to clear up the
        fact that the IntPoint is added as an offset as opposed to being relocated
        to that point.

        No tests because this is just a refactoring.

        * page/FrameView.cpp:
        (WebCore::FrameView::invalidateScrollbarRect):
        (WebCore::FrameView::convertFromRenderer):
        (WebCore::FrameView::convertToRenderer):
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::wheelEvent):
        * platform/ScrollbarThemeComposite.cpp:
        (WebCore::ScrollbarThemeComposite::invalidatePart):
        * platform/graphics/gpu/Texture.cpp
        (WebCore::Texture::updateSubRect)
        * platform/graphics/IntRect.h:
        (WebCore::IntRect::moveBy):
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::paint):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::paint):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::logicalRectToPhysicalRect):
        (WebCore::RenderBlock::selectionGaps):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::offsetFromContainer):
        (WebCore::RenderBox::computeRectForRepaint):
        (WebCore::RenderBox::localCaretRect):
        * rendering/RenderDetailsMarker.cpp:
        (WebCore::RenderDetailsMarker::paint):
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::paintReplaced):
        * rendering/RenderEmbeddedObject.h:
        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        * rendering/RenderHTMLCanvas.h:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        * rendering/RenderImage.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
        * rendering/RenderLayer.cpp:
        (WebCore::expandClipRectForDescendantsAndReflection):
        (WebCore::RenderLayer::paintScrollCorner):
        (WebCore::RenderLayer::paintResizer):
        (WebCore::RenderLayer::paintChildLayerIntoColumns):
        (WebCore::RenderLayer::hitTestChildLayerColumns):
        (WebCore::RenderLayer::boundingBox):
        (WebCore::RenderLayer::setBackingNeedsRepaintInRect):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
        (WebCore::paintScrollbar):
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::calculateCompositedBounds):
        (WebCore::RenderLayerCompositor::layerWillBeRemoved):
        (WebCore::paintScrollbar):
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::controlClipRect):
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::positionListMarker):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):
        * rendering/RenderReplaced.h:
        (WebCore::RenderReplaced::paintReplaced):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::computeRectForRepaint):
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::controlClipRect):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::paintReplaced):
        * rendering/RenderVideo.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::repaintViewRectangle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollbarThemeComposite.cpp
Source/WebCore/platform/graphics/IntRect.h
Source/WebCore/platform/graphics/gpu/Texture.cpp
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderEmbeddedObject.h
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderHTMLCanvas.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInputSpeech.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplaced.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderVideo.h
Source/WebCore/rendering/RenderView.cpp

index fe00f3463c3f3fe58dc1b9346580818a621a3922..75758a81c4caec85c5b3bf79440456a070570bab 100644 (file)
@@ -1,3 +1,92 @@
+2011-06-02  Levi Weintraub  <leviw@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintReplaced to use IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=61891
+
+        Switching paintReplaced to use IntPoint to represent the paint offset instead
+        of a pair of ints.
+
+        Also renaming the IntPoint flavor of IntRect::move to moveBy to clear up the
+        fact that the IntPoint is added as an offset as opposed to being relocated
+        to that point.
+
+        No tests because this is just a refactoring.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::invalidateScrollbarRect):
+        (WebCore::FrameView::convertFromRenderer):
+        (WebCore::FrameView::convertToRenderer):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::wheelEvent):
+        * platform/ScrollbarThemeComposite.cpp:
+        (WebCore::ScrollbarThemeComposite::invalidatePart):
+        * platform/graphics/gpu/Texture.cpp
+        (WebCore::Texture::updateSubRect)
+        * platform/graphics/IntRect.h:
+        (WebCore::IntRect::moveBy):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::paint):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paint):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::logicalRectToPhysicalRect):
+        (WebCore::RenderBlock::selectionGaps):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::offsetFromContainer):
+        (WebCore::RenderBox::computeRectForRepaint):
+        (WebCore::RenderBox::localCaretRect):
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::paint):
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::paintReplaced):
+        * rendering/RenderEmbeddedObject.h:
+        * rendering/RenderHTMLCanvas.cpp:
+        (WebCore::RenderHTMLCanvas::paintReplaced):
+        * rendering/RenderHTMLCanvas.h:
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintReplaced):
+        * rendering/RenderImage.h:
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
+        * rendering/RenderLayer.cpp:
+        (WebCore::expandClipRectForDescendantsAndReflection):
+        (WebCore::RenderLayer::paintScrollCorner):
+        (WebCore::RenderLayer::paintResizer):
+        (WebCore::RenderLayer::paintChildLayerIntoColumns):
+        (WebCore::RenderLayer::hitTestChildLayerColumns):
+        (WebCore::RenderLayer::boundingBox):
+        (WebCore::RenderLayer::setBackingNeedsRepaintInRect):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+        (WebCore::paintScrollbar):
+        (WebCore::RenderLayerBacking::paintContents):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::calculateCompositedBounds):
+        (WebCore::RenderLayerCompositor::layerWillBeRemoved):
+        (WebCore::paintScrollbar):
+        (WebCore::RenderLayerCompositor::paintContents):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::controlClipRect):
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::positionListMarker):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderReplaced.h:
+        (WebCore::RenderReplaced::paintReplaced):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::computeRectForRepaint):
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::controlClipRect):
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::paintReplaced):
+        * rendering/RenderVideo.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::repaintViewRectangle):
+
 2011-06-02  James Robinson  <jamesr@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index ef7d21505274e6b6982039cab60e1322e01e99eb..daefd4136dc97ea3dc88238f13dd44f3c5b2ac1a 100644 (file)
@@ -2163,7 +2163,7 @@ void FrameView::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rec
 {
     // Add in our offset within the FrameView.
     IntRect dirtyRect = rect;
-    dirtyRect.move(scrollbar->location());
+    dirtyRect.moveBy(scrollbar->location());
     invalidateRect(dirtyRect);
 }
 
@@ -2627,7 +2627,7 @@ IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRe
     IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox();
 
     // Convert from page ("absolute") to FrameView coordinates.
-    rect.move(-scrollPosition());
+    rect.moveBy(-scrollPosition());
 
     return rect;
 }
@@ -2637,7 +2637,7 @@ IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect
     IntRect rect = viewRect;
     
     // Convert from FrameView coords into page ("absolute") coordinates.
-    rect.move(scrollPosition());
+    rect.moveBy(scrollPosition());
 
     // FIXME: we don't have a way to map an absolute rect down to a local quad, so just
     // move the rect for now.
index 4f47b9489413d17904953b72eee86036649771f3..4f366e5660744f8477860864e3d415a1b7f08756 100644 (file)
@@ -1008,11 +1008,11 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
         GraphicsContextStateSaver stateSaver(*context);
 
         context->translate(x(), y());
-        documentDirtyRect.move(-location());
+        documentDirtyRect.moveBy(-location());
 
         if (!paintsEntireContents()) {
             context->translate(-scrollX(), -scrollY());
-            documentDirtyRect.move(scrollPosition());
+            documentDirtyRect.moveBy(scrollPosition());
 
             context->clip(visibleContentRect());
         }
@@ -1033,7 +1033,7 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
         IntRect scrollViewDirtyRect = rect;
         scrollViewDirtyRect.intersect(frameRect());
         context->translate(x(), y());
-        scrollViewDirtyRect.move(-location());
+        scrollViewDirtyRect.moveBy(-location());
 
         paintScrollbars(context, scrollViewDirtyRect);
     }
@@ -1127,7 +1127,7 @@ IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scroll
 {
     // Scrollbars won't be transformed within us
     IntRect newRect = localRect;
-    newRect.move(scrollbar->location());
+    newRect.moveBy(scrollbar->location());
     return newRect;
 }
 
@@ -1135,7 +1135,7 @@ IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scroll
 {
     IntRect newRect = parentRect;
     // Scrollbars won't be transformed within us
-    newRect.move(-scrollbar->location());
+    newRect.moveBy(-scrollbar->location());
     return newRect;
 }
 
index 688985527c20867226ab02b71171c12c4670aad7..87d5f6cdc4df27f43f56561107751fa78f4fadf7 100644 (file)
@@ -234,7 +234,7 @@ void ScrollbarThemeComposite::invalidatePart(Scrollbar* scrollbar, ScrollbarPart
                 result = thumbRect;
         }
     }
-    result.move(-scrollbar->location());
+    result.moveBy(-scrollbar->location());
     scrollbar->invalidateRect(result);
 }
 
index 360b85667c37a64821bb17e1a74e935a45cbac06..cfb0919e548fc7f24275e6baa8631cce57fc1b77 100644 (file)
@@ -108,7 +108,7 @@ public:
     IntPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); }
 
     void move(const IntSize& size) { m_location += size; } 
-    void move(const IntPoint& offset) { m_location.move(offset.x(), offset.y()); }
+    void moveBy(const IntPoint& offset) { m_location.move(offset.x(), offset.y()); }
     void move(int dx, int dy) { m_location.move(dx, dy); } 
 
     void expand(const IntSize& size) { m_location += size; }
index 602caa0824484a28c70d0d27be68f0c0271887d4..3cfd23086159b3bdf07f30c221c2c5a7a5c2d6d3 100644 (file)
@@ -176,7 +176,7 @@ void Texture::updateSubRect(void* pixels, const IntRect& updateRect)
         updateRectIntersected.intersect(tileBoundsWithBorder);
 
         IntRect dstRect = updateRectIntersected;
-        dstRect.move(-tileBoundsWithBorder.location());
+        dstRect.moveBy(-tileBoundsWithBorder.location());
 
         if (updateRectIntersected.isEmpty())
             continue;
index 62af7baba2d9e13482b06763634cb9926b5e2bf2..f81fe47925fc09251772fdb90ab46e85c058f339 100644 (file)
@@ -248,7 +248,7 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
         CGContextTranslateCTM(context, -transformOrigin.x(), -transformOrigin.y());
 
         IntRect dirtyRect = r;
-        dirtyRect.move(-transformOrigin);
+        dirtyRect.moveBy(-transformOrigin);
         if (![view isFlipped])
             dirtyRect.setY([view bounds].size.height - dirtyRect.maxY());
 
@@ -292,7 +292,7 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
         CGContextScaleCTM(cgContext, 1, -1);
 
         IntRect dirtyRect = r;
-        dirtyRect.move(-transformOrigin);
+        dirtyRect.moveBy(-transformOrigin);
         if (![view isFlipped])
             dirtyRect.setY([view bounds].size.height - dirtyRect.maxY());
 
index cfc9780115f8e82b7d2ea294799a2a17f7742918..8c1e56e8d153165d55917607d8bcea0b3f7cca17 100644 (file)
@@ -951,7 +951,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const IntPoint& paintOffset, int
     IntRect overflowRect(visualOverflowRect(lineTop, lineBottom));
     overflowRect.inflate(renderer()->maximalOutlineSize(paintInfo.phase));
     flipForWritingMode(overflowRect);
-    overflowRect.move(paintOffset);
+    overflowRect.moveBy(paintOffset);
     
     if (!paintInfo.rect.intersects(overflowRect))
         return;
index b6a04555663132dd8dcb18e0bd2c5a2869d547e6..86874b825af5c256262163e92d1aaf23d0b84712 100644 (file)
@@ -2798,7 +2798,7 @@ IntRect RenderBlock::logicalRectToPhysicalRect(const IntPoint& rootBlockPhysical
     else
         result = IntRect(logicalRect.y(), logicalRect.x(), logicalRect.height(), logicalRect.width());
     flipForWritingMode(result);
-    result.move(rootBlockPhysicalPosition);
+    result.moveBy(rootBlockPhysicalPosition);
     return result;
 }
 
@@ -2811,7 +2811,7 @@ GapRects RenderBlock::selectionGaps(RenderBlock* rootBlock, const IntPoint& root
         // Note that we don't clip out overflow for positioned objects.  We just stick to the border box.
         IntRect flippedBlockRect = IntRect(offsetFromRootBlock.width(), offsetFromRootBlock.height(), width(), height());
         rootBlock->flipForWritingMode(flippedBlockRect);
-        flippedBlockRect.move(rootBlockPhysicalPosition);
+        flippedBlockRect.moveBy(rootBlockPhysicalPosition);
         clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), m_positionedObjects.get());
         if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
             for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
index 1ac3043a14e97180e490b143f0f55b2958194546..86e9a1d9939d6dab3444b728ed0170d18dda1c5a 100644 (file)
@@ -1308,7 +1308,7 @@ IntSize RenderBox::offsetFromContainer(RenderObject* o, const IntPoint& point) c
                 IntRect columnRect(frameRect());
                 toRenderBlock(o)->flipForWritingModeIncludingColumns(columnRect);
                 offset += IntSize(columnRect.location().x(), columnRect.location().y());
-                columnRect.move(point);
+                columnRect.moveBy(point);
                 o->adjustForColumns(offset, columnRect.location());
             } else
                 offset += locationOffsetIncludingFlipping();
@@ -1434,7 +1434,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In
             if (style()->position() == RelativePosition && layer())
                 rect.move(layer()->relativePositionOffset());
 
-            rect.move(location());
+            rect.moveBy(location());
             rect.move(layoutState->m_paintOffset);
             if (layoutState->m_clipped)
                 rect.intersect(layoutState->m_clipRect);
@@ -3099,7 +3099,7 @@ IntRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, int* extraWid
         *extraWidthToEndOfLine = x() + width() - rect.maxX();
 
     // Move to local coords
-    rect.move(-location());
+    rect.moveBy(-location());
     return rect;
 }
 
index c8b75358344a372c9c612646864b122aeb13f9b4..954bb59876ec4449c5af52df3dd924b7213d1b93 100644 (file)
@@ -129,7 +129,7 @@ void RenderDetailsMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     IntPoint boxOrigin(tx + x(), ty + y());
     IntRect overflowRect(visualOverflowRect());
-    overflowRect.move(boxOrigin);
+    overflowRect.moveBy(boxOrigin);
     overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
 
     if (!paintInfo.rect.intersects(overflowRect))
index da19bfaa527ee508da7fded04b441ecc3513b8c0..5a2ca9993def2ae893b27eb13da24218eac7c8ef 100644 (file)
@@ -145,7 +145,7 @@ void RenderEmbeddedObject::paint(PaintInfo& paintInfo, int tx, int ty)
     RenderPart::paint(paintInfo, tx, ty);
 }
 
-void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!pluginCrashedOrWasMissing())
         return;
@@ -163,7 +163,7 @@ void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
     Font font;
     TextRun run("");
     float textWidth;
-    if (!getReplacementTextGeometry(tx, ty, contentRect, path, replacementTextRect, font, run, textWidth))
+    if (!getReplacementTextGeometry(paintOffset.x(), paintOffset.y(), contentRect, path, replacementTextRect, font, run, textWidth))
         return;
     
     GraphicsContextStateSaver stateSaver(*context);
index 8d09edea8f5eedb2831c0e81dbf098275cc88b8c..2c31f2d63a1a4688abad455cd01c2c034ad7a23f 100644 (file)
@@ -56,7 +56,7 @@ private:
     virtual const char* renderName() const { return "RenderEmbeddedObject"; }
     virtual bool isEmbeddedObject() const { return true; }
 
-    virtual void paintReplaced(PaintInfo&, int, int);
+    virtual void paintReplaced(PaintInfo&, const IntPoint&);
     virtual void paint(PaintInfo& paintInfo, int, int);
 
 #if USE(ACCELERATED_COMPOSITING)
index 821c5b00463d5c0150c98a3d7ea790c707121d13..2d9d64486db40a4c59e20d04efc702ad009e461a 100644 (file)
@@ -54,10 +54,10 @@ bool RenderHTMLCanvas::requiresLayer() const
     return canvas && canvas->renderingContext() && canvas->renderingContext()->isAccelerated();
 }
 
-void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     IntRect rect = contentBoxRect();
-    rect.move(tx, ty);
+    rect.moveBy(paintOffset);
     bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimizeContrast;
     static_cast<HTMLCanvasElement*>(node())->paint(paintInfo.context, rect, useLowQualityScale);
 }
index 2230b39354be65225a3240e71914ea9f2823e81e..a5084f678d1806e2733c9168a9cb9d59e0f930bd 100644 (file)
@@ -43,7 +43,7 @@ public:
     
 private:
     virtual const char* renderName() const { return "RenderHTMLCanvas"; }
-    virtual void paintReplaced(PaintInfo&, int tx, int ty);
+    virtual void paintReplaced(PaintInfo&, const IntPoint&);
     virtual void intrinsicSizeChanged() { canvasSizeChanged(); }
 };
 
index 1ff240c4511e7f2bd0f3dbc34f0b59ed1b6136e1..76b0c1a1209217496504dc355b021224b8bbdf31 100644 (file)
@@ -228,7 +228,7 @@ void RenderImage::notifyFinished(CachedResource* newImage)
 #endif
 }
 
-void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderImage::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     int cWidth = contentWidth();
     int cHeight = contentHeight();
@@ -248,11 +248,10 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
             context->setStrokeStyle(SolidStroke);
             context->setStrokeColor(Color::lightGray, style()->colorSpace());
             context->setFillColor(Color::transparent, style()->colorSpace());
-            context->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
+            context->drawRect(IntRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight));
 
             bool errorPictureDrawn = false;
-            int imageX = 0;
-            int imageY = 0;
+            IntSize imageOffset;
             // When calculating the usable dimensions, exclude the pixels of
             // the ouline rect so the error image/alt text doesn't draw on it.
             int usableWidth = cWidth - 2;
@@ -268,30 +267,29 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
                 int centerY = (usableHeight - image->height()) / 2;
                 if (centerY < 0)
                     centerY = 0;
-                imageX = leftBorder + leftPad + centerX + 1;
-                imageY = topBorder + topPad + centerY + 1;
-                context->drawImage(image.get(), style()->colorSpace(), IntPoint(tx + imageX, ty + imageY));
+                imageOffset = IntSize(leftBorder + leftPad + centerX + 1, topBorder + topPad + centerY + 1);
+                context->drawImage(image.get(), style()->colorSpace(), paintOffset + imageOffset);
                 errorPictureDrawn = true;
             }
 
             if (!m_altText.isEmpty()) {
                 String text = document()->displayStringModifiedByEncoding(m_altText);
                 context->setFillColor(style()->visitedDependentColor(CSSPropertyColor), style()->colorSpace());
-                int ax = tx + leftBorder + leftPad;
-                int ay = ty + topBorder + topPad;
                 const Font& font = style()->font();
                 const FontMetrics& fontMetrics = font.fontMetrics();
                 int ascent = fontMetrics.ascent();
+                IntPoint altTextOffset = paintOffset;
+                altTextOffset.move(leftBorder + leftPad, topBorder + topPad + ascent);
 
                 // Only draw the alt text if it'll fit within the content box,
                 // and only if it fits above the error image.
                 TextRun textRun = RenderBlock::constructTextRun(this, font, text, style());
                 int textWidth = font.width(textRun);
                 if (errorPictureDrawn) {
-                    if (usableWidth >= textWidth && fontMetrics.height() <= imageY)
-                        context->drawText(font, textRun, IntPoint(ax, ay + ascent));
+                    if (usableWidth >= textWidth && fontMetrics.height() <= imageOffset.height())
+                        context->drawText(font, textRun, altTextOffset);
                 } else if (usableWidth >= textWidth && cHeight >= fontMetrics.height())
-                    context->drawText(font, textRun, IntPoint(ax, ay + ascent));
+                    context->drawText(font, textRun, altTextOffset);
             }
         }
     } else if (m_imageResource->hasImage() && cWidth > 0 && cHeight > 0) {
@@ -301,12 +299,13 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
 
 #if PLATFORM(MAC)
         if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-            paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
+            paintCustomHighlight(toPoint(paintOffset - location()), style()->highlight(), true);
 #endif
 
         IntSize contentSize(cWidth, cHeight);
-        IntRect rect(IntPoint(tx + leftBorder + leftPad, ty + topBorder + topPad), contentSize);
-        paintIntoRect(context, rect);
+        IntPoint contentLocation = paintOffset;
+        contentLocation.move(leftBorder + leftPad, topBorder + topPad);
+        paintIntoRect(context, IntRect(contentLocation, contentSize));
     }
 }
 
index 423ad05b4af81ef4061a16a11cb3169aeae6b843..3adf892b7606a9811f82e7171a4a5303d8a85142 100644 (file)
@@ -76,7 +76,7 @@ private:
     virtual bool isImage() const { return true; }
     virtual bool isRenderImage() const { return true; }
 
-    virtual void paintReplaced(PaintInfo&, int tx, int ty);
+    virtual void paintReplaced(PaintInfo&, const IntPoint&);
 
     virtual int minimumReplacedHeight() const;
 
index 73b9e0757d022a6e9d9fd35cb474566834cc8bdf..9901f7cd2c93b3fdf2334d143f1c453ac3968ec2 100644 (file)
@@ -899,10 +899,10 @@ IntRect RenderInline::culledInlineVisualOverflowBoundingBox() const
             if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) {
                 IntRect logicalRect = currBox->logicalVisualOverflowRectForPropagation(style());
                 if (isHorizontal) {
-                    logicalRect.move(currBox->location());
+                    logicalRect.moveBy(currBox->location());
                     result.uniteIfNonZero(logicalRect);
                 } else {
-                    logicalRect.move(currBox->location());
+                    logicalRect.moveBy(currBox->location());
                     result.uniteIfNonZero(logicalRect.transposedRect());
                 }
             }
index 6c12d2d1e1d8afa49bfd59663b97b0fada3ce136..0f14925bb5dc0d59bca7bb3840111d8f61030028 100644 (file)
@@ -82,7 +82,7 @@ bool RenderInputSpeech::paintInputFieldSpeechButton(RenderObject* object, const
     // Move the rect into partRenderer's coords.
     buttonRect.move(offsetFromInputRenderer);
     // Account for the local drawing offset.
-    buttonRect.move(rect.location());
+    buttonRect.moveBy(rect.location());
 
     DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateNormal, (Image::loadPlatformResource("inputSpeech")));
     DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateRecording, (Image::loadPlatformResource("inputSpeechRecording")));
index 08ab12f12aaca8db6e34108ca388a87daa4bd0ac..0211faa0c6d01e5d114a393107d275548abc8c9d 100644 (file)
@@ -900,7 +900,7 @@ static void expandClipRectForDescendantsAndReflection(IntRect& clipRect, const R
         l->convertToLayerCoords(rootLayer, delta);
         clipRect.move(-delta.x(), -delta.y());
         clipRect.unite(l->renderBox()->reflectedRect(clipRect));
-        clipRect.move(delta);
+        clipRect.moveBy(delta);
     }
 }
 
@@ -2325,7 +2325,7 @@ void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& pa
     ASSERT(box);
 
     IntRect absRect = scrollCornerRect();
-    absRect.move(paintOffset);
+    absRect.moveBy(paintOffset);
     if (!absRect.intersects(damageRect))
         return;
 
@@ -2354,7 +2354,7 @@ void RenderLayer::paintResizer(GraphicsContext* context, const IntPoint& paintOf
     ASSERT(box);
 
     IntRect absRect = resizerCornerRect(this, box->borderBoxRect());
-    absRect.move(paintOffset);
+    absRect.moveBy(paintOffset);
     if (!absRect.intersects(damageRect))
         return;
 
@@ -2772,7 +2772,7 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLaye
         int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
         IntSize offset = isHorizontal ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset);
 
-        colRect.move(layerOffset);
+        colRect.moveBy(layerOffset);
 
         IntRect localDirtyRect(paintDirtyRect);
         localDirtyRect.intersect(colRect);
@@ -3256,7 +3256,7 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
             currLogicalTopOffset -= blockDelta;
         else
             currLogicalTopOffset += blockDelta;
-        colRect.move(layerOffset);
+        colRect.moveBy(layerOffset);
 
         IntRect localClipRect(hitTestRect);
         localClipRect.intersect(colRect);
@@ -3597,7 +3597,7 @@ IntRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer) const
         renderer()->containingBlock()->flipForWritingMode(result);
     IntPoint delta;
     convertToLayerCoords(ancestorLayer, delta);
-    result.move(delta);
+    result.moveBy(delta);
     return result;
 }
 
@@ -3934,7 +3934,7 @@ void RenderLayer::setBackingNeedsRepaintInRect(const IntRect& r)
         IntRect absRect(r);
         IntPoint delta;
         convertToLayerCoords(root(), delta);
-        absRect.move(delta);
+        absRect.moveBy(delta);
 
         RenderView* view = renderer()->view();
         if (view)
index 235972b8f09f961cc181e053717a5d1ae58b6237..95fe041ee12db94276482937d7208f1ee1c0194d 100644 (file)
@@ -357,7 +357,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
     IntRect relativeCompositingBounds(localCompositingBounds);
     IntPoint delta;
     m_owningLayer->convertToLayerCoords(compAncestor, delta);
-    relativeCompositingBounds.move(delta);
+    relativeCompositingBounds.moveBy(delta);
 
     IntPoint graphicsLayerParentLocation;
     if (compAncestor && compAncestor->backing()->hasClippingLayer()) {
@@ -1197,7 +1197,7 @@ static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const
     const IntRect& scrollbarRect = scrollbar->frameRect();
     context.translate(-scrollbarRect.x(), -scrollbarRect.y());
     IntRect transformedClip = clip;
-    transformedClip.move(scrollbarRect.location());
+    transformedClip.moveBy(scrollbarRect.location());
     scrollbar->paint(&context, transformedClip);
     context.restore();
 }
@@ -1231,7 +1231,7 @@ void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, Graph
         context.save();
         context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y());
         IntRect transformedClip = clip;
-        transformedClip.move(scrollCornerAndResizer.location());
+        transformedClip.moveBy(scrollCornerAndResizer.location());
         m_owningLayer->paintScrollCorner(&context, IntPoint(), transformedClip);
         m_owningLayer->paintResizer(&context, IntPoint(), transformedClip);
         context.restore();
index 58d3241ad7525078033e55aa6a45197fb4e64c05..1c1d64699347777b691f81c7461f54673085e14f 100644 (file)
@@ -451,7 +451,7 @@ IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* laye
     if (layer->renderer()->hasOverflowClip() || layer->renderer()->hasMask()) {
         IntPoint ancestorRelOffset;
         layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
-        boundingBoxRect.move(ancestorRelOffset);
+        boundingBoxRect.moveBy(ancestorRelOffset);
         return boundingBoxRect;
     }
 
@@ -505,7 +505,7 @@ IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* laye
 
     IntPoint ancestorRelOffset;
     layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
-    unionBounds.move(ancestorRelOffset);
+    unionBounds.moveBy(ancestorRelOffset);
 
     return unionBounds;
 }
@@ -529,7 +529,7 @@ void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer*
 
         IntPoint offset;
         child->convertToLayerCoords(compLayer, offset);
-        compBounds.move(offset);
+        compBounds.moveBy(offset);
 
         compLayer->setBackingNeedsRepaintInRect(compBounds);
 
@@ -1436,7 +1436,7 @@ static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const
     const IntRect& scrollbarRect = scrollbar->frameRect();
     context.translate(-scrollbarRect.x(), -scrollbarRect.y());
     IntRect transformedClip = clip;
-    transformedClip.move(scrollbarRect.location());
+    transformedClip.moveBy(scrollbarRect.location());
     scrollbar->paint(&context, transformedClip);
     context.restore();
 }
@@ -1452,7 +1452,7 @@ void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gr
         context.save();
         context.translate(-scrollCorner.x(), -scrollCorner.y());
         IntRect transformedClip = clip;
-        transformedClip.move(scrollCorner.location());
+        transformedClip.moveBy(scrollCorner.location());
         m_renderView->frameView()->paintScrollCorner(&context, transformedClip);
         context.restore();
     }
index 690cf037441de8c14983691af8e90aa6d32895cc..e377806808aca1a9ca177c3a8f9a4ec37616513c 100644 (file)
@@ -690,7 +690,7 @@ bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
 IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
 {
     IntRect clipRect = contentBoxRect();
-    clipRect.move(additionalOffset);
+    clipRect.moveBy(additionalOffset);
     return clipRect;
 }
 
index ab4b515260dfeb00421d942e466146f9702e2a4d..c1c09b8e2a996ce87ccb2ac32c637d8daa5eb8eb 100644 (file)
@@ -338,7 +338,7 @@ void RenderListItem::positionListMarker()
                     propagateLayoutOverflow = false;
                 if (o->hasSelfPaintingLayer())
                     propagateVisualOverflow = false;
-                markerRect.move(-o->location());
+                markerRect.moveBy(-o->location());
             } while (o != this && propagateVisualOverflow && propagateLayoutOverflow);
         }
     }
index 0ddd95431fed1023d1b8a78d85c85c326cd26c97..a939d0f7b159a5bf28ba7cad417cd0d1025a1b03 100644 (file)
@@ -1111,7 +1111,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     IntPoint boxOrigin(tx + x(), ty + y());
     IntRect overflowRect(visualOverflowRect());
-    overflowRect.move(boxOrigin);
+    overflowRect.moveBy(boxOrigin);
     overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
 
     if (!paintInfo.rect.intersects(overflowRect))
@@ -1120,7 +1120,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
     IntRect box(boxOrigin, IntSize(width(), height()));
     
     IntRect marker = getRelativeMarkerRect();
-    marker.move(boxOrigin);
+    marker.moveBy(boxOrigin);
 
     GraphicsContext* context = paintInfo.context;
 
@@ -1132,7 +1132,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
         context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker);
         if (selectionState() != SelectionNone) {
             IntRect selRect = localSelectionRect();
-            selRect.move(boxOrigin);
+            selRect.moveBy(boxOrigin);
             context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
         }
         return;
@@ -1146,7 +1146,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     if (selectionState() != SelectionNone) {
         IntRect selRect = localSelectionRect();
-        selRect.move(boxOrigin);
+        selRect.moveBy(boxOrigin);
         context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
     }
 
@@ -1257,7 +1257,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     GraphicsContextStateSaver stateSaver(*context, false);
     if (!style()->isHorizontalWritingMode()) {
-        marker.move(-boxOrigin);
+        marker.moveBy(-boxOrigin);
         marker = marker.transposedRect();
         marker.move(box.x(), box.y() - logicalHeight());
         stateSaver.save();
index 4f5e7bcc4e3388578a8e347004bd436aafe511d4..2e23823d5989186c7aa5b8a8afd0af2789577fa9 100644 (file)
@@ -141,7 +141,7 @@ void RenderReplaced::paint(PaintInfo& paintInfo, int tx, int ty)
     }
 
     if (!completelyClippedOut) {
-        paintReplaced(paintInfo, tx, ty);
+        paintReplaced(paintInfo, IntPoint(tx, ty));
 
         if (style()->hasBorderRadius())
             paintInfo.context->restore();
index d6ebba664224ba9c2fd8dd23e6737860d989cd6e..857adb4678c3bb0bb137ac2792a78a0b2ca63b44 100644 (file)
@@ -65,7 +65,7 @@ private:
     int calcAspectRatioLogicalWidth() const;
     int calcAspectRatioLogicalHeight() const;
 
-    virtual void paintReplaced(PaintInfo&, int /*tx*/, int /*ty*/) { }
+    virtual void paintReplaced(PaintInfo&, const IntPoint&) { }
 
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
 
index 0df1d80a18e6319078277798a7872a364acb5710..22398b3c2015acfcbac79120264fae6a67cbea19 100644 (file)
@@ -294,7 +294,7 @@ void RenderTableCell::computeRectForRepaint(RenderBoxModelObject* repaintContain
     r.setY(r.y());
     RenderView* v = view();
     if ((!v || !v->layoutStateEnabled() || repaintContainer) && parent())
-        r.move(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in.
+        r.moveBy(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in.
     RenderBlock::computeRectForRepaint(repaintContainer, r, fixed);
 }
 
index 51b645276e0699b4eab08858888506561dc4743a..1c258619ab375f7ca43a421f3452386d1cedebcb 100644 (file)
@@ -488,7 +488,7 @@ IntRect RenderTextControlSingleLine::controlClipRect(const IntPoint& additionalO
     ASSERT(hasControlClip());
 
     IntRect clipRect = IntRect(innerBlockElement()->renderBox()->frameRect());
-    clipRect.move(additionalOffset);
+    clipRect.moveBy(additionalOffset);
     return clipRect;
 }
 
index 3a96ef8832872fda542403fee4fd31472d39c940..4c1d7c402995333cf878bed94cca0c3e491180e2 100644 (file)
@@ -184,7 +184,7 @@ bool RenderVideo::shouldDisplayVideo() const
     return !videoElement()->shouldDisplayPosterImage();
 }
 
-void RenderVideo::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderVideo::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     MediaPlayer* mediaPlayer = mediaElement()->player();
     bool displayingPoster = videoElement()->shouldDisplayPosterImage();
@@ -198,7 +198,7 @@ void RenderVideo::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
     IntRect rect = videoBox();
     if (rect.isEmpty())
         return;
-    rect.move(tx, ty);
+    rect.moveBy(paintOffset);
 
     if (displayingPoster)
         paintIntoRect(paintInfo.context, rect);
index 9091490a4bba374b32cfa81de13e99bfbb0cc32f..4379f58c87d347cf4115e429b7726598d4ff979b 100644 (file)
@@ -66,7 +66,7 @@ private:
     virtual bool requiresLayer() const { return true; }
     virtual bool isVideo() const { return true; }
 
-    virtual void paintReplaced(PaintInfo&, int tx, int ty);
+    virtual void paintReplaced(PaintInfo&, const IntPoint&);
 
     virtual void layout();
 
index 779f2a68de78af8a5994431c1e4ad4833a60bebe..095b656416f6679e079c86a0dc1fc86074b490fa 100644 (file)
@@ -273,7 +273,7 @@ void RenderView::repaintViewRectangle(const IntRect& ur, bool immediate)
         
         // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
         // rectangle.
-        r.move(-vr.location());
+        r.moveBy(-vr.location());
         
         // FIXME: Hardcoded offsets here are not good.
         r.move(obj->borderLeft() + obj->paddingLeft(),