aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tests/EGLImageTest.cpp3
-rw-r--r--tests/ResourceCacheTest.cpp5
-rw-r--r--tests/SurfaceTest.cpp7
3 files changed, 11 insertions, 4 deletions
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index 9ea6379dc6..efa7de20d7 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -88,7 +88,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) {
backendTexture1 =
gpu1->createTestingOnlyBackendTexture(nullptr, kSize, kSize, kRGBA_8888_GrPixelConfig,
false, GrMipMapped::kNo);
- if (!gpu1->isTestingOnlyBackendTexture(backendTexture1)) {
+
+ if (!backendTexture1.isValid() || !gpu1->isTestingOnlyBackendTexture(backendTexture1)) {
ERRORF(reporter, "Error creating texture for EGL Image");
cleanup(glCtx0, externalTexture.fID, glCtx1.get(), context1, &backendTexture1, image);
return;
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 7b2d835db4..27d197143d 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -211,6 +211,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheWrappedResources, reporter, ctxI
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();
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 0864e32380..a07b3361ef 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -592,7 +592,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture(
*outTexture = context->getGpu()->createTestingOnlyBackendTexture(
pixels.get(), kWidth, kHeight, kRGBA_8888_GrPixelConfig, true, GrMipMapped::kNo);
- if (!context->getGpu()->isTestingOnlyBackendTexture(*outTexture)) {
+ if (!outTexture->isValid() || !context->getGpu()->isTestingOnlyBackendTexture(*outTexture)) {
return nullptr;
}
@@ -617,7 +617,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
*outTexture = context->getGpu()->createTestingOnlyBackendTexture(
pixels.get(), kWidth, kHeight, kRGBA_8888_GrPixelConfig, true, GrMipMapped::kNo);
- if (!context->getGpu()->isTestingOnlyBackendTexture(*outTexture)) {
+ if (!outTexture->isValid() || !context->getGpu()->isTestingOnlyBackendTexture(*outTexture)) {
return nullptr;
}
@@ -889,7 +889,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter,
GrBackendTexture backendTex = context->getGpu()->createTestingOnlyBackendTexture(
nullptr, kSize, kSize, config, true, GrMipMapped::kNo);
- if (!context->getGpu()->isTestingOnlyBackendTexture(backendTex)) {
+ if (!backendTex.isValid() ||
+ !context->getGpu()->isTestingOnlyBackendTexture(backendTex)) {
return sk_sp<SkSurface>(nullptr);
}
backendTextures.push_back(backendTex);