Changeset 107889 in webkit


Ignore:
Timestamp:
Feb 15, 2012 11:04:15 PM (12 years ago)
Author:
eae@chromium.org
Message:

Convert RenderFrameSet to LayoutUnits in preparation for turning on subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=78526

Reviewed by Eric Seidel.

Revert paintColumnBorder and paintRowBorder to IntRect and pixel snap in
paint before calling them. This way the rounding logic is contained in a
single place (in paint).

No new tests, no new functionality.

  • rendering/RenderFrameSet.cpp:

(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
(WebCore::RenderFrameSet::paint):
(WebCore::RenderFrameSet::getCursor):

  • rendering/RenderFrameSet.h:

(RenderFrameSet):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r107887 r107889  
     12012-02-15  Emil A Eklund  <eae@chromium.org>
     2
     3        Convert RenderFrameSet to LayoutUnits in preparation for turning on subpixel layout
     4        https://bugs.webkit.org/show_bug.cgi?id=78526
     5
     6        Reviewed by Eric Seidel.
     7
     8        Revert paintColumnBorder and paintRowBorder to IntRect and pixel snap in
     9        paint before calling them. This way the rounding logic is contained in a
     10        single place (in paint).
     11
     12        No new tests, no new functionality.
     13
     14        * rendering/RenderFrameSet.cpp:
     15        (WebCore::RenderFrameSet::paintColumnBorder):
     16        (WebCore::RenderFrameSet::paintRowBorder):
     17        (WebCore::RenderFrameSet::paint):
     18        (WebCore::RenderFrameSet::getCursor):
     19        * rendering/RenderFrameSet.h:
     20        (RenderFrameSet):
     21
    1222012-02-15  Emil A Eklund  <eae@chromium.org> and Levi Weintraub  <leviw@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r107461 r107889  
    8181}
    8282
    83 void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    84 {
    85     if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
     83void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
     84{
     85    if (!paintInfo.rect.intersects(borderRect))
    8686        return;
    8787       
     
    101101}
    102102
    103 void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    104 {
    105     if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
     103void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
     104{
     105    if (!paintInfo.rect.intersects(borderRect))
    106106        return;
    107107
     
    143143            xPos += m_cols.m_sizes[c];
    144144            if (borderThickness && m_cols.m_allowBorder[c + 1]) {
    145                 paintColumnBorder(paintInfo, LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffset.y() + yPos, borderThickness, height()));
     145                paintColumnBorder(paintInfo, pixelSnappedIntRect(LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffset.y() + yPos, borderThickness, height())));
    146146                xPos += borderThickness;
    147147            }
     
    152152        yPos += m_rows.m_sizes[r];
    153153        if (borderThickness && m_rows.m_allowBorder[r + 1]) {
    154             paintRowBorder(paintInfo, LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yPos, width(), borderThickness));
     154            paintRowBorder(paintInfo, pixelSnappedIntRect(LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yPos, width(), borderThickness)));
    155155            yPos += borderThickness;
    156156        }
     
    803803CursorDirective RenderFrameSet::getCursor(const LayoutPoint& point, Cursor& cursor) const
    804804{
    805     if (canResizeRow(roundedIntPoint(point))) {
     805    IntPoint roundedPoint = roundedIntPoint(point);
     806    if (canResizeRow(roundedPoint)) {
    806807        cursor = rowResizeCursor();
    807808        return SetCursor;
    808809    }
    809     if (canResizeColumn(point)) {
     810    if (canResizeColumn(roundedPoint)) {
    810811        cursor = columnResizeCursor();
    811812        return SetCursor;
  • trunk/Source/WebCore/rendering/RenderFrameSet.h

    r107009 r107889  
    6969    bool isResizingColumn() const;
    7070
    71     bool canResizeRow(const LayoutPoint&) const;
    72     bool canResizeColumn(const LayoutPoint&) const;
     71    bool canResizeRow(const IntPoint&) const;
     72    bool canResizeColumn(const IntPoint&) const;
    7373
    7474    void notifyFrameEdgeInfoChanged();
     
    120120    void continueResizing(GridAxis&, int position);
    121121
    122     void paintRowBorder(const PaintInfo&, const LayoutRect&);
    123     void paintColumnBorder(const PaintInfo&, const LayoutRect&);
     122    void paintRowBorder(const PaintInfo&, const IntRect&);
     123    void paintColumnBorder(const PaintInfo&, const IntRect&);
    124124
    125125    RenderObjectChildList m_children;
Note: See TracChangeset for help on using the changeset viewer.