Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: include/gpu/GrGlyph.h

Issue 390103002: Replace use of GrTHashTable in GrFontCache with SkTDynamicHash. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove deleteAll(); use iterator instead. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkDescriptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkDescriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698