Changeset 86449 in webkit


Ignore:
Timestamp:
May 13, 2011 11:21:12 AM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-05-13 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.

Switch paintCollapsedBorder to use IntRect
https://bugs.webkit.org/show_bug.cgi?id=60739

Updating the last offending paint function that takes four ints
instead of an IntRect.

No new tests as this is simple refactoring.

  • rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paint): (WebCore::RenderTableCell::paintCollapsedBorder):
  • rendering/RenderTableCell.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86448 r86449  
     12011-05-13  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch paintCollapsedBorder to use IntRect
     6        https://bugs.webkit.org/show_bug.cgi?id=60739
     7
     8        Updating the last offending paint function that takes four ints
     9        instead of an IntRect.
     10
     11        No new tests as this is simple refactoring.
     12
     13        * rendering/RenderTableCell.cpp:
     14        (WebCore::RenderTableCell::paint):
     15        (WebCore::RenderTableCell::paintCollapsedBorder):
     16        * rendering/RenderTableCell.h:
     17
    1182011-05-13  Abhishek Arya  <inferno@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r86384 r86449  
    813813        if (ty - table()->outerBorderTop() < paintInfo.rect.maxY() + os
    814814            && ty + height() + table()->outerBorderBottom() > paintInfo.rect.y() - os)
    815             paintCollapsedBorder(paintInfo.context, tx, ty, width(), height());
     815            paintCollapsedBorder(paintInfo.context, IntRect(tx, ty, width(), height()));
    816816        return;
    817817    }
     
    913913}
    914914
    915 void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h)
     915void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, const IntRect& paintRect)
    916916{
    917917    if (!table()->currentBorderStyle())
     
    929929    int rightWidth = rightVal.width();
    930930   
    931     tx -= leftWidth / 2;
    932     ty -= topWidth / 2;
    933     w += leftWidth / 2 + (rightWidth + 1) / 2;
    934     h += topWidth / 2 + (bottomWidth + 1) / 2;
     931    int x = paintRect.x() - leftWidth / 2;
     932    int y = paintRect.y() - topWidth / 2;
     933    int w = paintRect.width() + leftWidth / 2 + (rightWidth + 1) / 2;
     934    int h = paintRect.height() + topWidth / 2 + (bottomWidth + 1) / 2;
    935935   
    936936    EBorderStyle topStyle = collapsedBorderStyle(topVal.style());
     
    947947    // precedence paint on top of borders with lower precedence. 
    948948    CollapsedBorders borders;
    949     borders.addBorder(topVal, BSTop, renderTop, tx, ty, tx + w, ty + topWidth, topStyle);
    950     borders.addBorder(bottomVal, BSBottom, renderBottom, tx, ty + h - bottomWidth, tx + w, ty + h, bottomStyle);
    951     borders.addBorder(leftVal, BSLeft, renderLeft, tx, ty, tx + leftWidth, ty + h, leftStyle);
    952     borders.addBorder(rightVal, BSRight, renderRight, tx + w - rightWidth, ty, tx + w, ty + h, rightStyle);
     949    borders.addBorder(topVal, BSTop, renderTop, x, y, x + w, y + topWidth, topStyle);
     950    borders.addBorder(bottomVal, BSBottom, renderBottom, x, y + h - bottomWidth, x + w, y + h, bottomStyle);
     951    borders.addBorder(leftVal, BSLeft, renderLeft, x, y, x + leftWidth, y + h, leftStyle);
     952    borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle);
    953953   
    954954    for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) {
  • trunk/Source/WebCore/rendering/RenderTableCell.h

    r86377 r86449  
    150150    virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
    151151
    152     void paintCollapsedBorder(GraphicsContext*, int x, int y, int w, int h);
     152    void paintCollapsedBorder(GraphicsContext*, const IntRect&);
    153153
    154154    int m_row;
Note: See TracChangeset for help on using the changeset viewer.