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

Side by Side Diff: include/gpu/GrGpuResourceRef.h

Issue 742853002: Don't use NULL GrOptDrawState to indicate that draw should be skipped. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make bool cast work 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrGpuResourceRef_DEFINED 8 #ifndef GrGpuResourceRef_DEFINED
9 #define GrGpuResourceRef_DEFINED 9 #define GrGpuResourceRef_DEFINED
10 10
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 } 180 }
181 this->release(); 181 this->release();
182 fResource = resource; 182 fResource = resource;
183 } 183 }
184 184
185 ~GrPendingIOResource() { 185 ~GrPendingIOResource() {
186 this->release(); 186 this->release();
187 } 187 }
188 188
189 operator bool() const { return SkToBool(fResource); }
190
189 T* get() const { return fResource; } 191 T* get() const { return fResource; }
190 192
191 private: 193 private:
192 void release() { 194 void release() {
193 if (fResource) { 195 if (fResource) {
194 switch (IO_TYPE) { 196 switch (IO_TYPE) {
195 case kRead_GrIOType: 197 case kRead_GrIOType:
196 fResource->completedRead(); 198 fResource->completedRead();
197 break; 199 break;
198 case kWrite_GrIOType: 200 case kWrite_GrIOType:
199 fResource->completedWrite(); 201 fResource->completedWrite();
200 break; 202 break;
201 case kRW_GrIOType: 203 case kRW_GrIOType:
202 fResource->completedRead(); 204 fResource->completedRead();
203 fResource->completedWrite(); 205 fResource->completedWrite();
204 break; 206 break;
205 } 207 }
206 } 208 }
207 } 209 }
208 210
209 T* fResource; 211 T* fResource;
210 }; 212 };
211 #endif 213 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698