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 | |
Robert Phillips | e4aae34 | 2018-03-14 10:26:57 -0400 | [diff] [blame] | 11 | #include "GrSurfaceProxy.h" |
Greg Daniel | 4684f82 | 2018-03-08 15:27:36 -0500 | [diff] [blame] | 12 | #include "SkTArray.h" |
| 13 | |
Greg Daniel | 4684f82 | 2018-03-08 15:27:36 -0500 | [diff] [blame] | 14 | class GrUninstantiateProxyTracker { |
| 15 | public: |
| 16 | GrUninstantiateProxyTracker() {} |
| 17 | |
| 18 | // Adds a proxy which will be uninstantiated at the end of flush. The same proxy may not be |
| 19 | // added multiple times. |
| 20 | void addProxy(GrSurfaceProxy* proxy); |
| 21 | |
| 22 | // Loops through all tracked proxies and uninstantiates them. |
| 23 | void uninstantiateAllProxies(); |
| 24 | |
| 25 | private: |
Robert Phillips | e4aae34 | 2018-03-14 10:26:57 -0400 | [diff] [blame] | 26 | SkTArray<sk_sp<GrSurfaceProxy>> fProxies; |
Greg Daniel | 4684f82 | 2018-03-08 15:27:36 -0500 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | #endif |