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

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

Issue 2067583002: Revert of Update typeface serialization style. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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());
160 *isLocal = false; 159 *isLocal = false;
161 } 160 }
162 161
163 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, 162 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
164 uint16_t glyphs[], int glyphCount) const { 163 uint16_t glyphs[], int glyphCount) const {
165 SkASSERT(encoding == kUTF16_Encoding); 164 SkASSERT(encoding == kUTF16_Encoding);
166 for (int index = 0; index < glyphCount; ++index) { 165 for (int index = 0; index < glyphCount; ++index) {
167 SkUnichar ch = ((SkUnichar*) chars)[index]; 166 SkUnichar ch = ((SkUnichar*) chars)[index];
168 glyphs[index] = fTestFont->codeToIndex(ch); 167 glyphs[index] = fTestFont->codeToIndex(ch);
169 } 168 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 281
283 private: 282 private:
284 SkTestTypeface* fFace; 283 SkTestTypeface* fFace;
285 SkMatrix fMatrix; 284 SkMatrix fMatrix;
286 }; 285 };
287 286
288 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects, 287 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffe cts& effects,
289 const SkDescriptor* desc) const { 288 const SkDescriptor* desc) const {
290 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc); 289 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, d esc);
291 } 290 }
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