2011-06-03 Levi Weintraub <leviw@chromium.org>
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2011 18:43:15 +0000 (18:43 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2011 18:43:15 +0000 (18:43 +0000)
        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):

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderFieldset.cpp
Source/WebCore/rendering/RenderFieldset.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp

index 203ebb1c2d8701494fc0d7111b9c518d4db5cfb8..bfe39e01169ed2a072ff7d788c58657e9aff1684 100644 (file)
@@ -1,3 +1,49 @@
+2011-06-03  Levi Weintraub  <leviw@chromium.org>
+
+        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  <doreen.jiang@nokia.com>
 
         Reviewed by Benjamin Poulain.
index 8c1e56e8d153165d55917607d8bcea0b3f7cca17..99f9cce4714948927f45992ca0eb76363a02719c 100644 (file)
@@ -995,7 +995,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const IntPoint& paintOffset, int
             return;
         } else {
             // Paint our background, border and box-shadow.
-            paintBoxDecorations(paintInfo, paintOffset.x(), paintOffset.y());
+            paintBoxDecorations(paintInfo, paintOffset);
         }
     }
 
@@ -1074,34 +1074,40 @@ void InlineFlowBox::paintBoxShadow(GraphicsContext* context, RenderStyle* s, Sha
     }
 }
 
-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 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
     // 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 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
                 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 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
 
     // 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 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
         }
     }
 
-    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 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
     // 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 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
             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);
     }
     
index 1fcccbef878b428e0258ae8d16cdb7d89c90b5bc..40ac22d35ac17f525d3a0161ef6e90e912b73d7c 100644 (file)
@@ -103,7 +103,7 @@ public:
 
     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 @@ private:
     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;
index 86874b825af5c256262163e92d1aaf23d0b84712..e50d109cc13795188ccebfb03a7038c0da5fffb5 100644 (file)
@@ -2464,7 +2464,7 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, int tx, int ty)
     // 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);
     }
index 86e9a1d9939d6dab3444b728ed0170d18dda1c5a..e5ccedb0612f91ceb91daf5788708b5fa80a8718 100644 (file)
@@ -825,11 +825,11 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
     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).
index b88dcd24168b2c1ddb0ee999816ee193f192762f..bc0e930231a8c8e9a234f8ca3aaa005eb4d8360a 100644 (file)
@@ -353,7 +353,7 @@ public:
     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);
 
index d04371157cb77ac7cdcf507df81ee3054fa538e3..c7838cc091b91612084648d0e68904382c4659d6 100644 (file)
@@ -118,31 +118,28 @@ RenderBox* RenderFieldset::findLegend() const
     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 @@ void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
     // 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());
index 77e1e735e96f972123b9ee05e777a5c948ae0c56..d87f660ae9c2f398b2c55b2e4dd2a6f41d595096 100644 (file)
@@ -44,7 +44,7 @@ private:
     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);
 };
 
index 2e23823d5989186c7aa5b8a8afd0af2789577fa9..f39dbbd4a1950ecad4155ec7b178c28d8cc2e2a3 100644 (file)
@@ -103,7 +103,7 @@ void RenderReplaced::paint(PaintInfo& paintInfo, int tx, int ty)
     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));
index 47c0612345c06785d989437997299b085e7eb0a2..8bd229a7aa930cc96cd767df974c90895c69e71d 100644 (file)
@@ -477,7 +477,7 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
 {
     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::subtractCaptionRect(IntRect& rect) const
     }
 }
 
-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);
index ce51496deb19bf494a6960e40d8f0f65bad46c7a..38463a5552f54e3fb78fda140d2fe16bac5a942c 100644 (file)
@@ -216,7 +216,7 @@ private:
 
     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();
index 22398b3c2015acfcbac79120264fae6a67cbea19..8878480f80b920db1948224a1727b278d4579172 100644 (file)
@@ -1001,7 +1001,7 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, i
     }
 }
 
-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 @@ void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
     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);
 
index cbbef3148deb9a4b044c40850bf053c6fd35bb99..6b8beb3347d4e248989a820863279e1b3d01433d 100644 (file)
@@ -142,7 +142,7 @@ private:
 
     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;
index 095b656416f6679e079c86a0dc1fc86074b490fa..e9e24ef8d287ea061331ff1a7371b8195460da61 100644 (file)
@@ -184,7 +184,7 @@ static inline bool rendererObscuresBackground(RenderObject* object)
         && !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,
index 1bb086e47710c775ab508af560d9d001e6420b14..cff78a84af0f7d5242e57568470e1625042820cb 100644 (file)
@@ -70,7 +70,7 @@ public:
     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);
index 8136ef879ae0b140321057a6fe856c8955390018..3c2975a3cd0f095c3a84aa5eaef4c9c3e95acd71 100644 (file)
@@ -256,7 +256,7 @@ void RenderWidget::paint(PaintInfo& paintInfo, int tx, int ty)
     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));
index 00f221e4fdc5bc8b46a784aa488b3a6f4dfb6581..bd68bfdf41954a4e6fe4f870ebb8d8907774ebee 100644 (file)
@@ -272,7 +272,7 @@ void RenderSVGRoot::paint(PaintInfo& paintInfo, int parentX, int parentY)
     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;