Title: [88049] trunk/Source/WebCore
Revision
88049
Author
[email protected]
Date
2011-06-03 13:55:44 -0700 (Fri, 03 Jun 2011)

Log Message

2011-06-03  Levi Weintraub  <[email protected]>

        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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88048 => 88049)


--- trunk/Source/WebCore/ChangeLog	2011-06-03 20:53:47 UTC (rev 88048)
+++ trunk/Source/WebCore/ChangeLog	2011-06-03 20:55:44 UTC (rev 88049)
@@ -1,3 +1,20 @@
+2011-06-03  Levi Weintraub  <[email protected]>
+
+        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:
+
 2011-06-03  Alexis Menard  <[email protected]>
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (88048 => 88049)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-06-03 20:53:47 UTC (rev 88048)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-06-03 20:55:44 UTC (rev 88049)
@@ -266,7 +266,7 @@
     if (paintInfo.phase == PaintPhaseForeground) {
         int index = m_indexOffset;
         while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
-            paintItemForeground(paintInfo, tx, ty, index);
+            paintItemForeground(paintInfo, IntPoint(tx, ty), index);
             index++;
         }
     }
@@ -289,7 +289,7 @@
     case PaintPhaseChildBlockBackgrounds: {
         int index = m_indexOffset;
         while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
-            paintItemBackground(paintInfo, tx, ty, index);
+            paintItemBackground(paintInfo, IntPoint(tx, ty), index);
             index++;
         }
         break;
@@ -356,7 +356,7 @@
     return offset;
 }
 
-void RenderListBox::paintItemForeground(PaintInfo& paintInfo, int tx, int ty, int listIndex)
+void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const IntPoint& paintOffset, int listIndex)
 {
     SelectElement* select = toSelectElement(static_cast<Element*>(node()));
     const Vector<Element*>& listItems = select->listItems();
@@ -392,7 +392,7 @@
     const UChar* string = itemText.characters();
     TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), itemStyle->unicodeBidi() == Override);
     Font itemFont = style()->font();
-    IntRect r = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
+    IntRect r = itemBoundingBoxRect(paintOffset, listIndex);
     r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
 
     if (isOptionGroupElement(element)) {
@@ -407,7 +407,7 @@
         paintInfo.context->drawBidiText(itemFont, textRun, r.location());
 }
 
-void RenderListBox::paintItemBackground(PaintInfo& paintInfo, int tx, int ty, int listIndex)
+void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const IntPoint& paintOffset, int listIndex)
 {
     SelectElement* select = toSelectElement(static_cast<Element*>(node()));
     const Vector<Element*>& listItems = select->listItems();
@@ -426,8 +426,8 @@
     // Draw the background for this list box item
     if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDEN) {
         ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()->colorSpace() : style()->colorSpace();
-        IntRect itemRect = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
-        itemRect.intersect(controlClipRect(IntPoint(tx, ty)));
+        IntRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
+        itemRect.intersect(controlClipRect(paintOffset));
         paintInfo.context->fillRect(itemRect, backColor, colorSpace);
     }
 }

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (88048 => 88049)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2011-06-03 20:53:47 UTC (rev 88048)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2011-06-03 20:55:44 UTC (rev 88049)
@@ -133,8 +133,8 @@
     int numItems() const;
     int listHeight() const;
     void paintScrollbar(PaintInfo&, int tx, int ty);
-    void paintItemForeground(PaintInfo&, int tx, int ty, int listIndex);
-    void paintItemBackground(PaintInfo&, int tx, int ty, int listIndex);
+    void paintItemForeground(PaintInfo&, const IntPoint&, int listIndex);
+    void paintItemBackground(PaintInfo&, const IntPoint&, int listIndex);
     void scrollToRevealSelection();
 
     bool m_optionsChanged;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to