Changeset 88196 in webkit


Ignore:
Timestamp:
Jun 6, 2011 3:27:19 PM (13 years ago)
Author:
leviw@chromium.org
Message:

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

Reviewed by Eric Seidel.

Switch InlineFlowBox::paintMask to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=62156

Switching InlineFlowBox::paintMask to take an IntPoint representing the paint
offset instead of a pair of ints.

No new tests as this is simple refactoring.

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88195 r88196  
     12011-06-06  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch InlineFlowBox::paintMask to use IntPoint
     6        https://bugs.webkit.org/show_bug.cgi?id=62156
     7
     8        Switching InlineFlowBox::paintMask to take an IntPoint representing the paint
     9        offset instead of a pair of ints.
     10
     11        No new tests as this is simple refactoring.
     12
     13        * rendering/InlineFlowBox.cpp:
     14        (WebCore::InlineFlowBox::paint):
     15        (WebCore::InlineFlowBox::paintMask):
     16        * rendering/InlineFlowBox.h:
     17
    1182011-06-06  Emil A Eklund  <eae@chromium.org>
    219
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r88033 r88196  
    992992            }
    993993        } else if (paintInfo.phase == PaintPhaseMask) {
    994             paintMask(paintInfo, paintOffset.x(), paintOffset.y());
     994            paintMask(paintInfo, paintOffset);
    995995            return;
    996996        } else {
     
    11641164}
    11651165
    1166 void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
     1166void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset)
    11671167{
    11681168    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
     
    11771177    IntRect localRect(frameRect);
    11781178    flipForWritingMode(localRect);
    1179     tx += localRect.x();
    1180     ty += localRect.y();
     1179    IntPoint adjustedPaintOffset = paintOffset + localRect.location();
    11811180
    11821181    const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
     
    11991198    }
    12001199
    1201     IntRect paintRect = IntRect(IntPoint(tx, ty), frameRect.size());
     1200    IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size());
    12021201    paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp);
    12031202   
     
    12091208    // cases only a single call to draw is required.
    12101209    if (!prevLineBox() && !nextLineBox()) {
    1211         boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(IntPoint(tx, ty), frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
     1210        boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp);
    12121211    } else {
    12131212        // We have a mask image that spans multiple lines.
     
    12191218        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    12201219            totalLogicalWidth += curr->logicalWidth();
    1221         int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0);
    1222         int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine);
     1220        int stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
     1221        int stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
    12231222        int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
    12241223        int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r88033 r88196  
    105105   
    106106    virtual void paintBoxDecorations(PaintInfo&, const IntPoint&);
    107     virtual void paintMask(PaintInfo&, int tx, int ty);
     107    virtual void paintMask(PaintInfo&, const IntPoint&);
    108108    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
    109109    void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
Note: See TracChangeset for help on using the changeset viewer.