| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 #ifndef GrMurmur3HashKey_DEFINED | 10 #ifndef GrMurmur3HashKey_DEFINED |
| 11 #define GrMurmur3HashKey_DEFINED | 11 #define GrMurmur3HashKey_DEFINED |
| 12 | 12 |
| 13 #include "SkChecksum.h" | 13 #include "SkChecksum.h" |
| 14 #include "GrTypes.h" | 14 #include "GrTypes.h" |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * GrMurmur3HashKey is a hash key class that can take a data chunk of any prede
termined | 17 * GrMurmur3HashKey is a hash key class that can take a data chunk of any prede
termined |
| 18 * length. It uses the Murmur3 hash function. It is intended to be used with | 18 * length. It uses the Murmur3 hash function. It is intended to be used with |
| 19 * SkTDynamicHash (where GrBinHashKey is for GrTHashTable). | 19 * SkTDynamicHash. |
| 20 */ | 20 */ |
| 21 template<size_t KEY_SIZE_IN_BYTES> | 21 template<size_t KEY_SIZE_IN_BYTES> |
| 22 class GrMurmur3HashKey { | 22 class GrMurmur3HashKey { |
| 23 public: | 23 public: |
| 24 GrMurmur3HashKey() { | 24 GrMurmur3HashKey() { |
| 25 this->reset(); | 25 this->reset(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void reset() { | 28 void reset() { |
| 29 fHash = 0; | 29 fHash = 0; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 uint32_t fHash; | 64 uint32_t fHash; |
| 65 uint32_t fData[KEY_SIZE_IN_BYTES / sizeof(uint32_t)]; // Buffer for key sto
rage. | 65 uint32_t fData[KEY_SIZE_IN_BYTES / sizeof(uint32_t)]; // Buffer for key sto
rage. |
| 66 | 66 |
| 67 #ifdef SK_DEBUG | 67 #ifdef SK_DEBUG |
| 68 public: | 68 public: |
| 69 bool fIsValid; | 69 bool fIsValid; |
| 70 #endif | 70 #endif |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif | 73 #endif |
| OLD | NEW |