OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #ifndef GrFontScaler_DEFINED | 8 #ifndef GrFontScaler_DEFINED |
9 #define GrFontScaler_DEFINED | 9 #define GrFontScaler_DEFINED |
10 | 10 |
11 #include "GrGlyph.h" | 11 #include "GrGlyph.h" |
12 #include "GrTypes.h" | 12 #include "GrTypes.h" |
13 | 13 |
14 #include "SkDescriptor.h" | 14 #include "SkDescriptor.h" |
15 | 15 |
| 16 class SkGlyph; |
16 class SkPath; | 17 class SkPath; |
17 | 18 |
18 /* | 19 /* |
19 * Wrapper class to turn a font cache descriptor into a key | 20 * Wrapper class to turn a font cache descriptor into a key |
20 * for GrFontScaler-related lookups | 21 * for GrFontScaler-related lookups |
21 */ | 22 */ |
22 class GrFontDescKey : public SkRefCnt { | 23 class GrFontDescKey : public SkRefCnt { |
23 public: | 24 public: |
24 SK_DECLARE_INST_COUNT(GrFontDescKey) | 25 SK_DECLARE_INST_COUNT(GrFontDescKey) |
25 | 26 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 */ | 61 */ |
61 class GrFontScaler : public SkRefCnt { | 62 class GrFontScaler : public SkRefCnt { |
62 public: | 63 public: |
63 SK_DECLARE_INST_COUNT(GrFontScaler) | 64 SK_DECLARE_INST_COUNT(GrFontScaler) |
64 | 65 |
65 explicit GrFontScaler(SkGlyphCache* strike); | 66 explicit GrFontScaler(SkGlyphCache* strike); |
66 virtual ~GrFontScaler(); | 67 virtual ~GrFontScaler(); |
67 | 68 |
68 const GrFontDescKey* getKey(); | 69 const GrFontDescKey* getKey(); |
69 GrMaskFormat getMaskFormat() const; | 70 GrMaskFormat getMaskFormat() const; |
70 GrMaskFormat getPackedGlyphMaskFormat(GrGlyph::PackedID) const; | 71 GrMaskFormat getPackedGlyphMaskFormat(const SkGlyph&) const; |
71 bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds); | 72 bool getPackedGlyphBounds(const SkGlyph&, SkIRect* bounds); |
72 bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, | 73 bool getPackedGlyphImage(const SkGlyph&, int width, int height, int rowBytes
, |
73 int rowBytes, void* image); | 74 GrMaskFormat expectedMaskFormat, void* image); |
74 bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds); | 75 bool getPackedGlyphDFBounds(const SkGlyph&, SkIRect* bounds); |
75 bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, | 76 bool getPackedGlyphDFImage(const SkGlyph&, int width, int height, void* imag
e); |
76 void* image); | 77 const SkPath* getGlyphPath(const SkGlyph&); |
77 bool getGlyphPath(uint16_t glyphID, SkPath*); | 78 const SkGlyph& grToSkGlyph(GrGlyph::PackedID); |
78 | 79 |
79 private: | 80 private: |
80 SkGlyphCache* fStrike; | 81 SkGlyphCache* fStrike; |
81 GrFontDescKey* fKey; | 82 GrFontDescKey* fKey; |
82 | 83 |
83 typedef SkRefCnt INHERITED; | 84 typedef SkRefCnt INHERITED; |
84 }; | 85 }; |
85 | 86 |
86 #endif | 87 #endif |
OLD | NEW |