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

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: 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
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

Powered by Google App Engine
This is Rietveld 408576698