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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 fCoordTransform.getMatrix().cheapEqualTo(other.fCoordTransform.ge
tMatrix()) && | 42 fCoordTransform.getMatrix().cheapEqualTo(other.fCoordTransform.ge
tMatrix()) && |
43 fCoordTransform.sourceCoords() == other.fCoordTransform.sourceCoo
rds(); | 43 fCoordTransform.sourceCoords() == other.fCoordTransform.sourceCoo
rds(); |
44 } | 44 } |
45 | 45 |
46 /** | 46 /** |
47 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that | 47 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that |
48 * the subclass output color will be a modulation of the input color with a
value read from the | 48 * the subclass output color will be a modulation of the input color with a
value read from the |
49 * texture. | 49 * texture. |
50 */ | 50 */ |
51 void updateInvariantOutputForModulation(InvariantOutput* inout) const { | 51 void updateInvariantOutputForModulation(InvariantOutput* inout) const { |
52 if (inout->isOpaque() && GrPixelConfigIsOpaque(this->texture(0)->config(
))) { | 52 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { |
53 inout->fValidFlags = kA_GrColorComponentFlag; | 53 inout->mulByUnknownOpaqueColor(); |
54 } else { | 54 } else { |
55 inout->fValidFlags = 0; | 55 inout->mulByUnknownColor(); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 GrCoordTransform fCoordTransform; | 60 GrCoordTransform fCoordTransform; |
61 GrTextureAccess fTextureAccess; | 61 GrTextureAccess fTextureAccess; |
62 | 62 |
63 typedef GrFragmentProcessor INHERITED; | 63 typedef GrFragmentProcessor INHERITED; |
64 }; | 64 }; |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |