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 13 matching lines...) Expand all Loading... |
24 ~GrSingleTextureEffect() override; | 24 ~GrSingleTextureEffect() override; |
25 | 25 |
26 SkString dumpInfo() const override { | 26 SkString dumpInfo() const override { |
27 SkString str; | 27 SkString str; |
28 str.appendf("Texture: %d", fTextureAccess.getTexture()->getUniqueID()); | 28 str.appendf("Texture: %d", fTextureAccess.getTexture()->getUniqueID()); |
29 return str; | 29 return str; |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
33 /** unfiltered, clamp mode */ | 33 /** unfiltered, clamp mode */ |
34 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo
rdSet); | 34 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, |
| 35 GrCoordSet = kLocal_GrCoordSet); |
35 /** clamp mode */ | 36 /** clamp mode */ |
36 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo
de filterMode, | 37 GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&, |
37 GrCoordSet = kLocal_GrCoordSet); | 38 GrTextureParams::FilterMode filterMode, GrCoordSet = k
Local_GrCoordSet); |
38 GrSingleTextureEffect(GrTexture*, | 39 GrSingleTextureEffect(GrTexture*, |
| 40 sk_sp<GrColorSpaceXform>, |
39 const SkMatrix&, | 41 const SkMatrix&, |
40 const GrTextureParams&, | 42 const GrTextureParams&, |
41 GrCoordSet = kLocal_GrCoordSet); | 43 GrCoordSet = kLocal_GrCoordSet); |
42 | 44 |
43 /** | 45 /** |
44 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that | 46 * Can be used as a helper to implement subclass onComputeInvariantOutput().
It assumes that |
45 * the subclass output color will be a modulation of the input color with a
value read from the | 47 * the subclass output color will be a modulation of the input color with a
value read from the |
46 * texture. | 48 * texture. |
47 */ | 49 */ |
48 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { | 50 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { |
49 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { | 51 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { |
50 inout->mulByUnknownSingleComponent(); | 52 inout->mulByUnknownSingleComponent(); |
51 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { | 53 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { |
52 inout->mulByUnknownOpaqueFourComponents(); | 54 inout->mulByUnknownOpaqueFourComponents(); |
53 } else { | 55 } else { |
54 inout->mulByUnknownFourComponents(); | 56 inout->mulByUnknownFourComponents(); |
55 } | 57 } |
56 } | 58 } |
57 | 59 |
58 private: | 60 private: |
59 GrCoordTransform fCoordTransform; | 61 GrCoordTransform fCoordTransform; |
60 GrTextureAccess fTextureAccess; | 62 GrTextureAccess fTextureAccess; |
61 | 63 |
62 typedef GrFragmentProcessor INHERITED; | 64 typedef GrFragmentProcessor INHERITED; |
63 }; | 65 }; |
64 | 66 |
65 #endif | 67 #endif |
OLD | NEW |