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 #include "GrGpuResourceRef.h" | 8 #include "GrGpuResourceRef.h" |
9 #include "GrGpuResource.h" | 9 #include "GrGpuResource.h" |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 case kRead_IOType: | 86 case kRead_IOType: |
87 fResource->addPendingRead(); | 87 fResource->addPendingRead(); |
88 break; | 88 break; |
89 case kWrite_IOType: | 89 case kWrite_IOType: |
90 fResource->addPendingWrite(); | 90 fResource->addPendingWrite(); |
91 break; | 91 break; |
92 case kRW_IOType: | 92 case kRW_IOType: |
93 fResource->addPendingRead(); | 93 fResource->addPendingRead(); |
94 fResource->addPendingWrite(); | 94 fResource->addPendingWrite(); |
95 break; | 95 break; |
96 | |
97 } | 96 } |
98 } | 97 } |
99 | 98 |
100 void GrGpuResourceRef::pendingIOComplete() const { | 99 void GrGpuResourceRef::pendingIOComplete() const { |
101 // This should only be called when the owner's pending executions have ocurr
ed but it is still | 100 // This should only be called when the owner's pending executions have ocurr
ed but it is still |
102 // reffed. | 101 // reffed. |
103 SkASSERT(fOwnRef); | 102 SkASSERT(fOwnRef); |
104 SkASSERT(fPendingIO); | 103 SkASSERT(fPendingIO); |
105 switch (fIOType) { | 104 switch (fIOType) { |
106 case kNone_IOType: | 105 case kNone_IOType: |
(...skipping 17 matching lines...) Expand all Loading... |
124 void GrGpuResourceRef::removeRef() const { | 123 void GrGpuResourceRef::removeRef() const { |
125 // This should only be called once, when the owners last ref goes away and | 124 // This should only be called once, when the owners last ref goes away and |
126 // there is a pending execution. | 125 // there is a pending execution. |
127 SkASSERT(fOwnRef); | 126 SkASSERT(fOwnRef); |
128 SkASSERT(fPendingIO); | 127 SkASSERT(fPendingIO); |
129 SkASSERT(kNone_IOType != fIOType); | 128 SkASSERT(kNone_IOType != fIOType); |
130 SkASSERT(fResource); | 129 SkASSERT(fResource); |
131 fResource->unref(); | 130 fResource->unref(); |
132 fOwnRef = false; | 131 fOwnRef = false; |
133 } | 132 } |
OLD | NEW |