Make GrBicubicEffect also support centripetal Catmull-Rom kernel.
Use new kernel in async rescale APIs.
Bug: skia:8962
Change-Id: Ife8f56f54b5df58cedd65b54083c7c0716b8c633
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216352
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a2b45fd..3bac37e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -967,6 +967,7 @@
// the rest from the SkPaint.
std::unique_ptr<GrFragmentProcessor> fp;
+ static constexpr auto kBicubicKernel = GrBicubicEffect::Kernel::kMitchell;
if (needsTextureDomain && (SkCanvas::kStrict_SrcRectConstraint == constraint)) {
// Use a constrained texture domain to avoid color bleeding
SkRect domain;
@@ -984,7 +985,7 @@
}
if (bicubic) {
static constexpr auto kDir = GrBicubicEffect::Direction::kXY;
- fp = GrBicubicEffect::Make(std::move(proxy), texMatrix, domain, kDir,
+ fp = GrBicubicEffect::Make(std::move(proxy), texMatrix, domain, kBicubicKernel, kDir,
bitmap.alphaType());
} else {
fp = GrTextureDomainEffect::Make(std::move(proxy), texMatrix, domain,
@@ -994,7 +995,8 @@
SkASSERT(GrSamplerState::Filter::kNearest == samplerState.filter());
GrSamplerState::WrapMode wrapMode[2] = {samplerState.wrapModeX(), samplerState.wrapModeY()};
static constexpr auto kDir = GrBicubicEffect::Direction::kXY;
- fp = GrBicubicEffect::Make(std::move(proxy), texMatrix, wrapMode, kDir, bitmap.alphaType());
+ fp = GrBicubicEffect::Make(std::move(proxy), texMatrix, wrapMode, kBicubicKernel, kDir,
+ bitmap.alphaType());
} else {
fp = GrSimpleTextureEffect::Make(std::move(proxy), texMatrix, samplerState);
}