Changeset 87866 in webkit


Ignore:
Timestamp:
Jun 1, 2011 5:46:41 PM (13 years ago)
Author:
leviw@chromium.org
Message:

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

Reviewed by Eric Seidel.

Switch paintCustomHighlight to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=61562

Switching paintCustomHighlight to use an IntPoint for
its paint offset instead of a pair of ints.

No new tests since this is refactoring.

  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): (WebCore::InlineTextBox::paintCustomHighlight):
  • rendering/InlineTextBox.h:
  • rendering/RenderBox.cpp: (WebCore::RenderBox::paintCustomHighlight):
  • rendering/RenderBox.h:
  • rendering/RenderImage.cpp: (WebCore::RenderImage::paintReplaced):
  • rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint):
  • rendering/RenderWidget.cpp: (WebCore::RenderWidget::paint):
  • rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::paintCustomHighlight): (WebCore::RootInlineBox::paint):
  • rendering/RootInlineBox.h:
Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87865 r87866  
     12011-06-01  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch paintCustomHighlight to use IntPoint
     6        https://bugs.webkit.org/show_bug.cgi?id=61562
     7
     8        Switching paintCustomHighlight to use an IntPoint for
     9        its paint offset instead of a pair of ints.
     10
     11        No new tests since this is refactoring.
     12
     13        * rendering/InlineTextBox.cpp:
     14        (WebCore::InlineTextBox::paint):
     15        (WebCore::InlineTextBox::paintCustomHighlight):
     16        * rendering/InlineTextBox.h:
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::paintCustomHighlight):
     19        * rendering/RenderBox.h:
     20        * rendering/RenderImage.cpp:
     21        (WebCore::RenderImage::paintReplaced):
     22        * rendering/RenderListMarker.cpp:
     23        (WebCore::RenderListMarker::paint):
     24        * rendering/RenderWidget.cpp:
     25        (WebCore::RenderWidget::paint):
     26        * rendering/RootInlineBox.cpp:
     27        (WebCore::RootInlineBox::paintCustomHighlight):
     28        (WebCore::RootInlineBox::paint):
     29        * rendering/RootInlineBox.h:
     30
    1312011-06-01  Emil A Eklund  <eae@chromium.org>
    232
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r87753 r87866  
    545545        // Custom highlighters go behind everything else.
    546546        if (styleToUse->highlight() != nullAtom && !context->paintingDisabled())
    547             paintCustomHighlight(adjustedPaintOffset.x(), adjustedPaintOffset.y(), styleToUse->highlight());
     547            paintCustomHighlight(adjustedPaintOffset, styleToUse->highlight());
    548548#endif
    549549
     
    851851#if PLATFORM(MAC)
    852852
    853 void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& type)
     853void InlineTextBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type)
    854854{
    855855    Frame* frame = renderer()->frame();
     
    861861
    862862    RootInlineBox* r = root();
    863     FloatRect rootRect(tx + r->x(), ty + selectionTop(), r->logicalWidth(), selectionHeight());
    864     FloatRect textRect(tx + x(), rootRect.y(), logicalWidth(), rootRect.height());
     863    FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + selectionTop(), r->logicalWidth(), selectionHeight());
     864    FloatRect textRect(paintOffset.x() + x(), rootRect.y(), logicalWidth(), rootRect.height());
    865865
    866866    page->chrome()->client()->paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false);
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r87753 r87866  
    170170    void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin, const CompositionUnderline&);
    171171#if PLATFORM(MAC)
    172     void paintCustomHighlight(int tx, int ty, const AtomicString& type);
     172    void paintCustomHighlight(const IntPoint&, const AtomicString& type);
    173173#endif
    174174
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r87801 r87866  
    10761076#if PLATFORM(MAC)
    10771077
    1078 void RenderBox::paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText)
     1078void RenderBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type, bool behindText)
    10791079{
    10801080    Frame* frame = this->frame();
     
    10881088    RootInlineBox* r = boxWrap ? boxWrap->root() : 0;
    10891089    if (r) {
    1090         FloatRect rootRect(tx + r->x(), ty + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
    1091         FloatRect imageRect(tx + x(), rootRect.y(), width(), rootRect.height());
     1090        FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
     1091        FloatRect imageRect(paintOffset.x() + x(), rootRect.y(), width(), rootRect.height());
    10921092        page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
    10931093    } else {
    1094         FloatRect imageRect(tx + x(), ty + y(), width(), height());
     1094        FloatRect imageRect(paintOffset.x() + x(), paintOffset.y() + y(), width(), height());
    10951095        page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false);
    10961096    }
  • trunk/Source/WebCore/rendering/RenderBox.h

    r87801 r87866  
    422422
    423423#if PLATFORM(MAC)
    424     void paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText);
     424    void paintCustomHighlight(const IntPoint&, const AtomicString& type, bool behindText);
    425425#endif
    426426
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r87801 r87866  
    302302#if PLATFORM(MAC)
    303303        if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    304             paintCustomHighlight(tx - x(), ty - y(), style()->highlight(), true);
     304            paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
    305305#endif
    306306
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r87303 r87866  
    11281128#if PLATFORM(MAC)
    11291129        if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    1130             paintCustomHighlight(tx, ty, style()->highlight(), true);
     1130            paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true);
    11311131#endif
    11321132        context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker);
     
    11421142    // FIXME: paint gap between marker and list item proper
    11431143    if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    1144         paintCustomHighlight(tx, ty, style()->highlight(), true);
     1144        paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true);
    11451145#endif
    11461146
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r86705 r87866  
    269269#if PLATFORM(MAC)
    270270    if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    271         paintCustomHighlight(tx - x(), ty - y(), style()->highlight(), true);
     271        paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
    272272#endif
    273273
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r87753 r87866  
    158158}
    159159
    160 void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)
     160void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const IntPoint& paintOffset, const AtomicString& highlightType)
    161161{
    162162    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
     
    171171
    172172    // Get the inflated rect so that we can properly hit test.
    173     FloatRect rootRect(tx + x(), ty + selectionTop(), logicalWidth(), selectionHeight());
     173    FloatRect rootRect(paintOffset.x() + x(), paintOffset.y() + selectionTop(), logicalWidth(), selectionHeight());
    174174    FloatRect inflatedRect = page->chrome()->client()->customHighlightRect(renderer()->node(), highlightType, rootRect);
    175175    if (inflatedRect.intersects(paintInfo.rect))
     
    186186    RenderStyle* styleToUse = renderer()->style(m_firstLine);
    187187    if (styleToUse->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    188         paintCustomHighlight(paintInfo, paintOffset.x(), paintOffset.y(), styleToUse->highlight());
     188        paintCustomHighlight(paintInfo, paintOffset, styleToUse->highlight());
    189189#endif
    190190}
  • trunk/Source/WebCore/rendering/RootInlineBox.h

    r87753 r87866  
    9393#if PLATFORM(MAC)
    9494    void addHighlightOverflow();
    95     void paintCustomHighlight(PaintInfo&, int tx, int ty, const AtomicString& highlightType);
     95    void paintCustomHighlight(PaintInfo&, const IntPoint&, const AtomicString& highlightType);
    9696#endif
    9797
Note: See TracChangeset for help on using the changeset viewer.