Title: [88033] trunk/Source/WebCore
Revision
88033
Author
[email protected]
Date
2011-06-03 11:43:15 -0700 (Fri, 03 Jun 2011)

Log Message

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

        Reviewed by Eric Seidel.

        Switch paintBoxDecorations to IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=61968

        Switching paintBoxDecorations to take an IntPoint representing
        the paint offset instead of a pair of ints. Also cleaning up
        some duplicated code in InlineFlowBox related to constraining
        the paint rect to the linetop and linebottom.

        No new tests since this is just refactoring.

        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::paint):
        (WebCore::InlineFlowBox::constrainToLineTopAndBottomIfNeeded): Added
        to remove duplicate code in paintBoxDecorations and paintMask.
        (WebCore::InlineFlowBox::paintBoxDecorations):
        (WebCore::InlineFlowBox::paintMask):
        * rendering/InlineFlowBox.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintObject):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintBoxDecorations):
        * rendering/RenderBox.h:
        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::paintBoxDecorations):
        * rendering/RenderFieldset.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::paintObject):
        (WebCore::RenderTable::paintBoxDecorations):
        * rendering/RenderTable.h:
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paintBoxDecorations):
        * rendering/RenderTableCell.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::paintBoxDecorations):
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::paint):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88032 => 88033)


--- trunk/Source/WebCore/ChangeLog	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/ChangeLog	2011-06-03 18:43:15 UTC (rev 88033)
@@ -1,3 +1,49 @@
+2011-06-03  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintBoxDecorations to IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=61968
+
+        Switching paintBoxDecorations to take an IntPoint representing
+        the paint offset instead of a pair of ints. Also cleaning up
+        some duplicated code in InlineFlowBox related to constraining
+        the paint rect to the linetop and linebottom.
+
+        No new tests since this is just refactoring.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paint):
+        (WebCore::InlineFlowBox::constrainToLineTopAndBottomIfNeeded): Added
+        to remove duplicate code in paintBoxDecorations and paintMask.
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintMask):
+        * rendering/InlineFlowBox.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintObject):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBoxDecorations):
+        * rendering/RenderBox.h:
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintBoxDecorations):
+        * rendering/RenderFieldset.h:
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::paintObject):
+        (WebCore::RenderTable::paintBoxDecorations):
+        * rendering/RenderTable.h:
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBoxDecorations):
+        * rendering/RenderTableCell.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paintBoxDecorations):
+        * rendering/RenderView.h:
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paint):
+
 2011-06-03  Doreen Jiang  <[email protected]>
 
         Reviewed by Benjamin Poulain.

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -995,7 +995,7 @@
             return;
         } else {
             // Paint our background, border and box-shadow.
-            paintBoxDecorations(paintInfo, paintOffset.x(), paintOffset.y());
+            paintBoxDecorations(paintInfo, paintOffset);
         }
     }
 
@@ -1074,34 +1074,40 @@
     }
 }
 
-void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+void InlineFlowBox::constrainToLineTopAndBottomIfNeeded(IntRect& rect) const
 {
+    bool noQuirksMode = renderer()->document()->inNoQuirksMode();
+    if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
+        const RootInlineBox* rootBox = root();
+        int logicalTop = isHorizontal() ? rect.y() : rect.x();
+        int logicalHeight = isHorizontal() ? rect.height() : rect.width();
+        int bottom = min(rootBox->lineBottom(), logicalTop + logicalHeight);
+        logicalTop = max(rootBox->lineTop(), logicalTop);
+        logicalHeight = bottom - logicalTop;
+        if (isHorizontal()) {
+            rect.setY(logicalTop);
+            rect.setHeight(logicalHeight);
+        } else {
+            rect.setX(logicalTop);
+            rect.setWidth(logicalHeight);
+        }
+    }
+}
+
+void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint& paintOffset)
+{
     if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
         return;
 
     // Pixel snap background/border painting.
     IntRect frameRect = roundedFrameRect();
-    int x = frameRect.x();
-    int y = frameRect.y();
-    int w = frameRect.width();
-    int h = frameRect.height();
 
-    // Constrain our background/border painting to the line top and bottom if necessary.
-    bool noQuirksMode = renderer()->document()->inNoQuirksMode();
-    if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
-        RootInlineBox* rootBox = root();
-        int& top = isHorizontal() ? y : x;
-        int& logicalHeight = isHorizontal() ? h : w;
-        int bottom = min(rootBox->lineBottom(), top + logicalHeight);
-        top = max(rootBox->lineTop(), top);
-        logicalHeight = bottom - top;
-    }
+    constrainToLineTopAndBottomIfNeeded(frameRect);
     
     // Move x/y to our coordinates.
