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

Unified Diff: src/gpu/effects/GrTextureStripAtlas.cpp

Issue 402693003: Replace GrTHash with SkTDynamicHash (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix compiler complaints 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
Index: src/gpu/effects/GrTextureStripAtlas.cpp
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 0aa9dc351425b8c822e0efe2e2b09fca3867f9cb..e3927c0d1f097853ca18ba9c405c1b5c632b4f67 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -17,17 +17,17 @@
#define VALIDATE
#endif
+class GrTextureStripAtlas::Hash : public SkTDynamicHash<GrTextureStripAtlas::AtlasEntry,
+ GrTextureStripAtlas::AtlasEntry::Key> {};
+
int32_t GrTextureStripAtlas::gCacheCount = 0;
-GrTHashTable<GrTextureStripAtlas::AtlasEntry,
- GrTextureStripAtlas::AtlasHashKey, 8>*
- GrTextureStripAtlas::gAtlasCache = NULL;
+GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = NULL;
-GrTHashTable<GrTextureStripAtlas::AtlasEntry, GrTextureStripAtlas::AtlasHashKey, 8>*
-GrTextureStripAtlas::GetCache() {
+GrTextureStripAtlas::Hash* GrTextureStripAtlas::GetCache() {
if (NULL == gAtlasCache) {
- gAtlasCache = SkNEW((GrTHashTable<AtlasEntry, AtlasHashKey, 8>));
+ gAtlasCache = SkNEW(Hash);
}
return gAtlasCache;
@@ -40,7 +40,7 @@ void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
AtlasEntry* entry = static_cast<AtlasEntry*>(info);
// remove the cache entry
- GetCache()->remove(entry->fKey, entry);
+ GetCache()->remove(entry->fKey);
// remove the actual entry
SkDELETE(entry);
@@ -52,7 +52,7 @@ void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
}
GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::Desc& desc) {
- AtlasHashKey key;
+ AtlasEntry::Key key;
key.setKeyData(desc.asKey());
AtlasEntry* entry = GetCache()->find(key);
if (NULL == entry) {
@@ -63,7 +63,7 @@ GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::De
desc.fContext->addCleanUp(CleanUp, entry);
- GetCache()->insert(key, entry);
+ GetCache()->add(entry);
}
return entry->fAtlas;

Powered by Google App Engine
This is Rietveld 408576698