| 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 GrSimpleTextureEffect_DEFINED | 8 #ifndef GrSimpleTextureEffect_DEFINED |
| 9 #define GrSimpleTextureEffect_DEFINED | 9 #define GrSimpleTextureEffect_DEFINED |
| 10 | 10 |
| 11 #include "GrSingleTextureEffect.h" | 11 #include "GrSingleTextureEffect.h" |
| 12 | 12 |
| 13 class GrInvariantOutput; | 13 class GrInvariantOutput; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * The output color of this effect is a modulation of the input color and a samp
le from a texture. | 16 * The output color of this effect is a modulation of the input color and a samp
le from a texture. |
| 17 * It allows explicit specification of the filtering and wrap modes (GrTexturePa
rams). It can use | 17 * It allows explicit specification of the filtering and wrap modes (GrTexturePa
rams). It can use |
| 18 * local coords, positions, or a custom vertex attribute as input texture coords
. The input coords | 18 * local coords or device space coords as input texture coords. The input coords
may be transformed |
| 19 * can have a matrix applied in the VS in both the local and position cases but
not with a custom | 19 * by a matrix. |
| 20 * attribute coords at this time. It will add a varying to input interpolate tex
ture coords to the | |
| 21 * FS. | |
| 22 */ | 20 */ |
| 23 class GrSimpleTextureEffect : public GrSingleTextureEffect { | 21 class GrSimpleTextureEffect : public GrSingleTextureEffect { |
| 24 public: | 22 public: |
| 25 /* unfiltered, clamp mode */ | 23 /* unfiltered, clamp mode */ |
| 26 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, | 24 static const GrFragmentProcessor* Create(GrProcessorDataManager* procDataMan
ager, |
| 27 GrTexture* tex, | 25 GrTexture* tex, |
| 28 const SkMatrix& matrix, | 26 const SkMatrix& matrix, |
| 29 GrCoordSet coordSet = kLocal_GrCoordSet)
{ | 27 GrCoordSet coordSet = kLocal_GrCoor
dSet) { |
| 30 return new GrSimpleTextureEffect(procDataManager, tex, matrix, | 28 return new GrSimpleTextureEffect(procDataManager, tex, matrix, |
| 31 GrTextureParams::kNone_FilterMode, coor
dSet); | 29 GrTextureParams::kNone_FilterMode, coor
dSet); |
| 32 } | 30 } |
| 33 | 31 |
| 34 /* clamp mode */ | 32 /* clamp mode */ |
| 35 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, | 33 static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, |
| 36 GrTexture* tex, | 34 GrTexture* tex, |
| 37 const SkMatrix& matrix, | 35 const SkMatrix& matrix, |
| 38 GrTextureParams::FilterMode filterMode, | 36 GrTextureParams::FilterMode filterMode, |
| 39 GrCoordSet coordSet = kLocal_GrCoordSet)
{ | 37 GrCoordSet coordSet = kLocal_GrCoordSet)
{ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool onIsEqual(const GrFragmentProcessor& other) const override { return tru
e; } | 76 bool onIsEqual(const GrFragmentProcessor& other) const override { return tru
e; } |
| 79 | 77 |
| 80 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 78 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
| 81 | 79 |
| 82 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 80 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 83 | 81 |
| 84 typedef GrSingleTextureEffect INHERITED; | 82 typedef GrSingleTextureEffect INHERITED; |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 #endif | 85 #endif |
| OLD | NEW |