-    IntRect localRect(x, y, w, h);
+    IntRect localRect(frameRect);
     flipForWritingMode(localRect);
-    tx += localRect.x();
-    ty += localRect.y();
+    IntPoint adjustedPaintoffset = paintOffset + localRect.location();
     
     GraphicsContext* context = paintInfo.context;
     
@@ -1109,7 +1115,7 @@
     // a line may actually have to paint a background.
     RenderStyle* styleToUse = renderer()->style(m_firstLine);
     if ((!parent() && m_firstLine && styleToUse != renderer()->style()) || (parent() && renderer()->hasBoxDecorations())) {
-        IntRect paintRect = IntRect(tx, ty, w, h);
+        IntRect paintRect = IntRect(adjustedPaintoffset, frameRect.size());
         // Shadow comes first and is behind the background and border.
         paintBoxShadow(context, styleToUse, Normal, paintRect);
 
@@ -1144,13 +1150,13 @@
                 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 stripWidth = isHorizontal() ? totalLogicalWidth : w;
-                int stripHeight = isHorizontal() ? h : totalLogicalWidth;
+                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;
 
                 GraphicsContextStateSaver stateSaver(*context);
-                context->clip(IntRect(tx, ty, w, h));
+                context->clip(paintRect);
                 boxModelObject()->paintBorder(context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style());
             }
         }
@@ -1164,24 +1170,11 @@
 
     // Pixel snap mask painting.
     IntRect frameRect = roundedFrameRect();
-    int x = frameRect.x();
-    int y = frameRect.y();
-    int w = frameRect.width();
-    int h = frameRect.height();
 
-    // Constrain our background/border painting to the line top and bottom if necessary.
-    bool noQuirksMode = renderer()->document()->inNoQuirksMode();
-    if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
-        RootInlineBox* rootBox = root();
-        int& top = isHorizontal() ? y : x;
-        int& logicalHeight = isHorizontal() ? h : w;
-        int bottom = min(rootBox->lineBottom(), top + logicalHeight);
-        top = max(rootBox->lineTop(), top);
-        logicalHeight = bottom - top;
-    }
+    constrainToLineTopAndBottomIfNeeded(frameRect);
     
     // Move x/y to our coordinates.
-    IntRect localRect(x, y, w, h);
+    IntRect localRect(frameRect);
     flipForWritingMode(localRect);
     tx += localRect.x();
     ty += localRect.y();
@@ -1205,7 +1198,8 @@
         }
     }
 
-    paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), IntRect(tx, ty, w, h), compositeOp);
+    IntRect paintRect = IntRect(IntPoint(tx, ty), frameRect.size());
+    paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp);
     
     bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom());
     if (!hasBoxImage || !maskBoxImage->isLoaded())
@@ -1214,7 +1208,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(tx, ty, w, h), renderer()->style(), maskNinePieceImage, compositeOp);
+        boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(IntPoint(tx, ty), 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.
@@ -1226,11 +1220,11 @@
             totalLogicalWidth += curr->logicalWidth();
         int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0);
         int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine);
-        int stripWidth = isHorizontal() ? totalLogicalWidth : w;
-        int stripHeight = isHorizontal() ? h : totalLogicalWidth;
+        int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
+        int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
 
         GraphicsContextStateSaver stateSaver(*paintInfo.context);
-        paintInfo.context->clip(IntRect(tx, ty, w, h));
+        paintInfo.context->clip(paintRect);
         boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);
     }
     

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -103,7 +103,7 @@
 
     IntRect roundedFrameRect() const;
     
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
     virtual void paintMask(PaintInfo&, int tx, int ty);
     void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
     void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
