OLD | NEW |
---|---|
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const { | 138 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const { |
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); | |
149 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; | |
150 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; | |
151 info->fLastGlyphID = static_cast<uint16_t>(fTestFont->fCharCodesCount - 1); | |
148 info->fEmSize = 0; | 152 info->fEmSize = 0; |
149 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); | 153 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); |
hal.canary
2015/06/11 15:55:44
info->fLastGlyphID gets set twice.
| |
150 info->fStyle = 0; | 154 info->fStyle = 0; |
151 info->fFontName.set(fTestFont->fName); | |
152 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; | |
153 info->fItalicAngle = 0; | 155 info->fItalicAngle = 0; |
154 info->fAscent = 0; | 156 info->fAscent = 0; |
155 info->fDescent = 0; | 157 info->fDescent = 0; |
156 info->fStemV = 0; | 158 info->fStemV = 0; |
157 info->fCapHeight = 0; | 159 info->fCapHeight = 0; |
158 info->fBBox = SkIRect::MakeEmpty(); | 160 info->fBBox = SkIRect::MakeEmpty(); |
159 return info; | 161 return info; |
160 } | 162 } |
161 | 163 |
162 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const { | 164 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 } | 286 } |
285 | 287 |
286 private: | 288 private: |
287 SkTestTypeface* fFace; | 289 SkTestTypeface* fFace; |
288 SkMatrix fMatrix; | 290 SkMatrix fMatrix; |
289 }; | 291 }; |
290 | 292 |
291 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { | 293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { |
292 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); | 294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d esc)); |
293 } | 295 } |
OLD | NEW |