Changeset 88049 in webkit


Ignore:
Timestamp:
Jun 3, 2011 1:55:44 PM (13 years ago)
Author:
leviw@chromium.org
Message:

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

Reviewed by Eric Seidel.

Switch paintItemForeground and paintItemForeground to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=62035

Switching paintItemFore/Background to use IntPoint instead of a pair of ints.

No new tests since this is simple refactoring.

  • rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject): (WebCore::RenderListBox::paintItemForeground): (WebCore::RenderListBox::paintItemBackground):
  • rendering/RenderListBox.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88045 r88049  
     12011-06-03  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch paintItemForeground and paintItemForeground to use IntPoint
     6        https://bugs.webkit.org/show_bug.cgi?id=62035
     7
     8        Switching paintItemFore/Background to use IntPoint instead of a pair of ints.
     9
     10        No new tests since this is simple refactoring.
     11
     12        * rendering/RenderListBox.cpp:
     13        (WebCore::RenderListBox::paintObject):
     14        (WebCore::RenderListBox::paintItemForeground):
     15        (WebCore::RenderListBox::paintItemBackground):
     16        * rendering/RenderListBox.h:
     17
    1182011-06-03  Alexis Menard  <alexis.menard@openbossa.org>
    219
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r87989 r88049  
    267267        int index = m_indexOffset;
    268268        while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
    269             paintItemForeground(paintInfo, tx, ty, index);
     269            paintItemForeground(paintInfo, IntPoint(tx, ty), index);
    270270            index++;
    271271        }
     
    290290        int index = m_indexOffset;
    291291        while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
    292             paintItemBackground(paintInfo, tx, ty, index);
     292            paintItemBackground(paintInfo, IntPoint(tx, ty), index);
    293293            index++;
    294294        }
     
    357357}
    358358
    359 void RenderListBox::paintItemForeground(PaintInfo& paintInfo, int tx, int ty, int listIndex)
     359void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const IntPoint& paintOffset, int listIndex)
    360360{
    361361    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
     
    393393    TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), itemStyle->unicodeBidi() == Override);
    394394    Font itemFont = style()->font();
    395     IntRect r = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
     395    IntRect r = itemBoundingBoxRect(paintOffset, listIndex);
    396396    r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
    397397
     
    408408}
    409409
    410 void RenderListBox::paintItemBackground(PaintInfo& paintInfo, int tx, int ty, int listIndex)
     410void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const IntPoint& paintOffset, int listIndex)
    411411{
    412412    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
     
    427427    if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDEN) {
    428428        ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()->colorSpace() : style()->colorSpace();
    429         IntRect itemRect = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
    430         itemRect.intersect(controlClipRect(IntPoint(tx, ty)));
     429        IntRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
     430        itemRect.intersect(controlClipRect(paintOffset));
    431431        paintInfo.context->fillRect(itemRect, backColor, colorSpace);
    432432    }
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r87443 r88049  
    134134    int listHeight() const;
    135135    void paintScrollbar(PaintInfo&, int tx, int ty);
    136     void paintItemForeground(PaintInfo&, int tx, int ty, int listIndex);
    137     void paintItemBackground(PaintInfo&, int tx, int ty, int listIndex);
     136    void paintItemForeground(PaintInfo&, const IntPoint&, int listIndex);
     137    void paintItemBackground(PaintInfo&, const IntPoint&, int listIndex);
    138138    void scrollToRevealSelection();
    139139
Note: See TracChangeset for help on using the changeset viewer.