Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrBicubicTextureEffect_DEFINED | 8 #ifndef GrBicubicTextureEffect_DEFINED |
| 9 #define GrBicubicTextureEffect_DEFINED | 9 #define GrBicubicTextureEffect_DEFINED |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * Create a Mitchell filter effect with a texture matrix and a domain. | 73 * Create a Mitchell filter effect with a texture matrix and a domain. |
| 74 */ | 74 */ |
| 75 static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const SkR ect& domain) { | 75 static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const SkR ect& domain) { |
| 76 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoeffi cients, matrix, | 76 AutoEffectUnref effect(SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoeffi cients, matrix, |
| 77 domain))); | 77 domain))); |
| 78 return CreateEffectRef(effect); | 78 return CreateEffectRef(effect); |
| 79 } | 79 } |
| 80 | 80 |
| 81 /** | |
|
robertphillips
2014/05/20 15:34:50
The return value discussion doesn't seem right.
Ma
bsalomon
2014/05/20 16:13:06
Done.
| |
| 82 * Determines whether the bicubic effect should be used based on the transfo rmation from the | |
| 83 * local coords to the device. filterMode will be set to kNearest if true is returned (as no | |
| 84 * built-in filtering should be used with the bicubic effect) or the fallbac k filterMode that | |
| 85 * should be used if false is returned. | |
| 86 */ | |
| 87 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, | |
| 88 GrTextureParams::FilterMode* filterMode); | |
| 89 | |
| 81 private: | 90 private: |
| 82 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], | 91 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], |
| 83 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]); | 92 const SkMatrix &matrix, const SkShader::TileMode tileModes[2 ]); |
| 84 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], | 93 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], |
| 85 const SkMatrix &matrix, const SkRect& domain); | 94 const SkMatrix &matrix, const SkRect& domain); |
| 86 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 95 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
| 87 | 96 |
| 88 float fCoefficients[16]; | 97 float fCoefficients[16]; |
| 89 GrTextureDomain fDomain; | 98 GrTextureDomain fDomain; |
| 90 | 99 |
| 91 GR_DECLARE_EFFECT_TEST; | 100 GR_DECLARE_EFFECT_TEST; |
| 92 | 101 |
| 93 static const SkScalar gMitchellCoefficients[16]; | 102 static const SkScalar gMitchellCoefficients[16]; |
| 94 | 103 |
| 95 typedef GrSingleTextureEffect INHERITED; | 104 typedef GrSingleTextureEffect INHERITED; |
| 96 }; | 105 }; |
| 97 | 106 |
| 98 #endif | 107 #endif |
| OLD | NEW |