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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.h

Issue 2416603002: Add ability to compute text intercepts to Font (Closed)
Patch Set: Rebased Created 4 years, 2 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: third_party/WebKit/Source/platform/fonts/Font.h
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h
index bff7ab2b0ded9a9ba7b53770ea2e1d11a38d1433..3ab36edcc2db0c466e1c080752d3d7b958c0954e 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -101,6 +101,20 @@ class PLATFORM_EXPORT Font {
float deviceScaleFactor,
const SkPaint&) const;
+ // This method follows the behavior and allocation model of the underlying
+ // Skia function: Return the number of intervals that intersect the intercept
+ // along the axis of the advance. The return count is zero or a multiple of
+ // two, and is at most the number of glyphs * 2 in TextRun part of
pdr. 2016/10/14 04:40:56 Super nit: Add "the", remove the second period. ".
drott 2016/10/14 15:16:44 I changed the signature of this method and the com
+ // TextRunPaintInfo.. The caller may pass nullptr for intervals to determine
+ // the size of the interval array.
+ // TODO(drott): crbug.com/655154 Fix this for upright in vertical.
+ int getTextIntercepts(SkCanvas*,
f(malita) 2016/10/13 18:09:19 SkCanvas param doesn't seem needed.
drott 2016/10/14 15:15:34 Ah true, thanks - I initially thought I needed it,
+ const TextRunPaintInfo&,
+ float deviceScaleFactor,
+ const SkPaint&,
+ const SkScalar* bounds,
+ SkScalar* intervals) const;
f(malita) 2016/10/13 18:09:19 I'm not necessarily opposed to following Skia's si
drott 2016/10/14 15:15:34 Good idea, looks better and less alien on the Blin
+
// Glyph bounds will be the minimum rect containing all glyph strokes, in
// coordinates using (<text run x position>, <baseline position>) as the
// origin.
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/Font.cpp » ('j') | third_party/WebKit/Source/platform/fonts/Font.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698