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

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

Issue 1221903004: SkAdvancedTypefaceMetrics zeroing constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/core/SkAdvancedTypefaceMetrics.h ('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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 rec->setHinting(SkPaint::kNo_Hinting); 139 rec->setHinting(SkPaint::kNo_Hinting);
140 } 140 }
141 141
142 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics( 142 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics(
143 PerGlyphInfo , 143 PerGlyphInfo ,
144 const uint32_t* glyphIDs, 144 const uint32_t* glyphIDs,
145 uint32_t glyphIDsCount) const { 145 uint32_t glyphIDsCount) const {
146 // pdf only 146 // pdf only
147 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; 147 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
148 info->fFontName.set(fTestFont->fName); 148 info->fFontName.set(fTestFont->fName);
149 info->fType = SkAdvancedTypefaceMetrics::kOther_Font;
150 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag;
151 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); 149 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1);
152 info->fEmSize = 0;
153 info->fStyle = 0;
154 info->fItalicAngle = 0;
155 info->fAscent = 0;
156 info->fDescent = 0;
157 info->fStemV = 0;
158 info->fCapHeight = 0;
159 info->fBBox = SkIRect::MakeEmpty();
160 return info; 150 return info;
161 } 151 }
162 152
163 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const { 153 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const {
164 desc->setFamilyName(fTestFont->fName); 154 desc->setFamilyName(fTestFont->fName);
165 *isLocal = false; 155 *isLocal = false;
166 } 156 }
167 157
168 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, 158 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding,
169 uint16_t glyphs[], int glyphCount) const { 159 uint16_t glyphs[], int glyphCount) const {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 275 }
286 276
287 private: 277 private:
288 SkTestTypeface* fFace; 278 SkTestTypeface* fFace;
289 SkMatrix fMatrix; 279 SkMatrix fMatrix;
290 }; 280 };
291 281
292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 282 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); 283 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc));
294 } 284 }
OLDNEW
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698