Index: src/gpu/GrGpuResource.cpp |
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp |
index 3e9964f1a029642642a0bd39b69d32c4c3e8867c..15d5888cc07384d74f2c7db5a1ff078a6030be2a 100644 |
--- a/src/gpu/GrGpuResource.cpp |
+++ b/src/gpu/GrGpuResource.cpp |
@@ -86,8 +86,8 @@ bool GrGpuResource::setContentKey(const GrContentKey& key) { |
// Currently this can only be called once and can't be called when the resource is scratch. |
SkASSERT(this->internalHasRef()); |
- // Wrapped resources can never have a key. |
- if (this->isWrapped()) { |
+ // Wrapped and uncached resources can never have a content key. |
+ if (!this->cacheAccess().isBudgeted()) { |
return false; |
} |
@@ -138,6 +138,13 @@ void GrGpuResource::makeBudgeted() { |
} |
} |
+void GrGpuResource::makeUnbudgeted() { |
+ if (GrGpuResource::kCached_LifeCycle == fLifeCycle && !fContentKey.isValid()) { |
+ fLifeCycle = kUncached_LifeCycle; |
+ get_resource_cache2(fGpu)->resourceAccess().didChangeBudgetStatus(this); |
+ } |
+} |
+ |
uint32_t GrGpuResource::CreateUniqueID() { |
static int32_t gUniqueID = SK_InvalidUniqueID; |
uint32_t id; |