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

Side by Side Diff: src/core/SkAdvancedTypefaceMetrics.h

Issue 1955053002: SkAdvancedTypefaceMetrics: getAdvanceData uses std::function (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typedef Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkAdvancedTypefaceMetrics.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkAdvancedTypefaceMetrics_DEFINED 9 #ifndef SkAdvancedTypefaceMetrics_DEFINED
10 #define SkAdvancedTypefaceMetrics_DEFINED 10 #define SkAdvancedTypefaceMetrics_DEFINED
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 @param glyphIDs For per-glyph info, specify subset of the 48 @param glyphIDs For per-glyph info, specify subset of the
49 font by giving glyph ids. Each integer 49 font by giving glyph ids. Each integer
50 represents a glyph id. Passing nullptr 50 represents a glyph id. Passing nullptr
51 means all glyphs in the font. 51 means all glyphs in the font.
52 @param glyphIDsCount Number of elements in subsetGlyphIds. 52 @param glyphIDsCount Number of elements in subsetGlyphIds.
53 Ignored if glyphIDs is nullptr. 53 Ignored if glyphIDs is nullptr.
54 @param getAdvance A function that takes a glyph id and 54 @param getAdvance A function that takes a glyph id and
55 passes back advance data from the 55 passes back advance data from the
56 typeface. Returns false on failure. 56 typeface. Returns false on failure.
57 */ 57 */
58 template <typename FontHandle> 58 typedef std::function<bool(int glyphId, int16_t* advanceData)> GetAdvance;
59 void setGlyphWidths(FontHandle fontHandle, 59 void setGlyphWidths(int num_glyphs,
60 int num_glyphs,
61 const uint32_t* subsetGlyphIDs, 60 const uint32_t* subsetGlyphIDs,
62 uint32_t subsetGlyphIDsLength, 61 uint32_t subsetGlyphIDsLength,
63 bool (*getAdvance)(FontHandle fontHandle, 62 GetAdvance getAdvance);
64 int gId,
65 int16_t* data));
66 63
67 SkString fFontName; 64 SkString fFontName;
68 65
69 enum FontType { 66 enum FontType {
70 kType1_Font, 67 kType1_Font,
71 kType1CID_Font, 68 kType1CID_Font,
72 kCFF_Font, 69 kCFF_Font,
73 kTrueType_Font, 70 kTrueType_Font,
74 kOther_Font, 71 kOther_Font,
75 }; 72 };
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 static void FinishRange(WidthRange* range, 160 static void FinishRange(WidthRange* range,
164 int endId, 161 int endId,
165 WidthRange::MetricType type); 162 WidthRange::MetricType type);
166 163
167 private: 164 private:
168 typedef SkRefCnt INHERITED; 165 typedef SkRefCnt INHERITED;
169 }; 166 };
170 167
171 168
172 #endif 169 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkAdvancedTypefaceMetrics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698