Changeset 88051 in webkit
- Timestamp:
- Jun 3, 2011 1:59:40 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88050 r88051 1 2011-06-03 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch paintBackgroundsBehindCell to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62031 7 8 Switching paintBackgroundsBehindCell to take an IntPoint representing 9 the paint offset instead of a pair of ints. 10 11 No new tests as this is simple refactoring. 12 13 * rendering/RenderTableCell.cpp: 14 (WebCore::RenderTableCell::paintBackgroundsBehindCell): 15 (WebCore::RenderTableCell::paintBoxDecorations): 16 * rendering/RenderTableCell.h: 17 * rendering/RenderTableRow.cpp: 18 (WebCore::RenderTableRow::paint): 19 * rendering/RenderTableSection.cpp: 20 (WebCore::RenderTableSection::paintCell): 21 1 22 2011-06-03 Levi Weintraub <leviw@chromium.org> 2 23 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r88033 r88051 962 962 } 963 963 964 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, int ty, RenderObject* backgroundObject)964 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const IntPoint& paintOffset, RenderObject* backgroundObject) 965 965 { 966 966 if (!paintInfo.shouldPaintWithinRoot(this)) … … 977 977 return; 978 978 979 if (backgroundObject != this) { 980 tx += x(); 981 ty += y(); 982 } 983 984 int w = width(); 985 int h = height(); 979 IntPoint adjustedPaintOffset = paintOffset; 980 if (backgroundObject != this) 981 adjustedPaintOffset.move(location()); 986 982 987 983 Color c = backgroundObject->style()->visitedDependentColor(CSSPropertyBackgroundColor); … … 994 990 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); 995 991 if (shouldClip) { 996 IntRect clipRect( tx + borderLeft(), ty+ borderTop(),997 w - borderLeft() - borderRight(), h- borderTop() - borderBottom());992 IntRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjustedPaintOffset.y() + borderTop(), 993 width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom()); 998 994 paintInfo.context->clip(clipRect); 999 995 } 1000 paintFillLayers(paintInfo, c, bgLayer, IntRect( tx, ty, w, h), BackgroundBleedNone, CompositeSourceOver, backgroundObject);996 paintFillLayers(paintInfo, c, bgLayer, IntRect(adjustedPaintOffset, size()), BackgroundBleedNone, CompositeSourceOver, backgroundObject); 1001 997 } 1002 998 } … … 1015 1011 1016 1012 // Paint our cell background. 1017 paintBackgroundsBehindCell(paintInfo, paintOffset .x(), paintOffset.y(), this);1013 paintBackgroundsBehindCell(paintInfo, paintOffset, this); 1018 1014 1019 1015 paintBoxShadow(paintInfo.context, paintRect, style(), Inset); -
trunk/Source/WebCore/rendering/RenderTableCell.h
r88033 r88051 97 97 virtual void paint(PaintInfo&, int tx, int ty); 98 98 99 void paintBackgroundsBehindCell(PaintInfo&, int tx, int ty, RenderObject* backgroundObject);99 void paintBackgroundsBehindCell(PaintInfo&, const IntPoint&, RenderObject* backgroundObject); 100 100 101 101 int cellBaselinePosition() const; -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r86705 r88051 219 219 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) { 220 220 RenderTableCell* cell = toRenderTableCell(child); 221 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);221 cell->paintBackgroundsBehindCell(paintInfo, IntPoint(tx, ty), this); 222 222 } 223 223 if (!toRenderBox(child)->hasSelfPaintingLayer()) -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r86705 r88051 934 934 // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the 935 935 // cell. 936 cell->paintBackgroundsBehindCell(paintInfo, cellPoint .x(), cellPoint.y(), colGroup);937 cell->paintBackgroundsBehindCell(paintInfo, cellPoint .x(), cellPoint.y(), col);936 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, colGroup); 937 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, col); 938 938 939 939 // Paint the row group next. 940 cell->paintBackgroundsBehindCell(paintInfo, cellPoint .x(), cellPoint.y(), this);940 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, this); 941 941 942 942 // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for 943 943 // painting the row background for the cell. 944 944 if (!row->hasSelfPaintingLayer()) 945 cell->paintBackgroundsBehindCell(paintInfo, cellPoint .x(), cellPoint.y(), row);945 cell->paintBackgroundsBehindCell(paintInfo, cellPoint, row); 946 946 } 947 947 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
Note: See TracChangeset
for help on using the changeset viewer.