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

Unified Diff: Source/core/platform/chromium/PopupListBox.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed build on win and mac Created 7 years, 7 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
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/platform/graphics/Font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/chromium/PopupListBox.cpp
diff --git a/Source/core/platform/chromium/PopupListBox.cpp b/Source/core/platform/chromium/PopupListBox.cpp
index d353b8cce4ff41e23ba160cc3e2fce159add70db..69d0a44ec906810781a81e59e6950d9216c29dcb 100644
--- a/Source/core/platform/chromium/PopupListBox.cpp
+++ b/Source/core/platform/chromium/PopupListBox.cpp
@@ -472,7 +472,9 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
// Draw the item text.
int textY = rowRect.y() + itemFont.fontMetrics().ascent() + (rowRect.height() - itemFont.fontMetrics().height()) / 2;
- gc->drawBidiText(itemFont, textRun, IntPoint(textX, textY));
+ TextRunPaintInfo textRunPaintInfo(textRun);
+ textRunPaintInfo.bounds = rowRect;
+ gc->drawBidiText(itemFont, textRunPaintInfo, IntPoint(textX, textY));
// We are using the left padding as the right padding includes room for the scroll-bar which
// does not show in this case.
@@ -507,9 +509,11 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
textX = max<int>(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
else
textX = remainingWidth - itemFont.width(labelTextRun);
+ TextRunPaintInfo labelTextRunPaintInfo(labelTextRun);
+ labelTextRunPaintInfo.bounds = rowRect;
gc->setFillColor(labelColor, ColorSpaceDeviceRGB);
- gc->drawBidiText(itemFont, labelTextRun, IntPoint(textX, textY));
+ gc->drawBidiText(itemFont, labelTextRunPaintInfo, IntPoint(textX, textY));
}
Font PopupListBox::getRowFont(int rowIndex)
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/platform/graphics/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698