diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-24 10:57:28 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-25 11:44:20 +0000 |
commit | dd3b3f41829d32d7eaf3eb4903570d49c2ba9ff8 (patch) | |
tree | 10b4a5919c2a7565510c7f6c4e2cbb311bb2822a /src/gpu/effects | |
parent | c1889823de68ffd2ef08b5c1969d41c98034ec6a (diff) |
Rm makeRenderTargetContext in favor of deferred version (take 3)
This is a reland of: https://skia-review.googlesource.com/c/13001/ (Rm makeRenderTargetContext in favor of deferred version)
TBR=bsalomon@google.com
Change-Id: If81f4d9fb889c091cd37ffde133d906fb3e37773
Reviewed-on: https://skia-review.googlesource.com/14027
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrSimpleTextureEffect.h | 24 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 2e0886f698..41c7e6f56c 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -121,10 +121,12 @@ bool GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context const SkImageInfo ii = SkImageInfo::Make(kSize, kSize, kRGBA_8888_SkColorType, kPremul_SkAlphaType); - sk_sp<GrRenderTargetContext> readRTC(context->makeRenderTargetContext(SkBackingFit::kExact, + sk_sp<GrRenderTargetContext> readRTC(context->makeDeferredRenderTargetContext( + SkBackingFit::kExact, kSize, kSize, kConfig, nullptr)); - sk_sp<GrRenderTargetContext> tempRTC(context->makeRenderTargetContext(SkBackingFit::kExact, + sk_sp<GrRenderTargetContext> tempRTC(context->makeDeferredRenderTargetContext( + SkBackingFit::kExact, kSize, kSize, kConfig, nullptr)); if (!readRTC || !readRTC->asTextureProxy() || !tempRTC) { diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index 8edec81a83..7d5232c3e0 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -25,6 +25,14 @@ public: sk_sp<GrTextureProxy> proxy, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix) { + // MDB TODO: remove this instantiation once instantiation is pushed past the + // TextureSamplers. Instantiation failure in the TextureSampler is difficult to + // recover from. + GrTexture* temp = proxy->instantiate(resourceProvider); + if (!temp) { + return nullptr; + } + return sk_sp<GrFragmentProcessor>( new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), matrix, @@ -37,6 +45,14 @@ public: sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, GrSamplerParams::FilterMode filterMode) { + // MDB TODO: remove this instantiation once instantiation is pushed past the + // TextureSamplers. Instantiation failure in the TextureSampler is difficult to + // recover from. + GrTexture* temp = proxy->instantiate(resourceProvider); + if (!temp) { + return nullptr; + } + return sk_sp<GrFragmentProcessor>( new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), @@ -48,6 +64,14 @@ public: sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, const GrSamplerParams& p) { + // MDB TODO: remove this instantiation once instantiation is pushed past the + // TextureSamplers. Instantiation failure in the TextureSampler is difficult to + // recover from. + GrTexture* temp = proxy->instantiate(resourceProvider); + if (!temp) { + return nullptr; + } + return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), |