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 | 9 |
10 | 10 |
11 #ifndef GrTextStrike_impl_DEFINED | 11 #ifndef GrTextStrike_impl_DEFINED |
12 #define GrTextStrike_impl_DEFINED | 12 #define GrTextStrike_impl_DEFINED |
13 | 13 |
14 class GrFontCache::Key { | 14 class GrFontCache::Key { |
15 public: | 15 public: |
16 Key(GrFontScaler* scaler) { | 16 explicit Key(GrFontScaler* scaler) { |
17 fFontScalerKey = scaler->getKey(); | 17 fFontScalerKey = scaler->getKey(); |
18 } | 18 } |
19 explicit Key(const GrKey* fontScalarKey) { | |
bsalomon
2013/10/25 20:48:47
does it make sense to have the GrFontScaler cons i
mtklein
2013/10/25 21:08:21
Nope. Gone.
| |
20 fFontScalerKey = fontScalarKey; | |
21 } | |
19 | 22 |
20 intptr_t getHash() const { return fFontScalerKey->getHash(); } | 23 intptr_t getHash() const { return fFontScalerKey->getHash(); } |
21 | 24 |
22 static bool LT(const GrTextStrike& strike, const Key& key) { | 25 static bool LT(const GrTextStrike& strike, const Key& key) { |
23 return *strike.getFontScalerKey() < *key.fFontScalerKey; | 26 return *strike.getFontScalerKey() < *key.fFontScalerKey; |
24 } | 27 } |
25 static bool EQ(const GrTextStrike& strike, const Key& key) { | 28 static bool EQ(const GrTextStrike& strike, const Key& key) { |
26 return *strike.getFontScalerKey() == *key.fFontScalerKey; | 29 return *strike.getFontScalerKey() == *key.fFontScalerKey; |
27 } | 30 } |
28 | 31 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 GrGlyph* GrTextStrike::getGlyph(GrGlyph::PackedID packed, | 99 GrGlyph* GrTextStrike::getGlyph(GrGlyph::PackedID packed, |
97 GrFontScaler* scaler) { | 100 GrFontScaler* scaler) { |
98 GrGlyph* glyph = fCache.find(packed); | 101 GrGlyph* glyph = fCache.find(packed); |
99 if (NULL == glyph) { | 102 if (NULL == glyph) { |
100 glyph = this->generateGlyph(packed, scaler); | 103 glyph = this->generateGlyph(packed, scaler); |
101 } | 104 } |
102 return glyph; | 105 return glyph; |
103 } | 106 } |
104 | 107 |
105 #endif | 108 #endif |
OLD | NEW |