OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 8 |
9 #ifndef GrSurface_DEFINED | 9 #ifndef GrSurface_DEFINED |
10 #define GrSurface_DEFINED | 10 #define GrSurface_DEFINED |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 , fReleaseCtx(NULL) | 153 , fReleaseCtx(NULL) |
154 {} | 154 {} |
155 | 155 |
156 ~GrSurface() override { | 156 ~GrSurface() override { |
157 // check that invokeReleaseProc has been called (if needed) | 157 // check that invokeReleaseProc has been called (if needed) |
158 SkASSERT(NULL == fReleaseProc); | 158 SkASSERT(NULL == fReleaseProc); |
159 } | 159 } |
160 | 160 |
161 GrSurfaceDesc fDesc; | 161 GrSurfaceDesc fDesc; |
162 | 162 |
| 163 void onRelease() override; |
| 164 void onAbandon() override; |
| 165 |
| 166 private: |
163 void invokeReleaseProc() { | 167 void invokeReleaseProc() { |
164 if (fReleaseProc) { | 168 if (fReleaseProc) { |
165 fReleaseProc(fReleaseCtx); | 169 fReleaseProc(fReleaseCtx); |
166 fReleaseProc = NULL; | 170 fReleaseProc = NULL; |
167 } | 171 } |
168 } | 172 } |
169 | 173 |
170 void onRelease() override; | |
171 void onAbandon() override; | |
172 | |
173 private: | |
174 ReleaseProc fReleaseProc; | 174 ReleaseProc fReleaseProc; |
175 ReleaseCtx fReleaseCtx; | 175 ReleaseCtx fReleaseCtx; |
176 | 176 |
177 typedef GrGpuResource INHERITED; | 177 typedef GrGpuResource INHERITED; |
178 }; | 178 }; |
179 | 179 |
180 #endif | 180 #endif |
OLD | NEW |