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

Unified Diff: include/gpu/GrResourceKey.h

Issue 1132723003: Make GrResourceCache perf less sensitive to key length change (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove an unused variable in the test Created 5 years, 7 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/GrResourceCacheBench.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrResourceKey.h
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index 50a71459290574dd107262274aa96dbdcd1db392..a353dc21143766f0a1cb7a2a598e9c55dc2c375b 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -46,7 +46,10 @@ protected:
}
bool operator==(const GrResourceKey& that) const {
- return 0 == memcmp(fKey.get(), that.fKey.get(), this->size());
+ return this->hash() == that.hash() &&
+ 0 == memcmp(&fKey[kHash_MetaDataIdx + 1],
+ &that.fKey[kHash_MetaDataIdx + 1],
+ this->internalSize() - sizeof(uint32_t));
}
GrResourceKey& operator=(const GrResourceKey& that) {
« no previous file with comments | « bench/GrResourceCacheBench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698