OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrTemplates.h" | 10 #include "GrTemplates.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 const GrKey* SkGrFontScaler::getKey() { | 96 const GrKey* SkGrFontScaler::getKey() { |
97 if (NULL == fKey) { | 97 if (NULL == fKey) { |
98 fKey = SkNEW_ARGS(SkGrDescKey, (fStrike->getDescriptor())); | 98 fKey = SkNEW_ARGS(SkGrDescKey, (fStrike->getDescriptor())); |
99 } | 99 } |
100 return fKey; | 100 return fKey; |
101 } | 101 } |
102 | 102 |
103 bool SkGrFontScaler::getPackedGlyphBounds(GrGlyph::PackedID packed, | 103 bool SkGrFontScaler::getPackedGlyphBounds(GrGlyph::PackedID packed, |
104 GrIRect* bounds) { | 104 SkIRect* bounds) { |
105 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(packed), | 105 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(packed), |
106 GrGlyph::UnpackFixedX(packed), | 106 GrGlyph::UnpackFixedX(packed), |
107 GrGlyph::UnpackFixedY(packed)); | 107 GrGlyph::UnpackFixedY(packed)); |
108 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); | 108 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); |
109 return true; | 109 return true; |
110 | 110 |
111 } | 111 } |
112 | 112 |
113 namespace { | 113 namespace { |
114 // expands each bit in a bitmask to 0 or ~0 of type INT_TYPE. Used to expand a B
W glyph mask to | 114 // expands each bit in a bitmask to 0 or ~0 of type INT_TYPE. Used to expand a B
W glyph mask to |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, SkPath* path) { | 192 bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, SkPath* path) { |
193 | 193 |
194 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(glyphID); | 194 const SkGlyph& glyph = fStrike->getGlyphIDMetrics(glyphID); |
195 const SkPath* skPath = fStrike->findPath(glyph); | 195 const SkPath* skPath = fStrike->findPath(glyph); |
196 if (skPath) { | 196 if (skPath) { |
197 *path = *skPath; | 197 *path = *skPath; |
198 return true; | 198 return true; |
199 } | 199 } |
200 return false; | 200 return false; |
201 } | 201 } |
OLD | NEW |