Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrTMultiMap.h
index c887214..0007a04 100644 (file)
  */
 template <typename T,
           typename Key,
-          const Key& (GetKey)(const T&),
-          uint32_t (Hash)(const Key&),
-          bool (Equal)(const T&, const Key&)>
+          typename HashTraits=T>
 class GrTMultiMap {
     struct ValueList {
         explicit ValueList(T* value) : fValue(value), fNext(NULL) {}
 
-        static const Key& ListGetKey(const ValueList& e) { return GetKey(*e.fValue); }
-        static uint32_t ListHash(const Key& key) { return Hash(key); }
-        static bool ListEqual(const ValueList& a, const Key& b) {
-            return Equal(*a.fValue, b);
-        }
+        static const Key& GetKey(const ValueList& e) { return HashTraits::GetKey(*e.fValue); }
+        static uint32_t Hash(const Key& key) { return HashTraits::Hash(key); }
         T* fValue;
         ValueList* fNext;
     };
@@ -108,11 +103,7 @@ public:
     int count() const { return fCount; }
 
 private:
-    SkTDynamicHash<ValueList,
-                   Key,
-                   ValueList::ListGetKey,
-                   ValueList::ListHash,
-                   ValueList::ListEqual> fHash;
+    SkTDynamicHash<ValueList, Key> fHash;
     int fCount;
 };