2011-06-06 Emil A Eklund <eae@chromium.org>
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jun 2011 00:53:16 +0000 (00:53 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jun 2011 00:53:16 +0000 (00:53 +0000)
        Reviewed by Eric Seidel.

        Update RenderBlock::paint to use IntPoint internally
        https://bugs.webkit.org/show_bug.cgi?id=62140

        Covered by existing tests.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paint):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index 163a631..72e3eaa 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Eric Seidel.
 
+        Update RenderBlock::paint to use IntPoint internally
+        https://bugs.webkit.org/show_bug.cgi?id=62140
+
+        Covered by existing tests.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint):
+
+2011-06-06  Emil A Eklund  <eae@chromium.org>
+
+        Reviewed by Eric Seidel.
+
         Convert RenderBox::absoluteRects to IntPoint
         https://bugs.webkit.org/show_bug.cgi?id=62130
 
index 5308f62..5e235a1 100644 (file)
@@ -2240,8 +2240,7 @@ void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants)
  
 void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty)
 {
-    tx += x();
-    ty += y();
+    IntPoint adjustedOffset = location() + IntSize(tx, ty);
     
     PaintPhase phase = paintInfo.phase;
 
@@ -2252,21 +2251,21 @@ void RenderBlock::paint(PaintInfo& paintInfo, int tx, int ty)
         IntRect overflowBox = visualOverflowRect();
         flipForWritingMode(overflowBox);
         overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
-        overflowBox.move(tx, ty);
+        overflowBox.moveBy(adjustedOffset);
         if (!overflowBox.intersects(paintInfo.rect))
             return;
     }
 
-    bool pushedClip = pushContentsClip(paintInfo, IntPoint(tx, ty));
-    paintObject(paintInfo, IntPoint(tx, ty));
+    bool pushedClip = pushContentsClip(paintInfo, adjustedOffset);
+    paintObject(paintInfo, adjustedOffset);
     if (pushedClip)
-        popContentsClip(paintInfo, phase, IntPoint(tx, ty));
+        popContentsClip(paintInfo, phase, adjustedOffset);
 
     // Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
     // z-index.  We paint after we painted the background/border, so that the scrollbars will
     // sit above the background/border.
     if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this))
-        layer()->paintOverflowControls(paintInfo.context, IntPoint(tx, ty), paintInfo.rect);
+        layer()->paintOverflowControls(paintInfo.context, adjustedOffset, paintInfo.rect);
 }
 
 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, const IntPoint& paintOffset)