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 GrDeinstantiateProxyTracker_DEFINED 9 #define GrDeinstantiateProxyTracker_DEFINED 10 11 #include "GrSurfaceProxy.h" 12 #include "SkTArray.h" 13 14 class GrDeinstantiateProxyTracker { 15 public: GrDeinstantiateProxyTracker()16 GrDeinstantiateProxyTracker() {} 17 18 // Adds a proxy which will be deinstantiated 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 deinstantiates them. 23 void deinstantiateAllProxies(); 24 25 private: 26 SkTArray<sk_sp<GrSurfaceProxy>> fProxies; 27 }; 28 29 #endif 30