OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 * valid way of going from state 3 back to 2 or 1. | 29 * valid way of going from state 3 back to 2 or 1. |
30 * | 30 * |
31 * Like SkAutoTUnref, its constructor and setter adopt a ref from their caller. | 31 * Like SkAutoTUnref, its constructor and setter adopt a ref from their caller. |
32 * | 32 * |
33 * TODO: Once GrDODrawState no longer exists and therefore GrDrawState and GrOpt
DrawState no | 33 * TODO: Once GrDODrawState no longer exists and therefore GrDrawState and GrOpt
DrawState no |
34 * longer share an instance of this class, attempt to make the resource owned by
GrGpuResourceRef | 34 * longer share an instance of this class, attempt to make the resource owned by
GrGpuResourceRef |
35 * only settable via the constructor. | 35 * only settable via the constructor. |
36 */ | 36 */ |
37 class GrGpuResourceRef : SkNoncopyable { | 37 class GrGpuResourceRef : SkNoncopyable { |
38 public: | 38 public: |
39 SK_DECLARE_INST_COUNT(GrGpuResourceRef); | |
40 | |
41 ~GrGpuResourceRef(); | 39 ~GrGpuResourceRef(); |
42 | 40 |
43 GrGpuResource* getResource() const { return fResource; } | 41 GrGpuResource* getResource() const { return fResource; } |
44 | 42 |
45 /** Does this object own a pending read or write on the resource it is wrapp
ing. */ | 43 /** Does this object own a pending read or write on the resource it is wrapp
ing. */ |
46 bool ownsPendingIO() const { return fPendingIO; } | 44 bool ownsPendingIO() const { return fPendingIO; } |
47 | 45 |
48 /** Shortcut for calling setResource() with NULL. It cannot be called after
markingPendingIO | 46 /** Shortcut for calling setResource() with NULL. It cannot be called after
markingPendingIO |
49 is called. */ | 47 is called. */ |
50 void reset(); | 48 void reset(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 fResource->completedRead(); | 200 fResource->completedRead(); |
203 fResource->completedWrite(); | 201 fResource->completedWrite(); |
204 break; | 202 break; |
205 } | 203 } |
206 } | 204 } |
207 } | 205 } |
208 | 206 |
209 T* fResource; | 207 T* fResource; |
210 }; | 208 }; |
211 #endif | 209 #endif |
OLD | NEW |