OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrVkResource_DEFINED | 8 #ifndef GrVkResource_DEFINED |
9 #define GrVkResource_DEFINED | 9 #define GrVkResource_DEFINED |
10 | 10 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 } | 184 } |
185 | 185 |
186 mutable int32_t fRefCnt; | 186 mutable int32_t fRefCnt; |
187 #ifdef SK_TRACE_VK_RESOURCES | 187 #ifdef SK_TRACE_VK_RESOURCES |
188 uint32_t fKey; | 188 uint32_t fKey; |
189 #endif | 189 #endif |
190 | 190 |
191 typedef SkNoncopyable INHERITED; | 191 typedef SkNoncopyable INHERITED; |
192 }; | 192 }; |
193 | 193 |
194 // This subclass allows for recycling | |
195 class GrVkRecycledResource : public GrVkResource { | |
196 public: | |
197 void recycle(GrVkGpu* gpu) const { | |
198 if (this->unique()) { | |
199 this->onRecycle(gpu); | |
jvanverth1
2016/07/20 14:08:47
Why not put the unref in here?
egdaniel
2016/07/20 14:48:39
Done.
| |
200 } | |
201 } | |
202 | |
203 private: | |
204 virtual void onRecycle(GrVkGpu* gpu) const = 0; | |
205 }; | |
194 | 206 |
195 #endif | 207 #endif |
OLD | NEW |