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 "include/private/SkTArray.h" 12 #include "src/gpu/GrSurfaceProxy.h" 13 14 class GrResourceCache; 15 16 class GrDeinstantiateProxyTracker { 17 public: GrDeinstantiateProxyTracker()18 GrDeinstantiateProxyTracker() {} 19 20 // Adds a proxy which will be deinstantiated at the end of flush. The same proxy may not be 21 // added multiple times. 22 void addProxy(GrSurfaceProxy* proxy); 23 24 // Loops through all tracked proxies and deinstantiates them. 25 void deinstantiateAllProxies(); 26 27 private: 28 SkTArray<sk_sp<GrSurfaceProxy>> fProxies; 29 }; 30 31 #endif 32