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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 const char* name() const override { return "Bicubic"; } | 28 const char* name() const override { return "Bicubic"; } |
29 | 29 |
30 const GrTextureDomain& domain() const { return fDomain; } | 30 const GrTextureDomain& domain() const { return fDomain; } |
31 | 31 |
32 /** | 32 /** |
33 * Create a simple filter effect with custom bicubic coefficients and option
al domain. | 33 * Create a simple filter effect with custom bicubic coefficients and option
al domain. |
34 */ | 34 */ |
35 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
GrTexture* tex, | 35 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
GrTexture* tex, |
36 const SkScalar coefficients[16], | 36 const SkScalar coefficients[16], |
37 const SkRect* domain = NULL) { | 37 const SkRect* domain = nullptr) { |
38 if (NULL == domain) { | 38 if (nullptr == domain) { |
39 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti
leMode, | 39 static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_Ti
leMode, |
40 SkShader::kClamp_Ti
leMode }; | 40 SkShader::kClamp_Ti
leMode }; |
41 return Create(procDataManager, tex, coefficients, | 41 return Create(procDataManager, tex, coefficients, |
42 GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTile
Modes); | 42 GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTile
Modes); |
43 } else { | 43 } else { |
44 return new GrBicubicEffect(procDataManager, tex, coefficients, | 44 return new GrBicubicEffect(procDataManager, tex, coefficients, |
45 GrCoordTransform::MakeDivByTextureWHMatri
x(tex), *domain); | 45 GrCoordTransform::MakeDivByTextureWHMatri
x(tex), *domain); |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 GrTextureDomain fDomain; | 101 GrTextureDomain fDomain; |
102 | 102 |
103 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 103 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
104 | 104 |
105 static const SkScalar gMitchellCoefficients[16]; | 105 static const SkScalar gMitchellCoefficients[16]; |
106 | 106 |
107 typedef GrSingleTextureEffect INHERITED; | 107 typedef GrSingleTextureEffect INHERITED; |
108 }; | 108 }; |
109 | 109 |
110 #endif | 110 #endif |
OLD | NEW |