Have lazy proxies keep their callbacks around and clean up their lambdas in the dtor
I believe after this CL we will be at a place where we just have to null out the
fTarget of a lazy proxy and it will reinstantiate itself.
Bug: skia:
Change-Id: I88fdc70e149eba4514a0823da99383583394005c
Reviewed-on: https://skia-review.googlesource.com/102021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index d1b77d2..9eb37a0 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -61,6 +61,9 @@
}
bool GrRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) {
+ if (LazyState::kNot != this->lazyInstantiationState()) {
+ return false;
+ }
static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag;
if (!this->instantiateImpl(resourceProvider, fSampleCnt, fNeedsStencil, kFlags,