Changeset 109246 in webkit


Ignore:
Timestamp:
Feb 29, 2012 12:49:49 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

Stop doubling maximalOutlineSize during painting
https://bugs.webkit.org/show_bug.cgi?id=79724

Reviewed by Tony Chang.

Refactoring only, covered by existing tests (mostly repaint ones).

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::shouldPaint):

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::paintCollapsedBorders):
Introduce a local repaint rectangle that we inflate by the maximalOutlineSize
to simplify the comparison logic. Also tried to make it clearer what's going on
by tweaking the existing code.

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::paintObject):
Remove the doubling.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109245 r109246  
     12012-02-29  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Stop doubling maximalOutlineSize during painting
     4        https://bugs.webkit.org/show_bug.cgi?id=79724
     5
     6        Reviewed by Tony Chang.
     7
     8        Refactoring only, covered by existing tests (mostly repaint ones).
     9
     10        * rendering/RenderReplaced.cpp:
     11        (WebCore::RenderReplaced::shouldPaint):
     12        * rendering/RenderTableCell.cpp:
     13        (WebCore::RenderTableCell::paintCollapsedBorders):
     14        Introduce a local repaint rectangle that we inflate by the maximalOutlineSize
     15        to simplify the comparison logic. Also tried to make it clearer what's going on
     16        by tweaking the existing code.
     17
     18        * rendering/RenderTableSection.cpp:
     19        (WebCore::RenderTableSection::paintObject):
     20        Remove the doubling.
     21
    1222012-02-29  Ken Buchanan  <kenrb@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r109104 r109246  
    197197    }
    198198   
    199     LayoutUnit os = 2 * maximalOutlineSize(paintInfo.phase);
    200     if (adjustedPaintOffset.x() + minXVisualOverflow() >= paintInfo.rect.maxX() + os || adjustedPaintOffset.x() + maxXVisualOverflow() <= paintInfo.rect.x() - os)
    201         return false;
    202     if (top >= paintInfo.rect.maxY() + os || bottom <= paintInfo.rect.y() - os)
     199    LayoutRect localRepaintRect = paintInfo.rect;
     200    localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
     201    if (adjustedPaintOffset.x() + minXVisualOverflow() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + maxXVisualOverflow() <= localRepaintRect.x())
     202        return false;
     203
     204    if (top >= localRepaintRect.maxY() || bottom <= localRepaintRect.y())
    203205        return false;
    204206
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r108914 r109246  
    961961        return;
    962962
    963     LayoutPoint adjustedPaintOffset = paintOffset + location();
    964     LayoutUnit os = 2 * maximalOutlineSize(paintInfo.phase);
    965     if (!(adjustedPaintOffset.y() - table()->outerBorderTop() < paintInfo.rect.maxY() + os
    966         && adjustedPaintOffset.y() + height() + table()->outerBorderBottom() > paintInfo.rect.y() - os))
     963    LayoutRect localRepaintRect = paintInfo.rect;
     964    localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
     965
     966    LayoutRect paintRect = LayoutRect(paintOffset + location(), size());
     967    if (paintRect.y() - table()->outerBorderTop() >= localRepaintRect.maxY())
     968        return;
     969
     970    if (paintRect.maxY() + table()->outerBorderBottom() <= localRepaintRect.y())
    967971        return;
    968972
     
    970974    if (!table()->currentBorderValue() || graphicsContext->paintingDisabled())
    971975        return;
    972 
    973     LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
    974976
    975977    RenderStyle* tableStyle = table()->style();
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r109042 r109246  
    10611061    }
    10621062
    1063     // FIXME: Why do we double the outline size?
    1064     LayoutUnit outlineSize = 2 * maximalOutlineSize(paintPhase);
    1065     localRepaintRect.inflate(outlineSize);
     1063    localRepaintRect.inflate(maximalOutlineSize(paintPhase));
    10661064
    10671065    CellSpan dirtiedRows = this->dirtiedRows(localRepaintRect);
Note: See TracChangeset for help on using the changeset viewer.