Title: [88087] trunk/Source/WebCore
Revision
88087
Author
[email protected]
Date
2011-06-03 19:25:54 -0700 (Fri, 03 Jun 2011)

Log Message

2011-06-03  Levi Weintraub  <[email protected]>

        Reviewed by Eric Seidel.

        Switch paintMask and paintObject to use IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=62077

        Switching paintMask and paintObject to use IntPoint for their paint offset instead of
        a pair of ints. paintObject is still on tx/ty, but paintMask was converted to IntSize
        passed by value -- bringing it in-line with the agreed-upon convention of a const IntPoint&.

        No new tests since this is simple refactoring.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paint):
        (WebCore::RenderBlock::paintObject):
        * rendering/RenderBlock.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintMask):
        (WebCore::RenderBox::pushContentsClip):
        (WebCore::RenderBox::popContentsClip):
        * rendering/RenderBox.h:
        (WebCore::RenderBox::paintObject):
        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::paintMask):
        * rendering/RenderFieldset.h:
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::paintObject):
        * rendering/RenderFileUploadControl.h:
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::paintObject):
        * rendering/RenderListBox.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):
        * rendering/RenderReplica.cpp:
        (WebCore::RenderReplica::paint):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::paint):
        (WebCore::RenderTable::paintObject):
        (WebCore::RenderTable::paintMask):
        * rendering/RenderTable.h:
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::paint):
        (WebCore::RenderTableSection::paintObject):
        * rendering/RenderTableSection.h:
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::paintPlaceholder):
        (WebCore::RenderTextControl::paintObject):
        * rendering/RenderTextControl.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::paint):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88086 => 88087)


--- trunk/Source/WebCore/ChangeLog	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/ChangeLog	2011-06-04 02:25:54 UTC (rev 88087)
@@ -1,3 +1,57 @@
+2011-06-03  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintMask and paintObject to use IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62077
+
+        Switching paintMask and paintObject to use IntPoint for their paint offset instead of
+        a pair of ints. paintObject is still on tx/ty, but paintMask was converted to IntSize
+        passed by value -- bringing it in-line with the agreed-upon convention of a const IntPoint&.
+
+        No new tests since this is simple refactoring.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint):
+        (WebCore::RenderBlock::paintObject):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintMask):
+        (WebCore::RenderBox::pushContentsClip):
+        (WebCore::RenderBox::popContentsClip):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::paintObject):
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintMask):
+        * rendering/RenderFieldset.h:
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+        * rendering/RenderFileUploadControl.h:
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::paintObject):
+        * rendering/RenderListBox.h:
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderReplica.cpp:
+        (WebCore::RenderReplica::paint):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::paint):
+        (WebCore::RenderTable::paintObject):
+        (WebCore::RenderTable::paintMask):
+        * rendering/RenderTable.h:
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::paint):
+        (WebCore::RenderTableSection::paintObject):
+        * rendering/RenderTableSection.h:
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::paintPlaceholder):
+        (WebCore::RenderTextControl::paintObject):
+        * rendering/RenderTextControl.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paint):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+
 2011-06-03  Cary Clark  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -2260,7 +2260,7 @@
     }
 
     bool pushedClip = pushContentsClip(paintInfo, tx, ty);
-    paintObject(paintInfo, tx, ty);
+    paintObject(paintInfo, IntPoint(tx, ty));
     if (pushedClip)
         popContentsClip(paintInfo, phase, tx, ty);
 
@@ -2458,20 +2458,20 @@
     }
 }
 
-void RenderBlock::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderBlock::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     PaintPhase paintPhase = paintInfo.phase;
 
     // 1. paint background, borders etc
     if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style()->visibility() == VISIBLE) {
         if (hasBoxDecorations())
-            paintBoxDecorations(paintInfo, IntPoint(tx, ty));
+            paintBoxDecorations(paintInfo, paintOffset);
         if (hasColumns())
-            paintColumnRules(paintInfo, tx, ty);
+            paintColumnRules(paintInfo, paintOffset.x(), paintOffset.y());
     }
 
     if (paintPhase == PaintPhaseMask && style()->visibility() == VISIBLE) {
-        paintMask(paintInfo, IntSize(tx, ty));
+        paintMask(paintInfo, paintOffset);
         return;
     }
 
