OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrSingleTextureEffect_DEFINED | 8 #ifndef GrSingleTextureEffect_DEFINED |
9 #define GrSingleTextureEffect_DEFINED | 9 #define GrSingleTextureEffect_DEFINED |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 const GrTextureParams&, | 34 const GrTextureParams&, |
35 GrCoordSet = kLocal_GrCoordSet); | 35 GrCoordSet = kLocal_GrCoordSet); |
36 | 36 |
37 /** | 37 /** |
38 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that | 38 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that |
39 * the subclass output color will be a modulation of the input color with a
value read from the | 39 * the subclass output color will be a modulation of the input color with a
value read from the |
40 * texture. | 40 * texture. |
41 */ | 41 */ |
42 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { | 42 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { |
43 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { | 43 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { |
44 inout->mulByUnknownAlpha(); | 44 inout->mulByUnknownSingleComponent(); |
45 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { | 45 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { |
46 inout->mulByUnknownOpaqueColor(); | 46 inout->mulByUnknownOpaqueFourComponents(); |
47 } else { | 47 } else { |
48 inout->mulByUnknownColor(); | 48 inout->mulByUnknownFourComponents(); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
53 GrCoordTransform fCoordTransform; | 53 GrCoordTransform fCoordTransform; |
54 GrTextureAccess fTextureAccess; | 54 GrTextureAccess fTextureAccess; |
55 | 55 |
56 typedef GrFragmentProcessor INHERITED; | 56 typedef GrFragmentProcessor INHERITED; |
57 }; | 57 }; |
58 | 58 |
59 #endif | 59 #endif |
OLD | NEW |