GrBicubicEffect uses GrTextureEffect.
This opens the door to, but doesn't add support for, applying this
effect to other child processor types.
Fixes issue when applying effect to rectangle textures where steps were
done using increments of 1/w and 1/h instead of 1.
Change-Id: I74e20d6c96931c337b22b156a61c8e279c6fbc62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259420
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 407dfe3..629532b 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -637,13 +637,10 @@
} else if (nextH == srcH) {
dir = GrBicubicEffect::Direction::kX;
}
- if (srcW != texView.proxy()->width() || srcH != texView.proxy()->height()) {
- auto domain = GrTextureDomain::MakeTexelDomain(
- SkIRect::MakeXYWH(srcX, srcY, srcW, srcH), GrTextureDomain::kClamp_Mode);
- fp = GrBicubicEffect::Make(std::move(texView), matrix, domain, dir, prevAlphaType);
- } else {
- fp = GrBicubicEffect::Make(std::move(texView), matrix, dir, prevAlphaType);
- }
+ static constexpr GrSamplerState::WrapMode kWM = GrSamplerState::WrapMode::kClamp;
+ auto subset = SkRect::MakeXYWH(srcX, srcY, srcW, srcH);
+ fp = GrBicubicEffect::MakeSubset(std::move(texView), prevAlphaType, matrix, kWM, kWM,
+ subset, dir, *this->caps());
if (xform) {
fp = GrColorSpaceXformEffect::Make(std::move(fp), std::move(xform));
}