Changeset 88051 in webkit


Ignore:
Timestamp:
Jun 3, 2011 1:59:40 PM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-06-03 Levi Weintraub <leviw@chromium.org>

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):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88050 r88051  
     12011-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
    1222011-06-03  Levi Weintraub  <leviw@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r88033 r88051  
    962962}
    963963
    964 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, int ty, RenderObject* backgroundObject)
     964void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const IntPoint& paintOffset, RenderObject* backgroundObject)
    965965{
    966966    if (!paintInfo.shouldPaintWithinRoot(this))
     
    977977        return;
    978978
    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());
    986982
    987983    Color c = backgroundObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
     
    994990        GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip);
    995991        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());
    998994            paintInfo.context->clip(clipRect);
    999995        }
    1000         paintFillLayers(paintInfo, c, bgLayer, IntRect(tx, ty, w, h), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
     996        paintFillLayers(paintInfo, c, bgLayer, IntRect(adjustedPaintOffset, size()), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
    1001997    }
    1002998}
     
    10151011   
    10161012    // Paint our cell background.
    1017     paintBackgroundsBehindCell(paintInfo, paintOffset.x(), paintOffset.y(), this);
     1013    paintBackgroundsBehindCell(paintInfo, paintOffset, this);
    10181014
    10191015    paintBoxShadow(paintInfo.context, paintRect, style(), Inset);
  • trunk/Source/WebCore/rendering/RenderTableCell.h

    r88033 r88051  
    9797    virtual void paint(PaintInfo&, int tx, int ty);
    9898
    99     void paintBackgroundsBehindCell(PaintInfo&, int tx, int ty, RenderObject* backgroundObject);
     99    void paintBackgroundsBehindCell(PaintInfo&, const IntPoint&, RenderObject* backgroundObject);
    100100
    101101    int cellBaselinePosition() const;
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r86705 r88051  
    219219            if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) {
    220220                RenderTableCell* cell = toRenderTableCell(child);
    221                 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);
     221                cell->paintBackgroundsBehindCell(paintInfo, IntPoint(tx, ty), this);
    222222            }
    223223            if (!toRenderBox(child)->hasSelfPaintingLayer())
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r86705 r88051  
    934934        // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
    935935        // 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);
    938938
    939939        // Paint the row group next.
    940         cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), this);
     940        cell->paintBackgroundsBehindCell(paintInfo, cellPoint, this);
    941941
    942942        // Paint the row next, but only if it doesn't have a layer.  If a row has a layer, it will be responsible for
    943943        // painting the row background for the cell.
    944944        if (!row->hasSelfPaintingLayer())
    945             cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), row);
     945            cell->paintBackgroundsBehindCell(paintInfo, cellPoint, row);
    946946    }
    947947    if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders)
Note: See TracChangeset for help on using the changeset viewer.