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

Unified Diff: src/core/SkChecksum.h

Issue 378413002: Revert of Slim Skia down to just one murmur3 implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « bench/FontCacheBench.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkChecksum.h
diff --git a/src/core/SkChecksum.h b/src/core/SkChecksum.h
index fe1e9584a20e8e87c2475a648af21e03db9e6710..bf3228f91db8722337e9b06db0fb23fb491d4e37 100644
--- a/src/core/SkChecksum.h
+++ b/src/core/SkChecksum.h
@@ -36,20 +36,6 @@
}
public:
- /**
- * uint32_t -> uint32_t hash, useful for when you're about to trucate this hash but you
- * suspect its low bits aren't well mixed.
- *
- * This is the Murmur3 finalizer.
- */
- static uint32_t Mix(uint32_t hash) {
- hash ^= hash >> 16;
- hash *= 0x85ebca6b;
- hash ^= hash >> 13;
- hash *= 0xc2b2ae35;
- hash ^= hash >> 16;
- return hash;
- }
/**
* Calculate 32-bit Murmur hash (murmur3).
@@ -62,7 +48,7 @@
* @return hash result
*/
static uint32_t Murmur3(const uint32_t* data, size_t bytes, uint32_t seed=0) {
- SkASSERTF(SkIsAlign4(bytes), "Expected 4-byte multiple, got %zu", bytes);
+ SkASSERT(SkIsAlign4(bytes));
const size_t words = bytes/4;
uint32_t hash = seed;
@@ -78,7 +64,12 @@
hash += 0xe6546b64;
}
hash ^= bytes;
- return Mix(hash);
+ hash ^= hash >> 16;
+ hash *= 0x85ebca6b;
+ hash ^= hash >> 13;
+ hash *= 0xc2b2ae35;
+ hash ^= hash >> 16;
+ return hash;
}
/**
« no previous file with comments | « bench/FontCacheBench.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698