Add valid checks in places we query isTestingOnlyBackendTexture
Bug: skia:7477
Change-Id: I410427f12c7bb85d11a5e4ed1f09bbd80bbbb54c
Reviewed-on: https://skia-review.googlesource.com/93000
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 7b2d835..27d1971 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -211,6 +211,11 @@
backendTextures[1] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH,
kRGBA_8888_GrPixelConfig,
false, GrMipMapped::kNo);
+ REPORTER_ASSERT(reporter, backendTextures[0].isValid());
+ REPORTER_ASSERT(reporter, backendTextures[1].isValid());
+ if (!backendTextures[0].isValid() || !backendTextures[1].isValid()) {
+ return;
+ }
context->resetContext();