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 GrConfigConversionEffect_DEFINED | 8 #ifndef GrConfigConversionEffect_DEFINED |
9 #define GrConfigConversionEffect_DEFINED | 9 #define GrConfigConversionEffect_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 /** | 24 /** |
25 * The PM->UPM or UPM->PM conversions to apply. | 25 * The PM->UPM or UPM->PM conversions to apply. |
26 */ | 26 */ |
27 enum PMConversion { | 27 enum PMConversion { |
28 kNone_PMConversion = 0, | 28 kNone_PMConversion = 0, |
29 kMulByAlpha_RoundUp_PMConversion, | 29 kMulByAlpha_RoundUp_PMConversion, |
30 kMulByAlpha_RoundDown_PMConversion, | 30 kMulByAlpha_RoundDown_PMConversion, |
31 kDivByAlpha_RoundUp_PMConversion, | 31 kDivByAlpha_RoundUp_PMConversion, |
32 kDivByAlpha_RoundDown_PMConversion, | 32 kDivByAlpha_RoundDown_PMConversion, |
33 kMulByAlpha_RoundUp_HIGHP_PMConversion, | |
34 kMulByAlpha_RoundDown_HIGHP_PMConversion, | |
35 kDivByAlpha_RoundUp_HIGHP_PMConversion, | |
36 kDivByAlpha_RoundDown_HIGHP_PMConversion, | |
37 | 33 |
38 kPMConversionCnt | 34 kPMConversionCnt |
39 }; | 35 }; |
40 | 36 |
41 // Installs an effect in the GrEffectStage to perform a config conversion. | 37 // Installs an effect in the GrEffectStage to perform a config conversion. |
42 static const GrEffectRef* Create(GrTexture*, | 38 static const GrEffectRef* Create(GrTexture*, |
43 bool swapRedAndBlue, | 39 bool swapRedAndBlue, |
44 PMConversion pmConversion, | 40 PMConversion pmConversion, |
45 const SkMatrix& matrix); | 41 const SkMatrix& matrix); |
46 | 42 |
(...skipping 26 matching lines...) Expand all Loading... |
73 | 69 |
74 bool fSwapRedAndBlue; | 70 bool fSwapRedAndBlue; |
75 PMConversion fPMConversion; | 71 PMConversion fPMConversion; |
76 | 72 |
77 GR_DECLARE_EFFECT_TEST; | 73 GR_DECLARE_EFFECT_TEST; |
78 | 74 |
79 typedef GrSingleTextureEffect INHERITED; | 75 typedef GrSingleTextureEffect INHERITED; |
80 }; | 76 }; |
81 | 77 |
82 #endif | 78 #endif |
OLD | NEW |