18 std::unique_ptr<ProxyReadCountMap> proxyCounts)
19 : fResourceProvider(resourceProvider)
20 , fProxyReadCounts(
std::move(proxyCounts)) {
29 std::string_view label) {
30 for (ScratchTexture& st : fScratchTextures) {
32 st.fTexture->dimensions() == dimensions &&
33 st.fTexture->textureInfo() ==
info) {
35 st.fAvailable =
false;
46 if (newScratchTexture) {
47 fScratchTextures.push_back({newScratchTexture,
false});
49 return newScratchTexture;
53 for (ScratchTexture& st : fScratchTextures) {
54 if (st.fTexture.get() ==
texture.get()) {
66 fListenerStack.push_back(
nullptr);
77 while (fListenerStack.fromBack(n)) {
80 SkASSERT(n < fListenerStack.size() && fListenerStack.fromBack(n) ==
nullptr);
82 fListenerStack.pop_back_n(n + 1);
91 listener->onUseCompleted(
this);
94 SkASSERT(n < fListenerStack.size() && fListenerStack.fromBack(n) ==
nullptr);
98 fListenerStack.pop_back_n(n);
105 fListenerStack.push_back(listener);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
sk_sp< Texture > findOrCreateScratchTexture(SkISize, const TextureInfo &, std::string_view label, skgpu::Budgeted)
void markResourceInUse(PendingUseListener *listener)
ScratchResourceManager(ResourceProvider *resourceProvider, std::unique_ptr< ProxyReadCountMap >)
sk_sp< Texture > getScratchTexture(SkISize, const TextureInfo &, std::string_view label)
~ScratchResourceManager()
void notifyResourcesConsumed()
void returnTexture(sk_sp< Texture >)