blob: 5245466fd7a2153671130e4996af6f571a3ab478 [file] [log] [blame]
Greg Daniel4684f822018-03-08 15:27:36 -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 GrUninstantiateProxyTracker_DEFINED
9#define GrUninstantiateProxyTracker_DEFINED
10
Robert Phillipse4aae342018-03-14 10:26:57 -040011#include "GrSurfaceProxy.h"
Greg Daniel4684f822018-03-08 15:27:36 -050012#include "SkTArray.h"
13
Greg Daniel4684f822018-03-08 15:27:36 -050014class GrUninstantiateProxyTracker {
15public:
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
25private:
Robert Phillipse4aae342018-03-14 10:26:57 -040026 SkTArray<sk_sp<GrSurfaceProxy>> fProxies;
Greg Daniel4684f822018-03-08 15:27:36 -050027};
28
29#endif