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

Unified Diff: include/gpu/GrGpuResourceRef.h

Issue 737723003: drawinfo carries bufferinfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 6 years, 1 month 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 | « no previous file | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGpuResourceRef.h
diff --git a/include/gpu/GrGpuResourceRef.h b/include/gpu/GrGpuResourceRef.h
index 93298f0656f4e5e03529c27e04e59233c0dba1bc..05414702be8189181e5cc6f4efc93700822c6cab 100644
--- a/include/gpu/GrGpuResourceRef.h
+++ b/include/gpu/GrGpuResourceRef.h
@@ -159,18 +159,23 @@ private:
*/
template <typename T, GrIOType IO_TYPE> class GrPendingIOResource : SkNoncopyable {
public:
- GrPendingIOResource(T* resource) : fResource(resource) {
- if (NULL != fResource) {
+ GrPendingIOResource(T* resource = NULL) {
+ this->set(resource);
+ }
+
+ void set(T* resource) {
bsalomon 2014/11/18 20:48:31 Shouldn't this check whether the resource was alre
+ fResource = resource;
+ if (NULL != resource) {
switch (IO_TYPE) {
case kRead_GrIOType:
- fResource->addPendingRead();
+ resource->addPendingRead();
break;
case kWrite_GrIOType:
- fResource->addPendingWrite();
+ resource->addPendingWrite();
break;
case kRW_GrIOType:
- fResource->addPendingRead();
- fResource->addPendingWrite();
+ resource->addPendingRead();
+ resource->addPendingWrite();
break;
}
}
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698