@@ -2480,39 +2480,35 @@
         return;
 
     // Adjust our painting position if we're inside a scrolled layer (e.g., an overflow:auto div).
-    int scrolledX = tx;
-    int scrolledY = ty;
-    if (hasOverflowClip()) {
-        IntSize offset = layer()->scrolledContentOffset();
-        scrolledX -= offset.width();
-        scrolledY -= offset.height();
-    }
+    IntPoint scrolledOffset = paintOffset;
+    if (hasOverflowClip())
+        scrolledOffset.move(-layer()->scrolledContentOffset());
 
     // 2. paint contents
     if (paintPhase != PaintPhaseSelfOutline) {
         if (hasColumns())
-            paintColumnContents(paintInfo, scrolledX, scrolledY);
+            paintColumnContents(paintInfo, scrolledOffset.x(), scrolledOffset.y());
         else
-            paintContents(paintInfo, scrolledX, scrolledY);
+            paintContents(paintInfo, scrolledOffset.x(), scrolledOffset.y());
     }
 
     // 3. paint selection
     // FIXME: Make this work with multi column layouts.  For now don't fill gaps.
     bool isPrinting = document()->printing();
     if (!isPrinting && !hasColumns())
-        paintSelection(paintInfo, scrolledX, scrolledY); // Fill in gaps in selection on lines and between blocks.
+        paintSelection(paintInfo, scrolledOffset.x(), scrolledOffset.y()); // Fill in gaps in selection on lines and between blocks.
 
     // 4. paint floats.
     if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip) {
         if (hasColumns())
-            paintColumnContents(paintInfo, scrolledX, scrolledY, true);
+            paintColumnContents(paintInfo, scrolledOffset.x(), scrolledOffset.y(), true);
         else
-            paintFloats(paintInfo, scrolledX, scrolledY, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip);
+            paintFloats(paintInfo, scrolledOffset.x(), scrolledOffset.y(), paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip);
     }
 
     // 5. paint outline.
     if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.context, IntRect(tx, ty, width(), height()));
+        paintOutline(paintInfo.context, IntRect(paintOffset, size()));
 
     // 6. paint continuation outlines.
     if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines)) {
@@ -2532,18 +2528,18 @@
             if (!inlineEnclosedInSelfPaintingLayer)
                 cb->addContinuationWithOutline(inlineRenderer);
             else if (!inlineRenderer->firstLineBox())
-                inlineRenderer->paintOutline(paintInfo.context, tx - x() + inlineRenderer->containingBlock()->x(),
-                                             ty - y() + inlineRenderer->containingBlock()->y());
+                inlineRenderer->paintOutline(paintInfo.context, paintOffset.x() - x() + inlineRenderer->containingBlock()->x(),
+                                             paintOffset.y() - y() + inlineRenderer->containingBlock()->y());
         }
-        paintContinuationOutlines(paintInfo, tx, ty);
+        paintContinuationOutlines(paintInfo, paintOffset.x(), paintOffset.y());
     }
 
     // 7. paint caret.
     // If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground,
     // then paint the caret.
     if (paintPhase == PaintPhaseForeground) {        
-        paintCaret(paintInfo, IntPoint(scrolledX, scrolledY), CursorCaret);
-        paintCaret(paintInfo, IntPoint(scrolledX, scrolledY), DragCaret);
+        paintCaret(paintInfo, scrolledOffset, CursorCaret);
+        paintCaret(paintInfo, scrolledOffset, DragCaret);
     }
 }
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -293,7 +293,7 @@
     void layoutPositionedObjects(bool relayoutChildren);
 
     virtual void paint(PaintInfo&, int tx, int ty);
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
 
     int logicalRightOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
     int logicalLeftOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -876,12 +876,12 @@
         paintInfo.context->endTransparencyLayer();
 }
 
