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 |
11 #include "GrSingleTextureEffect.h" | 11 #include "GrSingleTextureEffect.h" |
12 #include "GrTextureDomain.h" | 12 #include "GrTextureDomain.h" |
13 #include "gl/GrGLProcessor.h" | 13 #include "gl/GrGLProcessor.h" |
14 #include "GrTBackendProcessorFactory.h" | 14 #include "GrTBackendProcessorFactory.h" |
15 | 15 |
16 class GrGLBicubicEffect; | 16 class GrGLBicubicEffect; |
| 17 class GrInvariantOutput; |
17 | 18 |
18 class GrBicubicEffect : public GrSingleTextureEffect { | 19 class GrBicubicEffect : public GrSingleTextureEffect { |
19 public: | 20 public: |
20 enum { | 21 enum { |
21 kFilterTexelPad = 2, // Given a src rect in texels to be filtered, this
number of | 22 kFilterTexelPad = 2, // Given a src rect in texels to be filtered, this
number of |
22 // surrounding texels are needed by the kernel in x
and y. | 23 // surrounding texels are needed by the kernel in x
and y. |
23 }; | 24 }; |
24 virtual ~GrBicubicEffect(); | 25 virtual ~GrBicubicEffect(); |
25 | 26 |
26 static const char* Name() { return "Bicubic"; } | 27 static const char* Name() { return "Bicubic"; } |
(...skipping 58 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 GrFragmentProcessor&) const SK_OVERRIDE; | 94 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
94 | 95 |
95 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | 96 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; |
96 | 97 |
97 float fCoefficients[16]; | 98 float fCoefficients[16]; |
98 GrTextureDomain fDomain; | 99 GrTextureDomain fDomain; |
99 | 100 |
100 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 101 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
101 | 102 |
102 static const SkScalar gMitchellCoefficients[16]; | 103 static const SkScalar gMitchellCoefficients[16]; |
103 | 104 |
104 typedef GrSingleTextureEffect INHERITED; | 105 typedef GrSingleTextureEffect INHERITED; |
105 }; | 106 }; |
106 | 107 |
107 #endif | 108 #endif |
OLD | NEW |