From dd3b3f41829d32d7eaf3eb4903570d49c2ba9ff8 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 24 Apr 2017 10:57:28 -0400 Subject: 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 Reviewed-by: Greg Daniel --- src/gpu/effects/GrConfigConversionEffect.cpp | 6 ++++-- src/gpu/effects/GrSimpleTextureEffect.h | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'src/gpu/effects') 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 readRTC(context->makeRenderTargetContext(SkBackingFit::kExact, + sk_sp readRTC(context->makeDeferredRenderTargetContext( + SkBackingFit::kExact, kSize, kSize, kConfig, nullptr)); - sk_sp tempRTC(context->makeRenderTargetContext(SkBackingFit::kExact, + sk_sp 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 proxy, sk_sp 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( new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), matrix, @@ -37,6 +45,14 @@ public: sk_sp 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( new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), @@ -48,6 +64,14 @@ public: sk_sp 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(new GrSimpleTextureEffect(resourceProvider, std::move(proxy), std::move(colorSpaceXform), -- cgit v1.2.3