-void RenderBox::paintMask(PaintInfo& paintInfo, IntSize paintOffset)
+void RenderBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
         return;
 
-    IntRect paintRect = IntRect(toPoint(paintOffset), size());
+    IntRect paintRect = IntRect(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).
@@ -1111,7 +1111,7 @@
         paintInfo.phase = PaintPhaseChildOutlines;
     else if (paintInfo.phase == PaintPhaseChildBlockBackground) {
         paintInfo.phase = PaintPhaseBlockBackground;
-        paintObject(paintInfo, tx, ty);
+        paintObject(paintInfo, IntPoint(tx, ty));
         paintInfo.phase = PaintPhaseChildBlockBackgrounds;
     }
     IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect(tx, ty));
@@ -1129,7 +1129,7 @@
     paintInfo.context->restore();
     if (originalPhase == PaintPhaseOutline) {
         paintInfo.phase = PaintPhaseSelfOutline;
-        paintObject(paintInfo, tx, ty);
+        paintObject(paintInfo, IntPoint(tx, ty));
         paintInfo.phase = originalPhase;
     } else if (originalPhase == PaintPhaseChildBlockBackground)
         paintInfo.phase = originalPhase;

Modified: trunk/Source/WebCore/rendering/RenderBox.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -352,9 +352,9 @@
     bool pushContentsClip(PaintInfo&, int tx, int ty);
     void popContentsClip(PaintInfo&, PaintPhase originalPhase, int tx, int ty);
 
-    virtual void paintObject(PaintInfo&, int /*tx*/, int /*ty*/) { ASSERT_NOT_REACHED(); }
+    virtual void paintObject(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }
     virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
-    virtual void paintMask(PaintInfo&, IntSize);
+    virtual void paintMask(PaintInfo&, const IntPoint&);
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 
     // Called when a positioned object moves but doesn't necessarily change size.  A simplified layout is attempted

Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -168,12 +168,12 @@
     paintBorder(paintInfo.context, paintRect, style());
 }
 
-void RenderFieldset::paintMask(PaintInfo& paintInfo, IntSize paintOffset)
+void RenderFieldset::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
         return;
 
-    IntRect paintRect = IntRect(toPoint(paintOffset), size());
+    IntRect paintRect = IntRect(paintOffset, size());
     RenderBox* legend = findLegend();
     if (!legend)
         return RenderBlock::paintMask(paintInfo, paintOffset);

Modified: trunk/Source/WebCore/rendering/RenderFieldset.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderFieldset.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderFieldset.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -45,7 +45,7 @@
     virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true; }
 
     virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
-    virtual void paintMask(PaintInfo&, IntSize);
+    virtual void paintMask(PaintInfo&, const IntPoint&);
 };
 
 inline RenderFieldset* toRenderFieldset(RenderObject* object)

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -227,7 +227,7 @@
     return style.release();
 }
 
-void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE)
         return;
@@ -236,7 +236,7 @@
     // Push a clip.
     GraphicsContextStateSaver stateSaver(*paintInfo.context, false);
     if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
