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 GrGlyph_DEFINED | 8 #ifndef GrGlyph_DEFINED |
9 #define GrGlyph_DEFINED | 9 #define GrGlyph_DEFINED |
10 | 10 |
11 #include "GrRect.h" | 11 #include "GrRect.h" |
12 #include "SkPath.h" | 12 #include "SkPath.h" |
| 13 #include "SkChecksum.h" |
13 | 14 |
14 class GrPlot; | 15 class GrPlot; |
15 | 16 |
16 /* Need this to be quad-state: | 17 /* Need this to be quad-state: |
17 - complete w/ image | 18 - complete w/ image |
18 - just metrics | 19 - just metrics |
19 - failed to get image, but has metrics | 20 - failed to get image, but has metrics |
20 - failed to get metrics | 21 - failed to get metrics |
21 */ | 22 */ |
22 struct GrGlyph { | 23 struct GrGlyph { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return ((packed >> 18) & 3) << 14; | 66 return ((packed >> 18) & 3) << 14; |
66 } | 67 } |
67 | 68 |
68 static inline SkFixed UnpackFixedY(PackedID packed) { | 69 static inline SkFixed UnpackFixedY(PackedID packed) { |
69 return ((packed >> 16) & 3) << 14; | 70 return ((packed >> 16) & 3) << 14; |
70 } | 71 } |
71 | 72 |
72 static inline uint16_t UnpackID(PackedID packed) { | 73 static inline uint16_t UnpackID(PackedID packed) { |
73 return (uint16_t)packed; | 74 return (uint16_t)packed; |
74 } | 75 } |
| 76 |
| 77 static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) { |
| 78 return glyph.fPackedID; |
| 79 } |
| 80 |
| 81 static inline uint32_t Hash(GrGlyph::PackedID key) { |
| 82 return SkChecksum::Murmur3(&key, sizeof(key)); |
| 83 } |
75 }; | 84 }; |
76 | 85 |
77 | |
78 #endif | 86 #endif |
OLD | NEW |