Title: [88051] trunk/Source/WebCore
Revision
88051
Author
[email protected]
Date
2011-06-03 13:59:40 -0700 (Fri, 03 Jun 2011)

Log Message

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

        Reviewed by Eric Seidel.

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

        Switching paintBackgroundsBehindCell to take an IntPoint representing
        the paint offset instead of a pair of ints.

        No new tests as this is simple refactoring.

        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
        (WebCore::RenderTableCell::paintBoxDecorations):
        * rendering/RenderTableCell.h:
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::paint):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::paintCell):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88050 => 88051)


--- trunk/Source/WebCore/ChangeLog	2011-06-03 20:57:43 UTC (rev 88050)
+++ trunk/Source/WebCore/ChangeLog	2011-06-03 20:59:40 UTC (rev 88051)
@@ -2,6 +2,27 @@
 
         Reviewed by Eric Seidel.
 
+        Switch paintBackgroundsBehindCell to use IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62031
+
+        Switching paintBackgroundsBehindCell to take an IntPoint representing
+        the paint offset instead of a pair of ints.
+
+        No new tests as this is simple refactoring.
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+        (WebCore::RenderTableCell::paintBoxDecorations):
+        * rendering/RenderTableCell.h:
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::paint):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::paintCell):
+
+2011-06-03  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
         Switch paintCaret and paintDragCaret to use IntPoint
         https://bugs.webkit.org/show_bug.cgi?id=62037
 

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (88050 => 88051)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-06-03 20:57:43 UTC (rev 88050)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-06-03 20:59:40 UTC (rev 88051)
@@ -961,7 +961,7 @@
     }
 }
 
-void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, int ty, RenderObject* backgroundObject)
+void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const IntPoint& paintOffset, RenderObject* backgroundObject)
 {
     if (!paintInfo.shouldPaintWithinRoot(this))
         return;
@@ -976,14 +976,10 @@
     if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
         return;
 
-    if (backgroundObject != this) {
-        tx += x();
-        ty += y();
-    }
+    IntPoint adjustedPaintOffset = paintOffset;
+    if (backgroundObject != this)
+        adjustedPaintOffset.move(location());
 
-    int w = width();
-    int h = height();
-
     Color c = backgroundObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
     const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers();
 
@@ -993,11 +989,11 @@
         bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == this || backgroundObject == parent()) && tableElt->collapseBorders();
         GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip);
         if (shouldClip) {
-            IntRect clipRect(tx + borderLeft(), ty + borderTop(),
-                w - borderLeft() - borderRight(), h - borderTop() - borderBottom());
+            IntRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjustedPaintOffset.y() + borderTop(),
+                width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
             paintInfo.context->clip(clipRect);
         }
-        paintFillLayers(paintInfo, c, bgLayer, IntRect(tx, ty, w, h), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
+        paintFillLayers(paintInfo, c, bgLayer, IntRect(adjustedPaintOffset, size()), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
     }
 }
 
@@ -1014,7 +1010,7 @@
     paintBoxShadow(paintInfo.context, paintRect, style(), Normal);
     
     // Paint our cell background.
-    paintBackgroundsBehindCell(paintInfo, paintOffset.x(), paintOffset.y(), this);
+    paintBackgroundsBehindCell(paintInfo, paintOffset, this);
 
     paintBoxShadow(paintInfo.context, paintRect, style(), Inset);
 

Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (88050 => 88051)


--- trunk/Source/WebCore/rendering/RenderTableCell.h	2011-06-03 20:57:43 UTC (rev 88050)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h	2011-06-03 20:59:40 UTC (rev 88051)
@@ -96,7 +96,7 @@
 
     virtual void paint(PaintInfo&, int tx, int ty);
 
-    void paintBackgroundsBehindCell(PaintInfo&, int tx, int ty, RenderObject* backgroundObject);
+    void paintBackgroundsBehindCell(PaintInfo&, const IntPoint&, RenderObject* backgroundObject);
 
     int cellBaselinePosition() const;
 

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (88050 => 88051)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2011-06-03 20:57:43 UTC (rev 88050)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2011-06-03 20:59:40 UTC (rev 88051)
@@ -218,7 +218,7 @@
             // Paint the row background behind the cell.
             if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) {
                 RenderTableCell* cell = toRenderTableCell(child);
-                cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);
+                cell->paintBackgroundsBehindCell(paintInfo, IntPoint(tx, ty), this);
             }
             if (!toRenderBox(child)->hasSelfPaintingLayer())
                 child->paint(paintInfo, tx, ty);

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (88050 => 88051)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-06-03 20:57:43 UTC (rev 88050)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-06-03 20:59:40 UTC (rev 88051)
@@ -933,16 +933,16 @@
         // the stack, since we have already opened a transparency layer (potentially) for the table row group.
         // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
         // cell.
-        cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), colGroup);
-        cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), col);
+        cell->paintBackgroundsBehindCell(paintInfo, cellPoint, colGroup);
+        cell->paintBackgroundsBehindCell(paintInfo, cellPoint, col);
 
         // Paint the row group next.
-        cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), this);
+        cell->paintBackgroundsBehindCell(paintInfo, cellPoint, this);
 
         // Paint the row next, but only if it doesn't have a layer.  If a row has a layer, it will be responsible for
         // painting the row background for the cell.
         if (!row->hasSelfPaintingLayer())
-            cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), row);
+            cell->paintBackgroundsBehindCell(paintInfo, cellPoint, row);
     }
     if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
         cell->paint(paintInfo, cellPoint.x(), cellPoint.y());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to