-        IntRect clipRect(tx + borderLeft(), ty + borderTop(),
+        IntRect clipRect(paintOffset.x() + borderLeft(), paintOffset.y() + borderTop(),
                          width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop() + buttonShadowHeight);
         if (clipRect.isEmpty())
             return;
@@ -250,7 +250,7 @@
         TextRun textRun = constructTextRun(this, font, displayedFilename, style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride);
 
         // Determine where the filename should be placed
-        int contentLeft = tx + borderLeft() + paddingLeft();
+        int contentLeft = paintOffset.x() + borderLeft() + paddingLeft();
         int buttonAndIconWidth = m_button->renderBox()->width() + afterButtonSpacing
             + (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0);
         int textX;
@@ -271,7 +271,7 @@
         
         if (m_fileChooser->icon()) {
             // Determine where the icon should be placed
-            int iconY = ty + borderTop() + paddingTop() + (contentHeight() - iconHeight) / 2;
+            int iconY = paintOffset.y() + borderTop() + paddingTop() + (contentHeight() - iconHeight) / 2;
             int iconX;
             if (style()->isLeftToRightDirection())
                 iconX = contentLeft + m_button->renderBox()->width() + afterButtonSpacing;
@@ -284,7 +284,7 @@
     }
 
     // Paint the children.
-    RenderBlock::paintObject(paintInfo, tx, ty);
+    RenderBlock::paintObject(paintInfo, paintOffset);
 }
 
 void RenderFileUploadControl::computePreferredLogicalWidths()

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -52,7 +52,7 @@
 
     virtual void updateFromElement();
     virtual void computePreferredLogicalWidths();
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -256,7 +256,7 @@
                    contentWidth(), itemHeight());
 }
     
-void RenderListBox::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderListBox::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE)
         return;
@@ -266,30 +266,30 @@
     if (paintInfo.phase == PaintPhaseForeground) {
         int index = m_indexOffset;
         while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
-            paintItemForeground(paintInfo, IntPoint(tx, ty), index);
+            paintItemForeground(paintInfo, paintOffset, index);
             index++;
         }
     }
 
     // Paint the children.
-    RenderBlock::paintObject(paintInfo, tx, ty);
+    RenderBlock::paintObject(paintInfo, paintOffset);
 
     switch (paintInfo.phase) {
     // Depending on whether we have overlay scrollbars they
     // get rendered in the foreground or background phases
     case PaintPhaseForeground:
         if (m_vBar->isOverlayScrollbar())
-            paintScrollbar(paintInfo, tx, ty);
+            paintScrollbar(paintInfo, paintOffset.x(), paintOffset.y());
         break;
     case PaintPhaseBlockBackground:
         if (!m_vBar->isOverlayScrollbar())
-            paintScrollbar(paintInfo, tx, ty);
+            paintScrollbar(paintInfo, paintOffset.x(), paintOffset.y());
         break;
     case PaintPhaseChildBlockBackground:
     case PaintPhaseChildBlockBackgrounds: {
         int index = m_indexOffset;
         while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
-            paintItemBackground(paintInfo, IntPoint(tx, ty), index);
+            paintItemBackground(paintInfo, paintOffset, index);
             index++;
         }
         break;

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -65,7 +65,7 @@
     virtual bool canHaveChildren() const { return false; }
 
     virtual bool hasControlClip() const { return true; }
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
     virtual IntRect controlClipRect(const IntPoint&) const;
 
     virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -106,7 +106,7 @@
         paintBoxDecorations(paintInfo, IntPoint(tx, ty));
     
     if (paintInfo.phase == PaintPhaseMask) {
-        paintMask(paintInfo, IntSize(tx, ty));
+        paintMask(paintInfo, IntPoint(tx, ty));
         return;
     }
 

Modified: trunk/Source/WebCore/rendering/RenderReplica.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderReplica.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderReplica.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -76,7 +76,7 @@
                                       PaintBehaviorNormal, 0, 0,
                                       RenderLayer::PaintLayerHaveTransparency | RenderLayer::PaintLayerAppliedTransform | RenderLayer::PaintLayerTemporaryClipRects | RenderLayer::PaintLayerPaintingReflection);
     else if (paintInfo.phase == PaintPhaseMask)
-        paintMask(paintInfo, IntSize(tx, ty));
+        paintMask(paintInfo, IntPoint(tx, ty));
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -468,19 +468,19 @@
     }
 
     bool pushedClip = pushContentsClip(paintInfo, tx, ty);    
-    paintObject(paintInfo, tx, ty);
+    paintObject(paintInfo, IntPoint(tx, ty));
     if (pushedClip)
         popContentsClip(paintInfo, paintPhase, tx, ty);
 }
 
-void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderTable::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     PaintPhase paintPhase = paintInfo.phase;
     if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasBoxDecorations() && style()->visibility() == VISIBLE)
