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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDescriptor.h" | 10 #include "SkDescriptor.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 path->close(); | 103 path->close(); |
104 break; | 104 break; |
105 default: | 105 default: |
106 SkDEBUGFAIL("bad verb"); | 106 SkDEBUGFAIL("bad verb"); |
107 return; | 107 return; |
108 } | 108 } |
109 } | 109 } |
110 fPaths[index] = path; | 110 fPaths[index] = path; |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, SkTypeface::Style style) | 114 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style) |
115 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) | 115 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) |
116 , fTestFont(testFont) { | 116 , fTestFont(testFont) { |
117 } | 117 } |
118 | 118 |
119 void SkTestTypeface::getAdvance(SkGlyph* glyph) { | 119 void SkTestTypeface::getAdvance(SkGlyph* glyph) { |
120 glyph->fAdvanceX = fTestFont->fWidths[SkGlyph::ID2Code(glyph->fID)]; | 120 glyph->fAdvanceX = fTestFont->fWidths[SkGlyph::ID2Code(glyph->fID)]; |
121 glyph->fAdvanceY = 0; | 121 glyph->fAdvanceY = 0; |
122 } | 122 } |
123 | 123 |
124 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) { | 124 void SkTestTypeface::getFontMetrics(SkPaint::FontMetrics* metrics) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 288 } |
289 | 289 |
290 private: | 290 private: |
291 SkTestTypeface* fFace; | 291 SkTestTypeface* fFace; |
292 SkMatrix fMatrix; | 292 SkMatrix fMatrix; |
293 }; | 293 }; |
294 | 294 |
295 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 295 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
296 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 296 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
297 } | 297 } |
OLD | NEW |