| 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 explicit GrFontDescKey(const SkDescriptor& desc) : fDesc(desc), fHash(desc.g
etChecksum()) {} | 25 explicit GrFontDescKey(const SkDescriptor& desc) : fDesc(desc), fHash(desc.g
etChecksum()) {} |
| 25 | 26 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 * The client is responsible for instantiating this. The instance is created | 43 * The client is responsible for instantiating this. The instance is created |
| 43 * for a specific font+size+matrix. | 44 * for a specific font+size+matrix. |
| 44 */ | 45 */ |
| 45 class GrFontScaler : public SkRefCnt { | 46 class GrFontScaler : public SkRefCnt { |
| 46 public: | 47 public: |
| 47 explicit GrFontScaler(SkGlyphCache* strike); | 48 explicit GrFontScaler(SkGlyphCache* strike); |
| 48 virtual ~GrFontScaler(); | 49 virtual ~GrFontScaler(); |
| 49 | 50 |
| 50 const GrFontDescKey* getKey(); | 51 const GrFontDescKey* getKey(); |
| 51 GrMaskFormat getMaskFormat() const; | 52 GrMaskFormat getMaskFormat() const; |
| 52 GrMaskFormat getPackedGlyphMaskFormat(GrGlyph::PackedID) const; | 53 GrMaskFormat getPackedGlyphMaskFormat(const SkGlyph&) const; |
| 53 bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds); | 54 bool getPackedGlyphBounds(const SkGlyph&, SkIRect* bounds); |
| 54 bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, | 55 bool getPackedGlyphImage(const SkGlyph&, int width, int height, int rowBytes
, void* image); |
| 55 int rowBytes, void* image); | 56 bool getPackedGlyphDFBounds(const SkGlyph&, SkIRect* bounds); |
| 56 bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds); | 57 bool getPackedGlyphDFImage(const SkGlyph&, int width, int height, void* imag
e); |
| 57 bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, | 58 const SkPath* getGlyphPath(const SkGlyph&); |
| 58 void* image); | 59 const SkGlyph& grToSkGlyph(GrGlyph::PackedID); |
| 59 bool getGlyphPath(uint16_t glyphID, SkPath*); | |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 SkGlyphCache* fStrike; | 62 SkGlyphCache* fStrike; |
| 63 GrFontDescKey* fKey; | 63 GrFontDescKey* fKey; |
| 64 | 64 |
| 65 typedef SkRefCnt INHERITED; | 65 typedef SkRefCnt INHERITED; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 #endif | 68 #endif |
| OLD | NEW |