| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 149 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; |
| 150 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; | 150 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; |
| 151 info->fLastGlyphID = static_cast<uint16_t>(fTestFont->fCharCodesCount - 1); | 151 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); |
| 152 info->fEmSize = 0; | 152 info->fEmSize = 0; |
| 153 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); | |
| 154 info->fStyle = 0; | 153 info->fStyle = 0; |
| 155 info->fItalicAngle = 0; | 154 info->fItalicAngle = 0; |
| 156 info->fAscent = 0; | 155 info->fAscent = 0; |
| 157 info->fDescent = 0; | 156 info->fDescent = 0; |
| 158 info->fStemV = 0; | 157 info->fStemV = 0; |
| 159 info->fCapHeight = 0; | 158 info->fCapHeight = 0; |
| 160 info->fBBox = SkIRect::MakeEmpty(); | 159 info->fBBox = SkIRect::MakeEmpty(); |
| 161 return info; | 160 return info; |
| 162 } | 161 } |
| 163 | 162 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 285 } |
| 287 | 286 |
| 288 private: | 287 private: |
| 289 SkTestTypeface* fFace; | 288 SkTestTypeface* fFace; |
| 290 SkMatrix fMatrix; | 289 SkMatrix fMatrix; |
| 291 }; | 290 }; |
| 292 | 291 |
| 293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
| 294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
| 295 } | 294 } |
| OLD | NEW |