OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkRandomScalerContext.h" | 8 #include "SkRandomScalerContext.h" |
9 #include "SkGlyph.h" | 9 #include "SkGlyph.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return fProxy->charToGlyphID(uni); | 53 return fProxy->charToGlyphID(uni); |
54 } | 54 } |
55 | 55 |
56 void SkRandomScalerContext::generateAdvance(SkGlyph* glyph) { | 56 void SkRandomScalerContext::generateAdvance(SkGlyph* glyph) { |
57 fProxy->getAdvance(glyph); | 57 fProxy->getAdvance(glyph); |
58 } | 58 } |
59 | 59 |
60 void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) { | 60 void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) { |
61 // Here we will change the mask format of the glyph | 61 // Here we will change the mask format of the glyph |
62 // NOTE this is being overridden by the base class | 62 // NOTE this is being overridden by the base class |
63 SkMask::Format format; | 63 SkMask::Format format = SkMask::kARGB32_Format; // init to handle defective
compilers |
64 switch (glyph->getGlyphID() % 4) { | 64 switch (glyph->getGlyphID() % 4) { |
65 case 0: | 65 case 0: |
66 format = SkMask::kLCD16_Format; | 66 format = SkMask::kLCD16_Format; |
67 break; | 67 break; |
68 case 1: | 68 case 1: |
69 format = SkMask::kA8_Format; | 69 format = SkMask::kA8_Format; |
70 break; | 70 break; |
71 case 2: | 71 case 2: |
72 format = SkMask::kARGB32_Format; | 72 format = SkMask::kARGB32_Format; |
73 break; | 73 break; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 int SkRandomTypeface::onGetTableTags(SkFontTableTag tags[]) const { | 248 int SkRandomTypeface::onGetTableTags(SkFontTableTag tags[]) const { |
249 return fProxy->getTableTags(tags); | 249 return fProxy->getTableTags(tags); |
250 } | 250 } |
251 | 251 |
252 size_t SkRandomTypeface::onGetTableData(SkFontTableTag tag, size_t offset, | 252 size_t SkRandomTypeface::onGetTableData(SkFontTableTag tag, size_t offset, |
253 size_t length, void* data) const { | 253 size_t length, void* data) const { |
254 return fProxy->getTableData(tag, offset, length, data); | 254 return fProxy->getTableData(tag, offset, length, data); |
255 } | 255 } |
256 | 256 |
OLD | NEW |