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

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

Issue 1129283003: Make SkAdvancedTypefaceMetrics private. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « src/fonts/SkTestScalerContext.h ('k') | src/pdf/SkPDFFont.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 "SkBitmap.h" 9 #include "SkBitmap.h"
9 #include "SkCanvas.h" 10 #include "SkCanvas.h"
10 #include "SkDescriptor.h" 11 #include "SkDescriptor.h"
11 #include "SkFontDescriptor.h" 12 #include "SkFontDescriptor.h"
12 #include "SkGlyph.h" 13 #include "SkGlyph.h"
13 #include "SkMask.h" 14 #include "SkMask.h"
14 // #include "SkOTUtils.h" 15 // #include "SkOTUtils.h"
15 #include "SkScalerContext.h" 16 #include "SkScalerContext.h"
16 #include "SkTestScalerContext.h" 17 #include "SkTestScalerContext.h"
17 #include "SkTypefaceCache.h" 18 #include "SkTypefaceCache.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void SkTestTypeface::getPath(const SkGlyph& glyph, SkPath* path) { 134 void SkTestTypeface::getPath(const SkGlyph& glyph, SkPath* path) {
134 *path = *fTestFont->fPaths[glyph.getGlyphID()]; 135 *path = *fTestFont->fPaths[glyph.getGlyphID()];
135 } 136 }
136 137
137 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const { 138 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const {
138 rec->setHinting(SkPaint::kNo_Hinting); 139 rec->setHinting(SkPaint::kNo_Hinting);
139 rec->fMaskFormat = SkMask::kA8_Format; 140 rec->fMaskFormat = SkMask::kA8_Format;
140 } 141 }
141 142
142 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics( 143 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics(
143 SkAdvancedTypefaceMetrics::PerGlyphInfo , 144 PerGlyphInfo ,
144 const uint32_t* glyphIDs, 145 const uint32_t* glyphIDs,
145 uint32_t glyphIDsCount) const { 146 uint32_t glyphIDsCount) const {
146 // pdf only 147 // pdf only
147 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; 148 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
148 info->fEmSize = 0; 149 info->fEmSize = 0;
149 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); 150 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1);
150 info->fStyle = 0; 151 info->fStyle = 0;
151 info->fFontName.set(fTestFont->fName); 152 info->fFontName.set(fTestFont->fName);
152 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; 153 info->fType = SkAdvancedTypefaceMetrics::kOther_Font;
153 info->fItalicAngle = 0; 154 info->fItalicAngle = 0;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 286 }
286 287
287 private: 288 private:
288 SkTestTypeface* fFace; 289 SkTestTypeface* fFace;
289 SkMatrix fMatrix; 290 SkMatrix fMatrix;
290 }; 291 };
291 292
292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); 294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc));
294 } 295 }
OLDNEW
« no previous file with comments | « src/fonts/SkTestScalerContext.h ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698