blob: 2555ab18c0e13f5af6dcfa15501df777935ee509 [file] [log] [blame]
Brian Salomon967df202018-12-07 11:15:53 -05001/*
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
14class GrDeinstantiateProxyTracker {
15public:
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
25private:
26 SkTArray<sk_sp<GrSurfaceProxy>> fProxies;
27};
28
29#endif