@@ -276,6 +276,7 @@
     void addBoxShadowVisualOverflow(IntRect& logicalVisualOverflow);
     void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsMap&, IntRect& logicalVisualOverflow);
     void addReplacedChildOverflow(const InlineBox*, IntRect& logicalLayoutOverflow, IntRect& logicalVisualOverflow);
+    void constrainToLineTopAndBottomIfNeeded(IntRect&) const;
 
 protected:
     OwnPtr<RenderOverflow> m_overflow;

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -2464,7 +2464,7 @@
     // 1. paint background, borders etc
     if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style()->visibility() == VISIBLE) {
         if (hasBoxDecorations())
-            paintBoxDecorations(paintInfo, tx, ty);
+            paintBoxDecorations(paintInfo, IntPoint(tx, ty));
         if (hasColumns())
             paintColumnRules(paintInfo, tx, ty);
     }

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -825,11 +825,11 @@
     return BackgroundBleedUseTransparencyLayer;
 }
 
-void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!paintInfo.shouldPaintWithinRoot(this))
         return;
-    IntRect paintRect(tx, ty, width(), height());
+    IntRect paintRect(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).

Modified: trunk/Source/WebCore/rendering/RenderBox.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -353,7 +353,7 @@
     void popContentsClip(PaintInfo&, PaintPhase originalPhase, int tx, int ty);
 
     virtual void paintObject(PaintInfo&, int /*tx*/, int /*ty*/) { ASSERT_NOT_REACHED(); }
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
     virtual void paintMask(PaintInfo&, IntSize);
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 

Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -118,31 +118,28 @@
     return 0;
 }
 
-void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!paintInfo.shouldPaintWithinRoot(this))
         return;
 
-    int w = width();
-    int h = height();
+    IntRect paintRect(paintOffset, size());
     RenderBox* legend = findLegend();
     if (!legend)
-        return RenderBlock::paintBoxDecorations(paintInfo, tx, ty);
+        return RenderBlock::paintBoxDecorations(paintInfo, paintOffset);
 
     // FIXME: We need to work with "rl" and "bt" block flow directions.  In those
     // 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;
-        h -= yOff;
-        ty += yOff;
+        paintRect.setHeight(paintRect.height() - yOff);
+        paintRect.setY(paintRect.y() + yOff);
     } else {
         int xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
-        w -= xOff;
-        tx += xOff;
+        paintRect.setWidth(paintRect.width() - xOff);
+        paintRect.setX(paintRect.x() + xOff);
     }
-
-    IntRect paintRect = IntRect(tx, ty, w, h);
     
     paintBoxShadow(paintInfo.context, paintRect, style(), Normal);
     paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), paintRect);
@@ -159,13 +156,13 @@
     // 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 clipTop = ty;
+        int clipTop = paintRect.y();
         int clipHeight = max(static_cast<int>(style()->borderTopWidth()), legend->height());
-        graphicsContext->clipOut(IntRect(tx + legend->x(), clipTop, legend->width(), clipHeight));
+        graphicsContext->clipOut(IntRect(paintRect.x() + legend->x(), clipTop, legend->width(), clipHeight));
     } else {
-        int clipLeft = tx;
+        int clipLeft = paintRect.x();
         int clipWidth = max(static_cast<int>(style()->borderLeftWidth()), legend->width());
-        graphicsContext->clipOut(IntRect(clipLeft, ty + legend->y(), clipWidth, legend->height()));
+        graphicsContext->clipOut(IntRect(clipLeft, paintRect.y() + legend->y(), clipWidth, legend->height()));
     }
 
     paintBorder(paintInfo.context, paintRect, style());

Modified: trunk/Source/WebCore/rendering/RenderFieldset.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderFieldset.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderFieldset.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -44,7 +44,7 @@
     virtual bool avoidsFloats() const { return true; }
     virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true; }
 
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
     virtual void paintMask(PaintInfo&, IntSize);
 };
 

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -103,7 +103,7 @@
     ty += y();
     
     if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
