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 #include "GrFontScaler.h" | 9 #include "GrFontScaler.h" |
10 #include "SkDescriptor.h" | 10 #include "SkDescriptor.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 return kA565_GrMaskFormat; | 57 return kA565_GrMaskFormat; |
58 case SkMask::kARGB32_Format: | 58 case SkMask::kARGB32_Format: |
59 return kARGB_GrMaskFormat; | 59 return kARGB_GrMaskFormat; |
60 default: | 60 default: |
61 SkDEBUGFAIL("unsupported SkMask::Format"); | 61 SkDEBUGFAIL("unsupported SkMask::Format"); |
62 return kA8_GrMaskFormat; | 62 return kA8_GrMaskFormat; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 bool GrFontScaler::getPackedGlyphBounds(const SkGlyph& glyph, SkIRect* bounds) { | 66 bool GrFontScaler::getPackedGlyphBounds(const SkGlyph& glyph, SkIRect* bounds) { |
67 #if 1 | |
68 // crbug:510931 | |
69 // Retrieving the image from the cache can actually change the mask format. | |
70 fStrike->findImage(glyph); | |
71 #endif | |
67 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); | 72 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); |
68 | 73 |
69 return true; | 74 return true; |
70 } | 75 } |
71 | 76 |
72 bool GrFontScaler::getPackedGlyphDFBounds(const SkGlyph& glyph, SkIRect* bounds) { | 77 bool GrFontScaler::getPackedGlyphDFBounds(const SkGlyph& glyph, SkIRect* bounds) { |
78 #if 1 | |
jvanverth1
2015/07/30 19:28:24
Once we get into this routine isn't it too late? T
| |
79 // crbug:510931 | |
80 // Retrieving the image from the cache can actually change the mask format. | |
81 fStrike->findImage(glyph); | |
82 #endif | |
73 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); | 83 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight); |
74 bounds->outset(SK_DistanceFieldPad, SK_DistanceFieldPad); | 84 bounds->outset(SK_DistanceFieldPad, SK_DistanceFieldPad); |
75 | 85 |
76 return true; | 86 return true; |
77 } | 87 } |
78 | 88 |
79 namespace { | 89 namespace { |
80 // expands each bit in a bitmask to 0 or ~0 of type INT_TYPE. Used to expand a B W glyph mask to | 90 // expands each bit in a bitmask to 0 or ~0 of type INT_TYPE. Used to expand a B W glyph mask to |
81 // A8, RGB565, or RGBA8888. | 91 // A8, RGB565, or RGBA8888. |
82 template <typename INT_TYPE> | 92 template <typename INT_TYPE> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 198 |
189 const SkPath* GrFontScaler::getGlyphPath(const SkGlyph& glyph) { | 199 const SkPath* GrFontScaler::getGlyphPath(const SkGlyph& glyph) { |
190 return fStrike->findPath(glyph); | 200 return fStrike->findPath(glyph); |
191 } | 201 } |
192 | 202 |
193 const SkGlyph& GrFontScaler::grToSkGlyph(GrGlyph::PackedID id) { | 203 const SkGlyph& GrFontScaler::grToSkGlyph(GrGlyph::PackedID id) { |
194 return fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(id), | 204 return fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(id), |
195 GrGlyph::UnpackFixedX(id), | 205 GrGlyph::UnpackFixedX(id), |
196 GrGlyph::UnpackFixedY(id)); | 206 GrGlyph::UnpackFixedY(id)); |
197 } | 207 } |
OLD | NEW |