aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxy.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-01-16 16:14:41 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-17 14:58:26 +0000
commit94a6ce84ece51ff1c46c698753716f3f47585742 (patch)
tree6e8354476a3f3cc1a32906aae553813371af1d35 /src/gpu/GrSurfaceProxy.cpp
parent4e6cf91b7e6f7908d941275dc56c829143345402 (diff)
Add ability for lazy proxy callback to free captured resources
This will be needed for DDLs that get recorded, but then deleted before the proxies actually get instantiated. Bug: skia: Change-Id: I745366fc7a7edbcd43bc617220d3d4997baa8319 Reviewed-on: https://skia-review.googlesource.com/95101 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index c9da6ce592..0408b79c91 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -83,6 +83,11 @@ GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, GrSurfaceOrigin origin,
}
GrSurfaceProxy::~GrSurfaceProxy() {
+ if (fLazyInstantiateCallback) {
+ // We have an uninstantiated lazy proxy. Call fLazyInstantiateCallback with a nullptr for
+ // the GrResourceProvider to signal the callback should clean itself up.
+ this->fLazyInstantiateCallback(nullptr, nullptr);
+ }
// For this to be deleted the opList that held a ref on it (if there was one) must have been
// deleted. Which would have cleared out this back pointer.
SkASSERT(!fLastOpList);