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

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: implemented TextRun wrapper Created 7 years, 8 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/WebKit/chromium/src/WebFontImpl.cpp
diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp
index 6797602de90760fea8f4ffc9ca7c54039ccf2fe3..f14ac2691f02878644dcfb9cdd97dcd9c3c66b73 100644
--- a/Source/WebKit/chromium/src/WebFontImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFontImpl.cpp
@@ -94,6 +94,11 @@ 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;
GraphicsContextBuilder builder(canvas);
GraphicsContext& gc = builder.context();
@@ -101,8 +106,8 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl
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/PlatformContextSkiaTest.cpp » ('j') | Source/core/platform/graphics/Font.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698