8#ifndef skgpu_graphite_ScratchResourceManager_DEFINED
9#define skgpu_graphite_ScratchResourceManager_DEFINED
35 int*
count = fCounts.find(proxy);
37 count = fCounts.set(proxy, 0);
43 int*
count = fCounts.find(proxy);
50 const int*
count = fCounts.find(proxy);
78 std::unique_ptr<ProxyReadCountMap>);
165 return fProxyReadCounts->get(proxy);
170 return fProxyReadCounts->decrement(proxy);
174 struct ScratchTexture {
192 std::unique_ptr<ProxyReadCountMap> fProxyReadCounts;
int get(const TextureProxy *proxy) const
bool decrement(const TextureProxy *proxy)
void increment(const TextureProxy *proxy)
ProxyReadCountMap()=default
virtual void onUseCompleted(ScratchResourceManager *)=0
virtual ~PendingUseListener()
int pendingReadCount(const TextureProxy *proxy) const
void markResourceInUse(PendingUseListener *listener)
ScratchResourceManager(ResourceProvider *resourceProvider, std::unique_ptr< ProxyReadCountMap >)
bool removePendingRead(const TextureProxy *proxy)
sk_sp< Texture > getScratchTexture(SkISize, const TextureInfo &, std::string_view label)
~ScratchResourceManager()
void notifyResourcesConsumed()
void returnTexture(sk_sp< Texture >)