Make GrTextureProducer take optional subset and domain rects
Split bicubic into separate functions.
Removes usage of null GrSamplerState::Filter to indicate bicubic.
Bug: skia:10344
Change-Id: Ife649ba84afe3a06d7d8fb0d46677ce96fc264dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302636
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp
index bddf275..f02365e 100644
--- a/src/gpu/GrTextureMaker.cpp
+++ b/src/gpu/GrTextureMaker.cpp
@@ -24,28 +24,20 @@
std::unique_ptr<GrFragmentProcessor> GrTextureMaker::createFragmentProcessor(
const SkMatrix& textureMatrix,
- const SkRect& constraintRect,
- FilterConstraint filterConstraint,
- bool coordsLimitedToConstraintRect,
- GrSamplerState::WrapMode wrapX,
- GrSamplerState::WrapMode wrapY,
- const GrSamplerState::Filter* filterOrNullForBicubic) {
+ const SkRect* subset,
+ const SkRect* domain,
+ GrSamplerState sampler) {
GrSurfaceProxyView view;
- if (filterOrNullForBicubic) {
- view = this->view(*filterOrNullForBicubic);
- } else {
- view = this->view(GrMipMapped::kNo);
- }
- if (!view) {
- return nullptr;
- }
+ return this->createFragmentProcessorForView(
+ this->view(sampler.filter()), textureMatrix, subset, domain, sampler);
+}
- return this->createFragmentProcessorForSubsetAndFilter(std::move(view),
- textureMatrix,
- coordsLimitedToConstraintRect,
- filterConstraint,
- constraintRect,
- wrapX,
- wrapY,
- filterOrNullForBicubic);
+std::unique_ptr<GrFragmentProcessor> GrTextureMaker::createBicubicFragmentProcessor(
+ const SkMatrix& textureMatrix,
+ const SkRect* subset,
+ const SkRect* domain,
+ GrSamplerState::WrapMode wrapX,
+ GrSamplerState::WrapMode wrapY) {
+ return this->createBicubicFragmentProcessorForView(
+ this->view(GrMipMapped::kNo), textureMatrix, subset, domain, wrapX, wrapY);
}