Add plumbing for the GrThreadSafeUniquelyKeyedProxyViewCache
This CL is also imperfect and incomplete but, although currently unused, it sketches in how the threadSafeProxyCache will be plumbed through the GrContexts and GrResourceCache.
Bug: 1108408
Change-Id: Idb012b6efd49291de69bd88e4b4c531458a3e553
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317360
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 0f6ed61..08a5f65 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -26,6 +26,7 @@
class SkTraceMemoryDump;
class GrSingleOwner;
class GrTexture;
+class GrThreadSafeUniquelyKeyedProxyViewCache;
struct GrTextureFreedMessage {
GrTexture* fTexture;
@@ -91,7 +92,7 @@
size_t getResourceBytes() const { return fBytes; }
/**
- * Returns the number of bytes held by unlocked reosources which are available for purging.
+ * Returns the number of bytes held by unlocked resources which are available for purging.
*/
size_t getPurgeableBytes() const { return fPurgeableBytes; }
@@ -238,6 +239,9 @@
void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const;
void setProxyProvider(GrProxyProvider* proxyProvider) { fProxyProvider = proxyProvider; }
+ void setThreadSafeViewCache(GrThreadSafeUniquelyKeyedProxyViewCache* threadSafeViewCache) {
+ fThreadSafeViewCache = threadSafeViewCache;
+ }
private:
///////////////////////////////////////////////////////////////////////////
@@ -323,6 +327,8 @@
typedef SkTDArray<GrGpuResource*> ResourceArray;
GrProxyProvider* fProxyProvider = nullptr;
+ GrThreadSafeUniquelyKeyedProxyViewCache* fThreadSafeViewCache = nullptr;
+
// Whenever a resource is added to the cache or the result of a cache lookup, fTimestamp is
// assigned as the resource's timestamp and then incremented. fPurgeableQueue orders the
// purgeable resources by this value, and thus is used to purge resources in LRU order.