GrDeinstantiateProxyTracker.h 752 B

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