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

Unified Diff: src/gpu/GrGpuResource.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/GrGpu.cpp ('k') | src/gpu/GrGpuResourceRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResource.cpp
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index a227fd2c0f5ad81ece6dda893a43aa621310cd75..7c8b18d4814fa7cf89d9bb98530caa39c075c185 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -20,11 +20,15 @@ static inline GrResourceCache* get_resource_cache(GrGpu* gpu) {
return gpu->getContext()->getResourceCache();
}
-GrGpuResource::GrGpuResource(GrGpu* gpu, LifeCycle lifeCycle)
+GrGpuResource::GrGpuResource(GrGpu* gpu, LifeCycle lifeCycle, Type2 type)
: fGpu(gpu)
, fGpuMemorySize(kInvalidGpuMemorySize)
, fLifeCycle(lifeCycle)
- , fUniqueID(CreateUniqueID()) {
+ , fUniqueID(CreateUniqueID())
+ , fType1(type)
+ , fFromRawPixels2(false)
+ , fException(false)
+ , fException2(false) {
SkDEBUGCODE(fCacheArrayIndex = -1);
}
@@ -43,6 +47,9 @@ void GrGpuResource::release() {
get_resource_cache(fGpu)->resourceAccess().removeResource(this);
fGpu = nullptr;
fGpuMemorySize = 0;
+ fFromRawPixels2 = false;
+ fException = false;
+ fException2 = false;
}
void GrGpuResource::abandon() {
@@ -54,6 +61,9 @@ void GrGpuResource::abandon() {
get_resource_cache(fGpu)->resourceAccess().removeResource(this);
fGpu = nullptr;
fGpuMemorySize = 0;
+ fFromRawPixels2 = false;
+ fException = false;
+ fException2 = false;
}
void GrGpuResource::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
@@ -111,6 +121,13 @@ void GrGpuResource::removeUniqueKey() {
return;
}
SkASSERT(fUniqueKey.isValid());
+
+ if (fType1 == kSurface) {
+ SkASSERT(this->fromRawPixels2() || this->fException2);
+ this->setFromRawPixels(false);
+ fException = false;
+ fException2 = false;
+ }
get_resource_cache(fGpu)->resourceAccess().removeUniqueKey(this);
}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrGpuResourceRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698