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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkDescriptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGlyph.h
diff --git a/include/gpu/GrGlyph.h b/include/gpu/GrGlyph.h
index a7d834153f4407bb781e7a79721e0aa48be3b51b..a379144a4289067c572ded56d9462ecff5d01abd 100644
--- a/include/gpu/GrGlyph.h
+++ b/include/gpu/GrGlyph.h
@@ -10,6 +10,7 @@
#include "GrRect.h"
#include "SkPath.h"
+#include "SkChecksum.h"
class GrPlot;
@@ -72,7 +73,14 @@ struct GrGlyph {
static inline uint16_t UnpackID(PackedID packed) {
return (uint16_t)packed;
}
-};
+ static inline const GrGlyph::PackedID& GetKey(const GrGlyph& glyph) {
+ return glyph.fPackedID;
+ }
+
+ static inline uint32_t Hash(GrGlyph::PackedID key) {
+ return SkChecksum::Murmur3(&key, sizeof(key));
+ }
+};
#endif
« 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