aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/imagefromyuvtextures.cpp4
-rw-r--r--src/gpu/GrProxyProvider.cpp10
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.fp6
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.h6
-rw-r--r--src/gpu/effects/GrRRectBlurEffect.fp7
-rw-r--r--src/gpu/effects/GrRRectBlurEffect.h4
6 files changed, 28 insertions, 9 deletions
diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp
index 72100c2a56..6334611666 100644
--- a/gm/imagefromyuvtextures.cpp
+++ b/gm/imagefromyuvtextures.cpp
@@ -118,7 +118,9 @@ protected:
}
for (int i = 0; i < 3; ++i) {
- gpu->deleteTestingOnlyBackendTexture(&yuvTextures[i]);
+ if (yuvTextures[i].isValid()) {
+ gpu->deleteTestingOnlyBackendTexture(&yuvTextures[i]);
+ }
}
context->resetContext();
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index d86f9bcb9e..c9617ad9c3 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -131,6 +131,10 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(const GrSurfaceDesc& d
const GrMipLevel& mipLevel) {
ASSERT_SINGLE_OWNER
+ if (this->isAbandoned()) {
+ return nullptr;
+ }
+
sk_sp<GrTexture> tex = fResourceProvider->createTexture(desc, budgeted, mipLevel);
if (!tex) {
return nullptr;
@@ -143,6 +147,12 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(
const GrSurfaceDesc& desc, SkBudgeted budgeted,
const GrMipLevel texels[], int mipLevelCount,
SkDestinationSurfaceColorMode mipColorMode) {
+ ASSERT_SINGLE_OWNER
+
+ if (this->isAbandoned()) {
+ return nullptr;
+ }
+
sk_sp<GrTexture> tex(fResourceProvider->createTexture(desc, budgeted,
texels, mipLevelCount,
mipColorMode));
diff --git a/src/gpu/effects/GrConfigConversionEffect.fp b/src/gpu/effects/GrConfigConversionEffect.fp
index a64ac43007..09935ddea1 100644
--- a/src/gpu/effects/GrConfigConversionEffect.fp
+++ b/src/gpu/effects/GrConfigConversionEffect.fp
@@ -1,6 +1,7 @@
@header {
#include "GrClip.h"
#include "GrContext.h"
+ #include "GrContextPriv.h"
#include "GrRenderTargetContext.h"
}
@@ -46,8 +47,9 @@
desc.fHeight = kSize;
desc.fConfig = kConfig;
- sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(context->proxyProvider(),
- desc,
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
+
+ sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(proxyProvider, desc,
SkBudgeted::kYes, data, 0);
if (!dataProxy) {
return false;
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index 66e8db6a7c..9656c7fafb 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -58,8 +58,10 @@ public:
desc.fHeight = kSize;
desc.fConfig = kConfig;
- sk_sp<GrTextureProxy> dataProxy = GrSurfaceProxy::MakeDeferred(
- context->contextPriv().proxyProvider(), desc, SkBudgeted::kYes, data, 0);
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
+
+ sk_sp<GrTextureProxy> dataProxy =
+ GrSurfaceProxy::MakeDeferred(proxyProvider, desc, SkBudgeted::kYes, data, 0);
if (!dataProxy) {
return false;
}
diff --git a/src/gpu/effects/GrRRectBlurEffect.fp b/src/gpu/effects/GrRRectBlurEffect.fp
index c21c4f07c7..3724331ccd 100644
--- a/src/gpu/effects/GrRRectBlurEffect.fp
+++ b/src/gpu/effects/GrRRectBlurEffect.fp
@@ -8,6 +8,7 @@ uniform half blurRadius;
@header {
#include "GrClip.h"
#include "GrContext.h"
+ #include "GrContextPriv.h"
#include "GrPaint.h"
#include "GrProxyProvider.h"
#include "GrRenderTargetContext.h"
@@ -36,7 +37,9 @@ uniform half blurRadius;
}
builder.finish();
- sk_sp<GrTextureProxy> mask(context->proxyProvider()->findOrCreateProxyByUniqueKey(
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
+
+ sk_sp<GrTextureProxy> mask(proxyProvider->findOrCreateProxyByUniqueKey(
key, kBottomLeft_GrSurfaceOrigin));
if (!mask) {
// TODO: this could be approx but the texture coords will need to be updated
@@ -75,7 +78,7 @@ uniform half blurRadius;
return nullptr;
}
SkASSERT(mask->origin() == kBottomLeft_GrSurfaceOrigin);
- context->proxyProvider()->assignUniqueKeyToProxy(key, mask.get());
+ proxyProvider->assignUniqueKeyToProxy(key, mask.get());
}
return mask;
diff --git a/src/gpu/effects/GrRRectBlurEffect.h b/src/gpu/effects/GrRRectBlurEffect.h
index b95f7b0eda..7b2c341f40 100644
--- a/src/gpu/effects/GrRRectBlurEffect.h
+++ b/src/gpu/effects/GrRRectBlurEffect.h
@@ -47,8 +47,8 @@ public:
GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
- sk_sp<GrTextureProxy> mask(proxyProvider->findOrCreateProxyByUniqueKey(
- key, kBottomLeft_GrSurfaceOrigin));
+ sk_sp<GrTextureProxy> mask(
+ proxyProvider->findOrCreateProxyByUniqueKey(key, kBottomLeft_GrSurfaceOrigin));
if (!mask) {
// TODO: this could be approx but the texture coords will need to be updated
sk_sp<GrRenderTargetContext> rtc(context->makeDeferredRenderTargetContextWithFallback(