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

Unified Diff: src/gpu/GrGpuResourceRef.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/GrGpuResource.cpp ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResourceRef.cpp
diff --git a/src/gpu/GrGpuResourceRef.cpp b/src/gpu/GrGpuResourceRef.cpp
index 405679d4f17d6c8140b05748f0c0811a59e153a1..8ffaed5b6765f32291ab96668e417e67f015a530 100644
--- a/src/gpu/GrGpuResourceRef.cpp
+++ b/src/gpu/GrGpuResourceRef.cpp
@@ -11,13 +11,15 @@ GrGpuResourceRef::GrGpuResourceRef() {
fResource = nullptr;
fOwnRef = false;
fPendingIO = false;
+ fDst = NULL;
}
-GrGpuResourceRef::GrGpuResourceRef(GrGpuResource* resource, GrIOType ioType) {
+GrGpuResourceRef::GrGpuResourceRef(GrGpuResource* resource, GrIOType ioType, GrGpuResource* dst) {
fResource = nullptr;
fOwnRef = false;
fPendingIO = false;
- this->setResource(resource, ioType);
+ fDst = NULL;
+ this->setResource(resource, ioType, dst);
}
GrGpuResourceRef::~GrGpuResourceRef() {
@@ -49,19 +51,28 @@ void GrGpuResourceRef::reset() {
fOwnRef = false;
fResource = nullptr;
}
+ fDst = NULL;
}
-void GrGpuResourceRef::setResource(GrGpuResource* resource, GrIOType ioType) {
+void GrGpuResourceRef::setResource(GrGpuResource* resource, GrIOType ioType, GrGpuResource* dst) {
SkASSERT(!fPendingIO);
SkASSERT(SkToBool(fResource) == fOwnRef);
SkSafeUnref(fResource);
if (nullptr == resource) {
+ SkASSERT(nullptr == dst);
fResource = nullptr;
fOwnRef = false;
+ fDst = NULL;
} else {
fResource = resource;
fOwnRef = true;
fIOType = ioType;
+ if (fIOType == kRead_GrIOType || fIOType == kRW_GrIOType) {
+ SkASSERT(dst);
+ fDst = dst;
+ } else {
+ fDst = NULL;
+ }
}
}
@@ -73,13 +84,15 @@ void GrGpuResourceRef::markPendingIO() const {
fPendingIO = true;
switch (fIOType) {
case kRead_GrIOType:
- fResource->addPendingRead();
+ SkASSERT(fDst);
+ fResource->addPendingRead(fDst);
break;
case kWrite_GrIOType:
fResource->addPendingWrite();
break;
case kRW_GrIOType:
- fResource->addPendingRead();
+ SkASSERT(fDst);
+ fResource->addPendingRead(fDst);
fResource->addPendingWrite();
break;
}
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698