-        paintBoxDecorations(paintInfo, IntPoint(tx, ty));
+        paintBoxDecorations(paintInfo, paintOffset);
 
     if (paintPhase == PaintPhaseMask) {
-        paintMask(paintInfo, IntSize(tx, ty));
+        paintMask(paintInfo, paintOffset);
         return;
     }
 
@@ -498,7 +498,7 @@
 
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
         if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) {
-            IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
+            IntPoint childPoint = flipForWritingMode(toRenderBox(child), paintOffset, ParentToChildFlippingAdjustment);
             child->paint(info, childPoint.x(), childPoint.y());
         }
     }
@@ -520,7 +520,7 @@
             m_currentBorder = &borderStyles[i];
             for (RenderObject* child = firstChild(); child; child = child->nextSibling())
                 if (child->isTableSection()) {
-                    IntPoint childPoint = flipForWritingMode(toRenderTableSection(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
+                    IntPoint childPoint = flipForWritingMode(toRenderTableSection(child), paintOffset, ParentToChildFlippingAdjustment);
                     child->paint(info, childPoint.x(), childPoint.y());
                 }
         }
@@ -529,7 +529,7 @@
 
     // Paint outline.
     if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.context, IntRect(IntPoint(tx, ty), size()));
+        paintOutline(paintInfo.context, IntRect(paintOffset, size()));
 }
 
 void RenderTable::subtractCaptionRect(IntRect& rect) const
@@ -573,12 +573,12 @@
         paintBorder(paintInfo.context, rect, style());
 }
 
-void RenderTable::paintMask(PaintInfo& paintInfo, IntSize paintOffset)
+void RenderTable::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
         return;
 
-    IntRect rect(toPoint(paintOffset), size());
+    IntRect rect(paintOffset, size());
     subtractCaptionRect(rect);
 
     paintMaskImages(paintInfo, rect);

Modified: trunk/Source/WebCore/rendering/RenderTable.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTable.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTable.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -215,9 +215,9 @@
     virtual void removeChild(RenderObject* oldChild);
 
     virtual void paint(PaintInfo&, int tx, int ty);
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
     virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
-    virtual void paintMask(PaintInfo&, IntSize);
+    virtual void paintMask(PaintInfo&, const IntPoint&);
     virtual void layout();
     virtual void computePreferredLogicalWidths();
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -904,7 +904,7 @@
 
     PaintPhase phase = paintInfo.phase;
     bool pushedClip = pushContentsClip(paintInfo, tx, ty);
-    paintObject(paintInfo, tx, ty);
+    paintObject(paintInfo, IntPoint(tx, ty));
     if (pushedClip)
         popContentsClip(paintInfo, phase, tx, ty);
 }
@@ -948,7 +948,7 @@
         cell->paint(paintInfo, cellPoint.x(), cellPoint.y());
 }
 
-void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderTableSection::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     // Check which rows and cols are visible and only paint these.
     // FIXME: Could use a binary search here.
@@ -962,7 +962,7 @@
     unsigned endrow = totalRows;
 
     IntRect localRepaintRect = paintInfo.rect;
-    localRepaintRect.move(-tx, -ty);
+    localRepaintRect.moveBy(-paintOffset);
     if (style()->isFlippedBlocksWritingMode()) {
         if (style()->isHorizontalWritingMode())
             localRepaintRect.setY(height() - localRepaintRect.maxY());
@@ -1018,7 +1018,7 @@
                     RenderTableCell* cell = current.primaryCell();
                     if (!cell || (r > startrow && primaryCellAt(r - 1, c) == cell) || (c > startcol && primaryCellAt(r, c - 1) == cell))
                         continue;
-                    paintCell(cell, paintInfo, IntPoint(tx, ty));
+                    paintCell(cell, paintInfo, paintOffset);
                 }
             }
         } else {
@@ -1045,7 +1045,7 @@
             int size = cells.size();
             // Paint the cells.
             for (int i = 0; i < size; ++i)
-                paintCell(cells[i], paintInfo, IntPoint(tx, ty));
+                paintCell(cells[i], paintInfo, paintOffset);
         }
     }
 }

Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTableSection.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -134,7 +134,7 @@
 
     virtual void paint(PaintInfo&, int tx, int ty);
     virtual void paintCell(RenderTableCell*, PaintInfo&, const IntPoint&);
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
 
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 

Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTextControl.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -599,12 +599,12 @@
         repaint();
 }
 
