Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1631)

Unified Diff: Source/core/rendering/RenderListBox.cpp

Issue 21430003: Implement interfaces in PaintInfo and make it a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getterPaintInfo01
Patch Set: Second try Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderListBox.cpp
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 1771c60935b7dc3bdfcecd4b44dd71b3b1c74ffe..bd620f215a84be025f1459c32585c87b5c8d28bc 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -289,7 +289,7 @@ void RenderListBox::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOf
int listItemsSize = numItems();
- if (paintInfo.phase == PaintPhaseForeground) {
+ if (paintInfo.getPhase() == PaintPhaseForeground) {
int index = m_indexOffset;
while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
paintItemForeground(paintInfo, paintOffset, index);
@@ -300,7 +300,7 @@ void RenderListBox::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOf
// Paint the children.
RenderBlock::paintObject(paintInfo, paintOffset);
- switch (paintInfo.phase) {
+ switch (paintInfo.getPhase()) {
// Depending on whether we have overlay scrollbars they
// get rendered in the foreground or background phases
case PaintPhaseForeground:
@@ -359,7 +359,7 @@ void RenderListBox::paintScrollbar(PaintInfo& paintInfo, const LayoutPoint& pain
m_vBar->width(),
height() - (borderTop() + borderBottom()));
m_vBar->setFrameRect(scrollRect);
- m_vBar->paint(paintInfo.context, paintInfo.rect);
+ m_vBar->paint(paintInfo.getContext(), paintInfo.getRect());
}
}
@@ -416,7 +416,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
textColor = theme()->inactiveListBoxSelectionForegroundColor();
}
- paintInfo.context->setFillColor(textColor);
+ paintInfo.getContext()->setFillColor(textColor);
TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
Font itemFont = style()->font();
@@ -433,7 +433,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
// Draw the item text
TextRunPaintInfo textRunPaintInfo(textRun);
textRunPaintInfo.bounds = r;
- paintInfo.context->drawBidiText(itemFont, textRunPaintInfo, roundedIntPoint(r.location()));
+ paintInfo.getContext()->drawBidiText(itemFont, textRunPaintInfo, roundedIntPoint(r.location()));
}
void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex)
@@ -455,7 +455,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint&
if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDEN) {
LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
itemRect.intersect(controlClipRect(paintOffset));
- paintInfo.context->fillRect(pixelSnappedIntRect(itemRect), backColor);
+ paintInfo.getContext()->fillRect(pixelSnappedIntRect(itemRect), backColor);
}
}

Powered by Google App Engine
This is Rietveld 408576698