Add return value to doLazyInstantiation to know if it succeedes.

This allows us to return nullptr in places where we try to instantiate
immediately and it fails.

Bug: skia:
Change-Id: Ic3da26b0e6270b3de114d80533f0580b4d6bf0e7
Reviewed-on: https://skia-review.googlesource.com/99381
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 006fd00..b4ce1b2 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -164,6 +164,10 @@
             }
 
             REPORTER_ASSERT(reporter, genProxy->priv().isInstantiated());
+            if (!genProxy->priv().isInstantiated()) {
+                gpu->deleteTestingOnlyBackendTexture(&backendTex);
+                return;
+            }
 
             GrTexture* genTexture = genProxy->priv().peekTexture();
             REPORTER_ASSERT(reporter, genTexture);