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

Unified Diff: src/gpu/GrResourceCache2.h

Issue 510053003: Make textures register with GrResourceCache2 as scratch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new h file to git repo Created 6 years, 4 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 | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache2.h
diff --git a/src/gpu/GrResourceCache2.h b/src/gpu/GrResourceCache2.h
index 8e79c09e39e1c798553ff2d0e6cefc0916d05e29..e05efd744e44d9e75b157e8c67f9e53648f39fd1 100644
--- a/src/gpu/GrResourceCache2.h
+++ b/src/gpu/GrResourceCache2.h
@@ -9,10 +9,10 @@
#ifndef GrResourceCache2_DEFINED
#define GrResourceCache2_DEFINED
-#include "GrTypes.h"
+#include "GrGpuResource.h"
+#include "GrResourceKey.h"
#include "SkTInternalLList.h"
-
-class GrGpuResource;
+#include "SkTMultiMap.h"
/**
* Eventual replacement for GrResourceCache. Currently it simply holds a list
@@ -39,8 +39,21 @@ private:
}
#endif
- int fCount;
- SkTInternalLList<GrGpuResource> fResources;
+
+ void removeScratch(const GrGpuResource* resource);
+ struct ScratchMapTraits {
+ static const GrResourceKey& GetKey(const GrGpuResource& r) {
+ return r.getScratchKey();
+ }
+
+ static uint32_t Hash(const GrResourceKey& key) { return key.getHash(); }
+ };
+ typedef SkTMultiMap<GrGpuResource, GrResourceKey, ScratchMapTraits> ScratchMap;
+
+ int fCount;
+ SkTInternalLList<GrGpuResource> fResources;
+ // This map holds all resources that can be used as scratch resources.
+ ScratchMap fScratchMap;
};
#endif
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698