From c3fab1a5112f395604eda618bdb89f87a9c47e97 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 21 Sep 2021 21:01:34 -0400 Subject: [PATCH] Don't switch kDecal to kClamp Came across this when working on a new GM that happened to use a 1px wide image with decal sampling, this caused it to smear across a much larger than expected area. Change-Id: I05a12e4ae9a2a54f8a9a18050573a4f6b35197ac Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451357 Commit-Queue: Michael Ludwig Commit-Queue: Brian Salomon Auto-Submit: Michael Ludwig Reviewed-by: Brian Salomon --- src/shaders/SkImageShader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp index 2e44dd00ff..60fefc4edf 100755 --- a/src/shaders/SkImageShader.cpp +++ b/src/shaders/SkImageShader.cpp @@ -60,7 +60,9 @@ static SkTileMode optimize(SkTileMode tm, int dimension) { // for transforming to clamp. return tm; #else - return dimension == 1 ? SkTileMode::kClamp : tm; + // mirror and repeat on a 1px axis are the same as clamping, but decal will still transition to + // transparent black. + return (tm != SkTileMode::kDecal && dimension == 1) ? SkTileMode::kClamp : tm; #endif }