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

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

Issue 2502923003: Add IORef capability to GrSurfaceProxy objects - take 2 (Closed)
Patch Set: Fixed bug in transferRefs Created 4 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 | « gn/tests.gni ('k') | include/private/GrSurfaceProxy.h » ('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 GrGpuResource_DEFINED 8 #ifndef GrGpuResource_DEFINED
9 #define GrGpuResource_DEFINED 9 #define GrGpuResource_DEFINED
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 bool isPurgeable() const { return !this->internalHasRef() && !this->internal HasPendingIO(); } 87 bool isPurgeable() const { return !this->internalHasRef() && !this->internal HasPendingIO(); }
88 88
89 bool internalHasPendingRead() const { return SkToBool(fPendingReads); } 89 bool internalHasPendingRead() const { return SkToBool(fPendingReads); }
90 bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); } 90 bool internalHasPendingWrite() const { return SkToBool(fPendingWrites); }
91 bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendin gReads); } 91 bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendin gReads); }
92 92
93 bool internalHasRef() const { return SkToBool(fRefCnt); } 93 bool internalHasRef() const { return SkToBool(fRefCnt); }
94 94
95 private: 95 private:
96 friend class GrIORefProxy; // needs to forward on wrapped IO calls
97
96 void addPendingRead() const { 98 void addPendingRead() const {
97 this->validate(); 99 this->validate();
98 ++fPendingReads; 100 ++fPendingReads;
99 } 101 }
100 102
101 void completedRead() const { 103 void completedRead() const {
102 this->validate(); 104 this->validate();
103 --fPendingReads; 105 --fPendingReads;
104 this->didRemoveRefOrPendingIO(kPendingRead_CntType); 106 this->didRemoveRefOrPendingIO(kPendingRead_CntType);
105 } 107 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 328
327 SkBudgeted fBudgeted; 329 SkBudgeted fBudgeted;
328 bool fRefsWrappedObjects; 330 bool fRefsWrappedObjects;
329 const UniqueID fUniqueID; 331 const UniqueID fUniqueID;
330 332
331 typedef GrIORef<GrGpuResource> INHERITED; 333 typedef GrIORef<GrGpuResource> INHERITED;
332 friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and n otifyRefCntIsZero. 334 friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and n otifyRefCntIsZero.
333 }; 335 };
334 336
335 #endif 337 #endif
OLDNEW
« no previous file with comments | « gn/tests.gni ('k') | include/private/GrSurfaceProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698