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 11 matching lines...) Expand all Loading... |
22 // surrounding texels are needed by the kernel in x
and y. | 22 // surrounding texels are needed by the kernel in x
and y. |
23 }; | 23 }; |
24 virtual ~GrBicubicEffect(); | 24 virtual ~GrBicubicEffect(); |
25 | 25 |
26 static const char* Name() { return "Bicubic"; } | 26 static const char* Name() { return "Bicubic"; } |
27 const float* coefficients() const { return fCoefficients; } | 27 const float* coefficients() const { return fCoefficients; } |
28 | 28 |
29 typedef GrGLBicubicEffect GLProcessor; | 29 typedef GrGLBicubicEffect GLProcessor; |
30 | 30 |
31 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 31 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 32 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const SK_OVERRIDE; |
32 | 33 |
33 const GrTextureDomain& domain() const { return fDomain; } | 34 const GrTextureDomain& domain() const { return fDomain; } |
34 | 35 |
35 /** | 36 /** |
36 * Create a simple filter effect with custom bicubic coefficients and option
al domain. | 37 * Create a simple filter effect with custom bicubic coefficients and option
al domain. |
37 */ | 38 */ |
38 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien
ts[16], | 39 static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficien
ts[16], |
39 const SkRect* domain = NULL) { | 40 const SkRect* domain = NULL) { |
40 if (NULL == domain) { | 41 if (NULL == domain) { |
41 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti
leMode, | 42 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti
leMode, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, | 86 static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, |
86 GrTextureParams::FilterMode* filterMode); | 87 GrTextureParams::FilterMode* filterMode); |
87 | 88 |
88 private: | 89 private: |
89 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], | 90 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], |
90 const SkMatrix &matrix, const SkShader::TileMode tileModes[2
]); | 91 const SkMatrix &matrix, const SkShader::TileMode tileModes[2
]); |
91 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], | 92 GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], |
92 const SkMatrix &matrix, const SkRect& domain); | 93 const SkMatrix &matrix, const SkRect& domain); |
93 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; | 94 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; |
94 | 95 |
95 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | |
96 | |
97 float fCoefficients[16]; | 96 float fCoefficients[16]; |
98 GrTextureDomain fDomain; | 97 GrTextureDomain fDomain; |
99 | 98 |
100 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 99 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
101 | 100 |
102 static const SkScalar gMitchellCoefficients[16]; | 101 static const SkScalar gMitchellCoefficients[16]; |
103 | 102 |
104 typedef GrSingleTextureEffect INHERITED; | 103 typedef GrSingleTextureEffect INHERITED; |
105 }; | 104 }; |
106 | 105 |
107 #endif | 106 #endif |
OLD | NEW |