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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index cb6bcf75fd7fa284276828679b24dc2df888e1c5..66d32352083098c7ad4e42eac4e1835ddbcf6e48 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -371,6 +371,30 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla
return;
}
+ if (resource->type1() == GrGpuResource::kSurface) {
+ GrRenderTarget* rt = resource->arrgh();
+
+ // TODO: add an assert here that the DT's RT is already closed && discarded!
+ // closed means: official DT ptr is NULL and bit set
+ // All the counts have reached 0!
+ if (rt && rt->getLastDrawTarget()) {
+ SkASSERT(rt->getLastDrawTarget()->isClosed() || rt->getLastDrawTarget()->isEmpty3());
+ }
+
+ if (rt) {
+ rt->setLastDrawTarget(NULL);
+ }
+
+ if (resource->getUniqueKey().isValid()) {
+ SkASSERT(resource->fromRawPixels2() || resource->fException2);
+ } else {
+ SkASSERT(resource->exception() || !resource->fromRawPixels2());
+ resource->setException(false);
+ resource->setFromRawPixels(false);
+ resource->fException2 = false;
+ }
+ }
+
SkASSERT(resource->isPurgeable());
this->removeFromNonpurgeableArray(resource);
fPurgeableQueue.insert(resource);
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698