aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
Diffstat (limited to 'gm')
-rw-r--r--gm/imagefromyuvtextures.cpp7
-rw-r--r--gm/rectangletexture.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp
index 4139ca802b..87ab51ec1d 100644
--- a/gm/imagefromyuvtextures.cpp
+++ b/gm/imagefromyuvtextures.cpp
@@ -94,6 +94,10 @@ protected:
}
void createYUVTextures(GrContext* context, GrBackendTexture yuvTextures[3]) {
+ if (context->contextPriv().abandoned()) {
+ return;
+ }
+
GrGpu* gpu = context->contextPriv().getGpu();
if (!gpu) {
return;
@@ -111,6 +115,9 @@ protected:
}
void deleteYUVTextures(GrContext* context, GrBackendTexture yuvTextures[3]) {
+ if (context->contextPriv().abandoned()) {
+ return;
+ }
GrGpu* gpu = context->contextPriv().getGpu();
if (!gpu) {
diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp
index a603be7bdc..d6bf1fb87e 100644
--- a/gm/rectangletexture.cpp
+++ b/gm/rectangletexture.cpp
@@ -60,6 +60,9 @@ protected:
if (!context) {
return nullptr;
}
+ if (context->contextPriv().abandoned()) {
+ return nullptr;
+ }
GrGpu* gpu = context->contextPriv().getGpu();
if (!gpu) {
return nullptr;