Changeset 89974 in webkit


Ignore:
Timestamp:
Jun 28, 2011 4:36:28 PM (13 years ago)
Author:
leviw@chromium.org
Message:

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

Reviewed by Eric Seidel.

Switch PaintMask* to new layout types
https://bugs.webkit.org/show_bug.cgi?id=63576

Switching paintMask* to layout type abstraction from more integral types.

No new tests as this is just moving to an abstraction.

  • rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintMask):
  • rendering/InlineFlowBox.h:
  • rendering/RenderBox.cpp: (WebCore::RenderBox::paintMask): (WebCore::RenderBox::paintMaskImages):
  • rendering/RenderBox.h:
  • rendering/RenderFieldset.cpp: (WebCore::RenderFieldset::paintMask):
  • rendering/RenderFieldset.h:
  • rendering/RenderTable.cpp: (WebCore::RenderTable::paintMask):
  • rendering/RenderTable.h:
  • rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintMask):
  • rendering/RenderTableCell.h:
Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89970 r89974  
     12011-06-28  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch PaintMask* to new layout types
     6        https://bugs.webkit.org/show_bug.cgi?id=63576
     7
     8        Switching paintMask* to layout type abstraction from more integral types.
     9
     10        No new tests as this is just moving to an abstraction.
     11
     12        * rendering/InlineFlowBox.cpp:
     13        (WebCore::InlineFlowBox::paintMask):
     14        * rendering/InlineFlowBox.h:
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::paintMask):
     17        (WebCore::RenderBox::paintMaskImages):
     18        * rendering/RenderBox.h:
     19        * rendering/RenderFieldset.cpp:
     20        (WebCore::RenderFieldset::paintMask):
     21        * rendering/RenderFieldset.h:
     22        * rendering/RenderTable.cpp:
     23        (WebCore::RenderTable::paintMask):
     24        * rendering/RenderTable.h:
     25        * rendering/RenderTableCell.cpp:
     26        (WebCore::RenderTableCell::paintMask):
     27        * rendering/RenderTableCell.h:
     28
    1292011-06-28  Levi Weintraub  <leviw@chromium.org>
    230
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r89970 r89974  
    11641164}
    11651165
    1166 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
     1166void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    11671167{
    11681168    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
     
    11701170
    11711171    // Pixel snap mask painting.
    1172     IntRect frameRect = roundedFrameRect();
     1172    LayoutRect frameRect = roundedFrameRect();
    11731173
    11741174    constrainToLineTopAndBottomIfNeeded(frameRect);
    11751175   
    11761176    // Move x/y to our coordinates.
    1177     IntRect localRect(frameRect);
     1177    LayoutRect localRect(frameRect);
    11781178    flipForWritingMode(localRect);
    1179     IntPoint adjustedPaintOffset = paintOffset + localRect.location();
     1179    LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
    11801180
    11811181    const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
     
    11981198    }
    11991199
    1200     IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size());
     1200    LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
    12011201    paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp);
    12021202   
     
    12081208    // cases only a single call to draw is required.
    12091209    if (!prevLineBox() && !nextLineBox()) {
    1210         boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
     1210        boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
    12111211    } else {
    12121212        // We have a mask image that spans multiple lines.
    12131213        // We need to adjust _tx and _ty by the width of all previous lines.
    1214         int logicalOffsetOnLine = 0;
     1214        LayoutUnit logicalOffsetOnLine = 0;
    12151215        for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
    12161216            logicalOffsetOnLine += curr->logicalWidth();
    1217         int totalLogicalWidth = logicalOffsetOnLine;
     1217        LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
    12181218        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    12191219            totalLogicalWidth += curr->logicalWidth();
    1220         int stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
    1221         int stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
    1222         int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
    1223         int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
     1220        LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
     1221        LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
     1222        LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
     1223        LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
    12241224
    12251225        GraphicsContextStateSaver stateSaver(*paintInfo.context);
    12261226        paintInfo.context->clip(paintRect);
    1227         boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);
     1227        boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp);
    12281228    }
    12291229   
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r89970 r89974  
    105105   
    106106    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    107     virtual void paintMask(PaintInfo&, const IntPoint&);
     107    virtual void paintMask(PaintInfo&, const LayoutPoint&);
    108108    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
    109109    void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r89970 r89974  
    879879}
    880880
    881 void RenderBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
     881void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    882882{
    883883    if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
    884884        return;
    885885
    886     IntRect paintRect = IntRect(paintOffset, size());
     886    LayoutRect paintRect = LayoutRect(paintOffset, size());
    887887
    888888    // border-fit can adjust where we paint our border and background.  If set, we snugly fit our line box descendants.  (The iChat
     
    893893}
    894894
    895 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const IntRect& paintRect)
     895void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
    896896{
    897897    // Figure out if we need to push a transparency layer to render our mask.
  • trunk/Source/WebCore/rendering/RenderBox.h

    r89970 r89974  
    355355    virtual void paintObject(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }
    356356    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    357     virtual void paintMask(PaintInfo&, const IntPoint&);
     357    virtual void paintMask(PaintInfo&, const LayoutPoint&);
    358358    virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
    359359
     
    421421    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
    422422
    423     void paintMaskImages(const PaintInfo&, const IntRect&);
     423    void paintMaskImages(const PaintInfo&, const LayoutRect&);
    424424
    425425#if PLATFORM(MAC)
  • trunk/Source/WebCore/rendering/RenderFieldset.cpp

    r88087 r89974  
    169169}
    170170
    171 void RenderFieldset::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
     171void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    172172{
    173173    if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
    174174        return;
    175175
    176     IntRect paintRect = IntRect(paintOffset, size());
     176    LayoutRect paintRect = LayoutRect(paintOffset, size());
    177177    RenderBox* legend = findLegend();
    178178    if (!legend)
     
    183183    // https://bugs.webkit.org/show_bug.cgi?id=47236
    184184    if (style()->isHorizontalWritingMode()) {
    185         int yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
     185        LayoutUnit yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
    186186        paintRect.expand(0, -yOff);
    187187        paintRect.move(0, yOff);
    188188    } else {
    189         int xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
     189        LayoutUnit xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
    190190        paintRect.expand(-xOff, 0);
    191191        paintRect.move(xOff, 0);
  • trunk/Source/WebCore/rendering/RenderFieldset.h

    r88087 r89974  
    4646
    4747    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    48     virtual void paintMask(PaintInfo&, const IntPoint&);
     48    virtual void paintMask(PaintInfo&, const LayoutPoint&);
    4949};
    5050
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r88319 r89974  
    573573}
    574574
    575 void RenderTable::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
     575void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    576576{
    577577    if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
    578578        return;
    579579
    580     IntRect rect(paintOffset, size());
     580    LayoutRect rect(paintOffset, size());
    581581    subtractCaptionRect(rect);
    582582
  • trunk/Source/WebCore/rendering/RenderTable.h

    r88319 r89974  
    218218    virtual void paintObject(PaintInfo&, const IntPoint&);
    219219    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    220     virtual void paintMask(PaintInfo&, const IntPoint&);
     220    virtual void paintMask(PaintInfo&, const LayoutPoint&);
    221221    virtual void layout();
    222222    virtual void computePreferredLogicalWidths();
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r88250 r89974  
    10201020}
    10211021
    1022 void RenderTableCell::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
     1022void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    10231023{
    10241024    if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
     
    10291029        return;
    10301030   
    1031     paintMaskImages(paintInfo, IntRect(paintOffset, size()));
     1031    paintMaskImages(paintInfo, LayoutRect(paintOffset, size()));
    10321032}
    10331033
  • trunk/Source/WebCore/rendering/RenderTableCell.h

    r88250 r89974  
    144144
    145145    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    146     virtual void paintMask(PaintInfo&, const IntPoint&);
     146    virtual void paintMask(PaintInfo&, const LayoutPoint&);
    147147
    148148    virtual IntSize offsetFromContainer(RenderObject*, const IntPoint&) const;
Note: See TracChangeset for help on using the changeset viewer.