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

Unified Diff: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp

Issue 1889793006: Use SkPaint::measureText() for glyph overflow computations Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's see what else breaks Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
index 08cb6622f05186fb2150f82d8b706afa9bff2634..3af6e85ff5c71fb7df328ed03f40f1f714274289 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
@@ -381,10 +381,8 @@ static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bo
{
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
- SkPath path;
- paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path);
- bounds = path.getBounds();
-
+ paint.measureText(&glyph, sizeof(glyph), &bounds);
+ bounds = SkRect::MakeLTRB(bounds.left() - 5, bounds.top() - 5, bounds.right() + 10, bounds.bottom() + 10);
if (!paint.isSubpixelText()) {
SkIRect ir;
bounds.round(&ir);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698