diff options
author | Robert Phillips <robertphillips@google.com> | 2018-01-08 14:53:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-08 20:23:31 +0000 |
commit | 579f094f1259931c30dfd1623e8e22d74b4a7531 (patch) | |
tree | 03995e86a274aea4bad096ec7bbfe247a465a707 /src | |
parent | 1afd4cdb0800e2e395b465da24eb71e0e834dafa (diff) |
Fix build
This fixes two issues with https://skia-review.googlesource.com/c/skia/+/91501:
1) The .fp files weren't updated to handle the move of proxyProvider to GrContextPriv
2) There were some missing guards for abandoned context's in the proxyprovider
Change-Id: I2a704ff2aec5f8f9a7ebaab9b8632abb5cf2e42c
Reviewed-on: https://skia-review.googlesource.com/92084
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrProxyProvider.cpp | 10 | ||||
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.fp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.h | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrRRectBlurEffect.fp | 7 | ||||
-rw-r--r-- | src/gpu/effects/GrRRectBlurEffect.h | 4 |
5 files changed, 25 insertions, 8 deletions
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( |