-void RenderTextControl::paintPlaceholder(PaintInfo& paintInfo, int tx, int ty)
+void RenderTextControl::paintPlaceholder(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE)
         return;
     
-    IntRect clipRect(tx + borderLeft(), ty + borderTop(), width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
+    IntRect clipRect(paintOffset.x() + borderLeft(), paintOffset.y() + borderTop(), width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
     if (clipRect.isEmpty())
         return;
     
@@ -623,23 +623,23 @@
     RenderBox* textRenderer = innerTextElement() ? innerTextElement()->renderBox() : 0;
     if (textRenderer) {
         IntPoint textPoint;
-        textPoint.setY(ty + textBlockInsetTop() + placeholderStyle->fontMetrics().ascent());
+        textPoint.setY(paintOffset.y() + textBlockInsetTop() + placeholderStyle->fontMetrics().ascent());
         int styleTextIndent = placeholderStyle->textIndent().isFixed() ? placeholderStyle->textIndent().calcMinValue(0) : 0;
         if (placeholderStyle->isLeftToRightDirection())
-            textPoint.setX(tx + styleTextIndent + textBlockInsetLeft());
+            textPoint.setX(paintOffset.x() + styleTextIndent + textBlockInsetLeft());
         else
-            textPoint.setX(tx + width() - textBlockInsetRight() - styleTextIndent - style()->font().width(textRun));
+            textPoint.setX(paintOffset.x() + width() - textBlockInsetRight() - styleTextIndent - style()->font().width(textRun));
         
         paintInfo.context->drawBidiText(placeholderStyle->font(), textRun, textPoint);
     }
 }
 
-void RenderTextControl::paintObject(PaintInfo& paintInfo, int tx, int ty)
+void RenderTextControl::paintObject(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {    
     if (m_placeholderVisible && paintInfo.phase == PaintPhaseForeground)
-        paintPlaceholder(paintInfo, tx, ty);
+        paintPlaceholder(paintInfo, paintOffset);
     
-    RenderBlock::paintObject(paintInfo, tx, ty);
+    RenderBlock::paintObject(paintInfo, paintOffset);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderTextControl.h (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderTextControl.h	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderTextControl.h	2011-06-04 02:25:54 UTC (rev 88087)
@@ -90,7 +90,7 @@
     virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
     virtual bool canHaveChildren() const { return false; }
     virtual bool avoidsFloats() const { return true; }
-    virtual void paintObject(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, const IntPoint&);
     
     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
 
@@ -108,7 +108,7 @@
     virtual int textBlockInsetRight() const = 0;
     virtual int textBlockInsetTop() const = 0;
 
-    void paintPlaceholder(PaintInfo&, int tx, int ty);
+    void paintPlaceholder(PaintInfo&, const IntPoint&);
 
     bool m_lastChangeWasUserEdit;
 };

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -168,7 +168,7 @@
 {
     // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
     ASSERT(!needsLayout());
-    paintObject(paintInfo, tx, ty);
+    paintObject(paintInfo, IntPoint(tx, ty));
 }
 
 static inline bool isComposited(RenderObject* object)

Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (88086 => 88087)


--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-04 01:58:34 UTC (rev 88086)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-04 02:25:54 UTC (rev 88087)
@@ -259,7 +259,7 @@
         paintBoxDecorations(paintInfo, IntPoint(tx, ty));
 
     if (paintInfo.phase == PaintPhaseMask) {
-        paintMask(paintInfo, IntSize(tx, ty));
+        paintMask(paintInfo, IntPoint(tx, ty));
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to