-        paintBoxDecorations(paintInfo, tx, ty);
+        paintBoxDecorations(paintInfo, IntPoint(tx, ty));
     
     if (paintInfo.phase == PaintPhaseMask) {
         paintMask(paintInfo, IntSize(tx, ty));

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -477,7 +477,7 @@
 {
     PaintPhase paintPhase = paintInfo.phase;
     if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasBoxDecorations() && style()->visibility() == VISIBLE)
-        paintBoxDecorations(paintInfo, tx, ty);
+        paintBoxDecorations(paintInfo, IntPoint(tx, ty));
 
     if (paintPhase == PaintPhaseMask) {
         paintMask(paintInfo, IntSize(tx, ty));
@@ -550,12 +550,12 @@
     }
 }
 
-void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!paintInfo.shouldPaintWithinRoot(this))
         return;
 
-    IntRect rect(tx, ty, width(), height());
+    IntRect rect(paintOffset, size());
     subtractCaptionRect(rect);
 
     paintBoxShadow(paintInfo.context, rect, style(), Normal);

Modified: trunk/Source/WebCore/rendering/RenderTable.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderTable.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderTable.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -216,7 +216,7 @@
 
     virtual void paint(PaintInfo&, int tx, int ty);
     virtual void paintObject(PaintInfo&, int tx, int ty);
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
     virtual void paintMask(PaintInfo&, IntSize);
     virtual void layout();
     virtual void computePreferredLogicalWidths();

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -1001,7 +1001,7 @@
     }
 }
 
-void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint& paintOffset)
 {
     if (!paintInfo.shouldPaintWithinRoot(this))
         return;
@@ -1010,11 +1010,11 @@
     if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
         return;
 
-    IntRect paintRect = IntRect(IntPoint(tx, ty), size());
+    IntRect paintRect = IntRect(paintOffset, size());
     paintBoxShadow(paintInfo.context, paintRect, style(), Normal);
     
     // Paint our cell background.
-    paintBackgroundsBehindCell(paintInfo, tx, ty, this);
+    paintBackgroundsBehindCell(paintInfo, paintOffset.x(), paintOffset.y(), this);
 
     paintBoxShadow(paintInfo.context, paintRect, style(), Inset);
 

Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderTableCell.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -142,7 +142,7 @@
 
     virtual void computeLogicalWidth();
 
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
     virtual void paintMask(PaintInfo&, IntSize);
 
     virtual IntSize offsetFromContainer(RenderObject*, const IntPoint&) const;

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -184,7 +184,7 @@
         && !isComposited(object);
 }
     
-void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int, int)
+void RenderView::paintBoxDecorations(PaintInfo& paintInfo, const IntPoint&)
 {
     // Check to see if we are enclosed by a layer that requires complex painting rules.  If so, we cannot blit
     // when scrolling, and we need to use slow repaints.  Examples of layers that require this are transparent layers,

Modified: trunk/Source/WebCore/rendering/RenderView.h (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderView.h	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderView.h	2011-06-03 18:43:15 UTC (rev 88033)
@@ -70,7 +70,7 @@
     virtual void repaintRectangleInViewAndCompositedLayers(const IntRect&, bool immediate = false);
 
     virtual void paint(PaintInfo&, int tx, int ty);
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
 
     enum SelectionRepaintMode { RepaintNewXOROld, RepaintNewMinusOld };
     void setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode = RepaintNewXOROld);

Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -256,7 +256,7 @@
     ty += y();
 
     if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
-        paintBoxDecorations(paintInfo, tx, ty);
+        paintBoxDecorations(paintInfo, IntPoint(tx, ty));
 
     if (paintInfo.phase == PaintPhaseMask) {
         paintMask(paintInfo, IntSize(tx, ty));

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (88032 => 88033)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2011-06-03 18:33:37 UTC (rev 88032)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2011-06-03 18:43:15 UTC (rev 88033)
@@ -272,7 +272,7 @@
     IntPoint borderBoxOriginInContainer = parentOriginInContainer + parentOriginToBorderBox();
 
     if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) && isVisible)
-        paintBoxDecorations(paintInfo, borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y());
+        paintBoxDecorations(paintInfo, borderBoxOriginInContainer);
 
     if (paintInfo.phase == PaintPhaseBlockBackground)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to