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

Side by Side Diff: src/fonts/SkTestScalerContext.cpp

Issue 2030683002: Update typeface serialization style. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 6 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 | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 uint32_t glyphIDsCount) const { 149 uint32_t glyphIDsCount) const {
150 // pdf only 150 // pdf only
151 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; 151 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
152 info->fFontName.set(fTestFont->fName); 152 info->fFontName.set(fTestFont->fName);
153 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); 153 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1);
154 return info; 154 return info;
155 } 155 }
156 156
157 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const { 157 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const {
158 desc->setFamilyName(fTestFont->fName); 158 desc->setFamilyName(fTestFont->fName);
159 desc->setStyle(this->fontStyle());
159 *isLocal = false; 160 *isLocal = false;
160 } 161 }
161 162
162 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, 163 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
163 uint16_t glyphs[], int glyphCount) const { 164 uint16_t glyphs[], int glyphCount) const {
164 SkASSERT(encoding == kUTF16_Encoding); 165 SkASSERT(encoding == kUTF16_Encoding);
165 for (int index = 0; index < glyphCount; ++index) { 166 for (int index = 0; index < glyphCount; ++index) {
166 SkUnichar ch = ((SkUnichar*) chars)[index]; 167 SkUnichar ch = ((SkUnichar*) chars)[index];
167 glyphs[index] = fTestFont->codeToIndex(ch); 168 glyphs[index] = fTestFont->codeToIndex(ch);
168 } 169 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 282
282 private: 283 private:
283 SkTestTypeface* fFace; 284 SkTestTypeface* fFace;
284 SkMatrix fMatrix; 285 SkMatrix fMatrix;
285 }; 286 };
286 287
287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects, 288 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects,
288 const SkDescriptor* desc) const { 289 const SkDescriptor* desc) const {
289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc); 290 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc);
290 } 291 }
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698