Get rid of GrMurmur3Hash
BUG=skia:
Review URL: https://codereview.chromium.org/1233933002
diff --git a/src/gpu/effects/GrTextureStripAtlas.h b/src/gpu/effects/GrTextureStripAtlas.h
index 80b33bb..3b18706 100644
--- a/src/gpu/effects/GrTextureStripAtlas.h
+++ b/src/gpu/effects/GrTextureStripAtlas.h
@@ -8,8 +8,8 @@
#ifndef GrTextureStripAtlas_DEFINED
#define GrTextureStripAtlas_DEFINED
-#include "GrMurmur3HashKey.h"
#include "SkBitmap.h"
+#include "SkChecksum.h"
#include "SkGr.h"
#include "SkTDArray.h"
#include "SkTDynamicHash.h"
@@ -25,11 +25,14 @@
* Descriptor struct which we'll use as a hash table key
**/
struct Desc {
- Desc() { memset(this, 0, sizeof(*this)); }
- uint16_t fWidth, fHeight, fRowHeight;
- GrPixelConfig fConfig;
+ Desc() { sk_bzero(this, sizeof(*this)); }
GrContext* fContext;
- const uint32_t* asKey() const { return reinterpret_cast<const uint32_t*>(this); }
+ GrPixelConfig fConfig;
+ uint16_t fWidth, fHeight, fRowHeight;
+ uint16_t fUnusedPadding;
+ bool operator==(const Desc& other) const {
+ return 0 == memcmp(this, &other, sizeof(Desc));
+ }
};
/**
@@ -138,14 +141,13 @@
class AtlasEntry : public ::SkNoncopyable {
public:
// for SkTDynamicHash
- class Key : public GrMurmur3HashKey<sizeof(GrTextureStripAtlas::Desc)> {};
- static const Key& GetKey(const AtlasEntry& entry) { return entry.fKey; }
- static uint32_t Hash(const Key& key) { return key.getHash(); }
+ static const Desc& GetKey(const AtlasEntry& entry) { return entry.fDesc; }
+ static uint32_t Hash(const Desc& desc) { return SkChecksum::Murmur3(&desc, sizeof(Desc)); }
// AtlasEntry proper
AtlasEntry() : fAtlas(NULL) {}
~AtlasEntry() { SkDELETE(fAtlas); }
- Key fKey;
+ Desc fDesc;
GrTextureStripAtlas* fAtlas;
};