| 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 GrTHashCache_DEFINED | 11 #ifndef GrTHashTable_DEFINED |
| 12 #define GrTHashCache_DEFINED | 12 #define GrTHashTable_DEFINED |
| 13 | 13 |
| 14 #include "GrTypes.h" | 14 #include "GrTypes.h" |
| 15 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
| 16 | 16 |
| 17 // GrTDefaultFindFunctor implements the default find behavior for | 17 // GrTDefaultFindFunctor implements the default find behavior for |
| 18 // GrTHashTable (i.e., return the first resource that matches the | 18 // GrTHashTable (i.e., return the first resource that matches the |
| 19 // provided key) | 19 // provided key) |
| 20 template <typename T> class GrTDefaultFindFunctor { | 20 template <typename T> class GrTDefaultFindFunctor { |
| 21 public: | 21 public: |
| 22 // always accept the first element examined | 22 // always accept the first element examined |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 template <typename T, typename Key, size_t kHashBits> | 238 template <typename T, typename Key, size_t kHashBits> |
| 239 bool GrTHashTable<T, Key, kHashBits>::contains(T* elem) const { | 239 bool GrTHashTable<T, Key, kHashBits>::contains(T* elem) const { |
| 240 int index = fSorted.find(elem); | 240 int index = fSorted.find(elem); |
| 241 return index >= 0; | 241 return index >= 0; |
| 242 } | 242 } |
| 243 | 243 |
| 244 #endif | 244 #endif |
| 245 | 245 |
| 246 #endif | 246 #endif |
| OLD | NEW |