Index: src/gpu/effects/GrBicubicEffect.h |
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h |
index d8c431a4a16ce91fc2ba32536f4a60fe258793ce..85bec771b4706858439a457f389abb9ddec8c0c1 100644 |
--- a/src/gpu/effects/GrBicubicEffect.h |
+++ b/src/gpu/effects/GrBicubicEffect.h |
@@ -31,34 +31,44 @@ public: |
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE; |
- static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16]) { |
- AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, coefficients))); |
- return CreateEffectRef(effect); |
+ /** |
+ * Create a simple Mitchell filter effect. |
+ */ |
+ static GrEffectRef* Create(GrTexture* tex) { |
+ return Create(tex, gMitchellCoefficients); |
} |
- static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16], |
- const SkMatrix& matrix, |
- const GrTextureParams& p, |
- GrCoordSet coordSet = kLocal_GrCoordSet) { |
- AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, coefficients, matrix, p, coordSet))); |
- return CreateEffectRef(effect); |
+ /** |
+ * Create a simple filter effect with custom bicubic coefficients. |
+ */ |
+ static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16]) { |
+ const SkShader::TileMode tm[] = { SkShader::kClamp_TileMode, SkShader::kClamp_TileMode }; |
+ return Create(tex, coefficients, MakeDivByTextureWHMatrix(tex), tm); |
} |
- static GrEffectRef* Create(GrTexture* tex) { |
- return Create(tex, gMitchellCoefficients); |
+ /** |
+ * Create a Mitchell filter effect with specified texture matrix and x/y tile modes. |
+ */ |
+ static GrEffectRef* Create(GrTexture* tex, |
+ const SkMatrix& matrix, |
+ SkShader::TileMode tileModes[2]) { |
+ return Create(tex, gMitchellCoefficients, matrix, tileModes); |
} |
- static GrEffectRef* Create(GrTexture* tex, |
+ /** |
+ * The most general Create method. This allows specification of the bicubic coefficients, the |
+ * texture matrix, and the x/y tilemodes. |
+ */ |
+ static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16], |
const SkMatrix& matrix, |
- const GrTextureParams& p, |
- GrCoordSet coordSet = kLocal_GrCoordSet) { |
- return Create(tex, gMitchellCoefficients, matrix, p, coordSet); |
+ const SkShader::TileMode tileModes[2]) { |
+ AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, coefficients, matrix, tileModes))); |
+ return CreateEffectRef(effect); |
} |
private: |
- GrBicubicEffect(GrTexture*, const SkScalar coefficients[16]); |
GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], |
- const SkMatrix &matrix, const GrTextureParams &p, GrCoordSet coordSet); |
+ const SkMatrix &matrix, const SkShader::TileMode tileModes[2]); |
virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
float fCoefficients[16]; |