From 0dca28004792a73562b88723fb1570be11364e01 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Thu, 16 Apr 2020 10:17:57 -0400 Subject: [PATCH] Respect wrap mode when decimating for blur It used to be the case that bilerp wasn't supported for shader-based repeats and mirrors, but that is no longer the case. If we switched to ClampToBorder in those cases, we could introduce transparent black into the decimated image that would then infect the final blur. Bug: skia:10145 Change-Id: Ie273b4d64f082be3ddbdbf54acf201ff1fdfa133 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283940 Commit-Queue: Michael Ludwig Reviewed-by: Brian Salomon --- src/core/SkGpuBlurUtils.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp index b5d6ebb978..7ff294ccb0 100644 --- a/src/core/SkGpuBlurUtils.cpp +++ b/src/core/SkGpuBlurUtils.cpp @@ -300,14 +300,7 @@ static GrSurfaceProxyView decimate(GrRecordingContext* context, GrPaint paint; std::unique_ptr fp; if (i == 1) { - GrSamplerState::WrapMode wrapMode; - if (mode == SkTileMode::kClamp) { - wrapMode = GrSamplerState::WrapMode::kClamp; - } else { - // GrTextureEffect does not support WrapMode::k[Mirror]Repeat with - // GrSamplerState::Filter::kBilerp. So we use kClampToBorder. - wrapMode = GrSamplerState::WrapMode::kClampToBorder; - } + GrSamplerState::WrapMode wrapMode = SkTileModeToWrapMode(mode); const auto& caps = *context->priv().caps(); GrSamplerState sampler(wrapMode, GrSamplerState::Filter::kBilerp); fp = GrTextureEffect::MakeSubset(std::move(srcView), srcAlphaType, SkMatrix::I(),