Index: src/gpu/effects/GrBicubicEffect.h |
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h |
index 3c84f979191d396fb0430deac717d9c0c674675d..56bd90bdbe43408a93117a5900f8075cae09c826 100644 |
--- a/src/gpu/effects/GrBicubicEffect.h |
+++ b/src/gpu/effects/GrBicubicEffect.h |
@@ -32,16 +32,18 @@ public: |
/** |
* Create a simple filter effect with custom bicubic coefficients and optional domain. |
*/ |
- static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkScalar coefficients[16], |
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, |
+ sk_sp<GrColorSpaceXform> colorSpaceXform, |
+ const SkScalar coefficients[16], |
const SkRect* domain = nullptr) { |
if (nullptr == domain) { |
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode, |
SkShader::kClamp_TileMode }; |
- return Make(tex, coefficients, GrCoordTransform::MakeDivByTextureWHMatrix(tex), |
- kTileModes); |
+ return Make(tex, std::move(colorSpaceXform), coefficients, |
+ GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTileModes); |
} else { |
return sk_sp<GrFragmentProcessor>( |
- new GrBicubicEffect(tex, coefficients, |
+ new GrBicubicEffect(tex, std::move(colorSpaceXform), coefficients, |
GrCoordTransform::MakeDivByTextureWHMatrix(tex), *domain)); |
} |
} |
@@ -49,28 +51,35 @@ public: |
/** |
* Create a Mitchell filter effect with specified texture matrix and x/y tile modes. |
*/ |
- static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkMatrix& matrix, |
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, |
+ sk_sp<GrColorSpaceXform> colorSpaceXform, |
+ const SkMatrix& matrix, |
const SkShader::TileMode tileModes[2]) { |
- return Make(tex, gMitchellCoefficients, matrix, tileModes); |
+ return Make(tex, std::move(colorSpaceXform), gMitchellCoefficients, matrix, tileModes); |
} |
/** |
* Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y |
* tilemodes. |
*/ |
- static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkScalar coefficients[16], |
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, |
+ sk_sp<GrColorSpaceXform> colorSpaceXform, |
+ const SkScalar coefficients[16], |
const SkMatrix& matrix, |
const SkShader::TileMode tileModes[2]) { |
- return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, coefficients, matrix, |
- tileModes)); |
+ return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, std::move(colorSpaceXform), |
+ coefficients, matrix, tileModes)); |
} |
/** |
* Create a Mitchell filter effect with a texture matrix and a domain. |
*/ |
- static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkMatrix& matrix, |
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, |
+ sk_sp<GrColorSpaceXform> colorSpaceXform, |
+ const SkMatrix& matrix, |
const SkRect& domain) { |
- return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, gMitchellCoefficients, matrix, |
+ return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, std::move(colorSpaceXform), |
+ gMitchellCoefficients, matrix, |
domain)); |
} |
@@ -85,10 +94,10 @@ public: |
GrTextureParams::FilterMode* filterMode); |
private: |
- GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], const SkMatrix &matrix, |
- const SkShader::TileMode tileModes[2]); |
- GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], const SkMatrix &matrix, |
- const SkRect& domain); |
+ GrBicubicEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkScalar coefficients[16], |
+ const SkMatrix &matrix, const SkShader::TileMode tileModes[2]); |
+ GrBicubicEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkScalar coefficients[16], |
+ const SkMatrix &matrix, const SkRect& domain); |
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |