Index: src/gpu/GrResourceCache2.h |
diff --git a/src/gpu/GrResourceCache2.h b/src/gpu/GrResourceCache2.h |
index 8e79c09e39e1c798553ff2d0e6cefc0916d05e29..4252edd18582ad96297afdd6dd539c06bd6530ff 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,20 @@ 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; |
robertphillips
2014/08/27 19:11:30
// All resources that can be used as scratch can b
bsalomon
2014/08/27 20:37:40
I don't think I want to document the whole scratch
|
+ ScratchMap fScratchMap; |
}; |
#endif |