| 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 SkPath; | 16 class SkPath; |
| 17 | 17 |
| 18 /* | 18 /* |
| 19 * Wrapper class to turn a font cache descriptor into a key | 19 * Wrapper class to turn a font cache descriptor into a key |
| 20 * for GrFontScaler-related lookups | 20 * for GrFontScaler-related lookups |
| 21 */ | 21 */ |
| 22 class GrFontDescKey : public SkRefCnt { | 22 class GrFontDescKey : public SkRefCnt { |
| 23 public: | 23 public: |
| 24 SK_DECLARE_INST_COUNT(SkGrDescKey) | 24 SK_DECLARE_INST_COUNT(GrFontDescKey) |
| 25 | 25 |
| 26 typedef uint32_t Hash; | 26 typedef uint32_t Hash; |
| 27 | 27 |
| 28 explicit GrFontDescKey(const SkDescriptor& desc); | 28 explicit GrFontDescKey(const SkDescriptor& desc); |
| 29 virtual ~GrFontDescKey(); | 29 virtual ~GrFontDescKey(); |
| 30 | 30 |
| 31 Hash getHash() const { return fHash; } | 31 Hash getHash() const { return fHash; } |
| 32 | 32 |
| 33 bool operator<(const GrFontDescKey& rh) const { | 33 bool operator<(const GrFontDescKey& rh) const { |
| 34 return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh)); | 34 return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 bool getGlyphPath(uint16_t glyphID, SkPath*); | 76 bool getGlyphPath(uint16_t glyphID, SkPath*); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 SkGlyphCache* fStrike; | 79 SkGlyphCache* fStrike; |
| 80 GrFontDescKey* fKey; | 80 GrFontDescKey* fKey; |
| 81 | 81 |
| 82 typedef SkRefCnt INHERITED; | 82 typedef SkRefCnt INHERITED; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 #endif | 85 #endif |
| OLD | NEW |