Greg Daniel | 4684f82 | 2018-03-08 15:27:36 -0500 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrUninstantiateProxyTracker_DEFINED |
| 9 | #define GrUninstantiateProxyTracker_DEFINED |
| 10 | |
| 11 | #include "SkTArray.h" |
| 12 | |
| 13 | class GrSurfaceProxy; |
| 14 | |
| 15 | class GrUninstantiateProxyTracker { |
| 16 | public: |
| 17 | GrUninstantiateProxyTracker() {} |
| 18 | |
| 19 | // Adds a proxy which will be uninstantiated at the end of flush. The same proxy may not be |
| 20 | // added multiple times. |
| 21 | void addProxy(GrSurfaceProxy* proxy); |
| 22 | |
| 23 | // Loops through all tracked proxies and uninstantiates them. |
| 24 | void uninstantiateAllProxies(); |
| 25 | |
| 26 | private: |
| 27 | SkTArray<GrSurfaceProxy*> fProxies; |
| 28 | }; |
| 29 | |
| 30 | #endif |