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

Unified Diff: Source/WebKit/chromium/src/WebFontImpl.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 | « no previous file | Source/WebKit/chromium/tests/GraphicsContextTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebFontImpl.cpp
diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp
index 2f7fce86a73174b4388d2fac8a2ae62c51a00f76..b6d16197a415181ee66fb19101323f4ed5689a26 100644
--- a/Source/WebKit/chromium/src/WebFontImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFontImpl.cpp
@@ -93,13 +93,18 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl
int from, int to) const
{
FontCachePurgePreventer fontCachePurgePreventer;
+ WebCore::FloatRect textClipRect(clip);
+ TextRunPaintInfo runInfo(run);
+ runInfo.from = from;
+ runInfo.to = to;
+ runInfo.bounds = textClipRect;
GraphicsContext gc(canvas);
gc.save();
gc.setShouldSmoothFonts(canvasIsOpaque);
gc.setFillColor(color, ColorSpaceDeviceRGB);
- gc.clip(WebCore::FloatRect(clip));
- m_font.drawText(&gc, run, leftBaseline, from, to);
+ gc.clip(textClipRect);
+ m_font.drawText(&gc, runInfo, leftBaseline);
gc.restore();
#if defined(WIN32)
« no previous file with comments | « no previous file | Source/WebKit/chromium/tests/GraphicsContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698