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

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

Issue 1421793009: apply mozilla patch for skbug.com/4547 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | no next file » | 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 } 176 }
177 this->release(); 177 this->release();
178 fResource = resource; 178 fResource = resource;
179 } 179 }
180 180
181 ~GrPendingIOResource() { 181 ~GrPendingIOResource() {
182 this->release(); 182 this->release();
183 } 183 }
184 184
185 operator bool() const { return SkToBool(fResource); } 185 explicit operator bool() const { return SkToBool(fResource); }
bungeman-skia 2015/11/10 17:20:01 Explicit operator bool has issues in VS2013, which
186
187 bool operator==(const GrPendingIOResource& other) const {
188 return fResource == other.fResource;
189 }
186 190
187 T* get() const { return fResource; } 191 T* get() const { return fResource; }
188 192
189 private: 193 private:
190 void release() { 194 void release() {
191 if (fResource) { 195 if (fResource) {
192 switch (IO_TYPE) { 196 switch (IO_TYPE) {
193 case kRead_GrIOType: 197 case kRead_GrIOType:
194 fResource->completedRead(); 198 fResource->completedRead();
195 break; 199 break;
196 case kWrite_GrIOType: 200 case kWrite_GrIOType:
197 fResource->completedWrite(); 201 fResource->completedWrite();
198 break; 202 break;
199 case kRW_GrIOType: 203 case kRW_GrIOType:
200 fResource->completedRead(); 204 fResource->completedRead();
201 fResource->completedWrite(); 205 fResource->completedWrite();
202 break; 206 break;
203 } 207 }
204 } 208 }
205 } 209 }
206 210
207 T* fResource; 211 T* fResource;
208 }; 212 };
209 #endif 213 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698