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 17 matching lines...) Expand all Loading... |
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 | 33 |
34 kPMConversionCnt | 34 kPMConversionCnt |
35 }; | 35 }; |
36 | 36 |
37 // Installs an effect in the GrEffectStage to perform a config conversion. | 37 // Installs an effect in the GrEffectStage to perform a config conversion. |
38 static const GrEffectRef* Create(GrTexture*, | 38 static const GrEffect* Create(GrTexture*, |
39 bool swapRedAndBlue, | 39 bool swapRedAndBlue, |
40 PMConversion pmConversion, | 40 PMConversion pmConversion, |
41 const SkMatrix& matrix); | 41 const SkMatrix& matrix); |
42 | 42 |
43 static const char* Name() { return "Config Conversion"; } | 43 static const char* Name() { return "Config Conversion"; } |
44 typedef GrGLConfigConversionEffect GLEffect; | 44 typedef GrGLConfigConversionEffect GLEffect; |
45 | 45 |
46 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; | 46 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
47 | 47 |
48 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const SK_OVERRIDE; | 48 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const SK_OVERRIDE; |
49 | 49 |
50 bool swapsRedAndBlue() const { return fSwapRedAndBlue; } | 50 bool swapsRedAndBlue() const { return fSwapRedAndBlue; } |
51 PMConversion pmConversion() const { return fPMConversion; } | 51 PMConversion pmConversion() const { return fPMConversion; } |
(...skipping 17 matching lines...) Expand all Loading... |
69 | 69 |
70 bool fSwapRedAndBlue; | 70 bool fSwapRedAndBlue; |
71 PMConversion fPMConversion; | 71 PMConversion fPMConversion; |
72 | 72 |
73 GR_DECLARE_EFFECT_TEST; | 73 GR_DECLARE_EFFECT_TEST; |
74 | 74 |
75 typedef GrSingleTextureEffect INHERITED; | 75 typedef GrSingleTextureEffect INHERITED; |
76 }; | 76 }; |
77 | 77 |
78 #endif | 78 #endif |
OLD | NEW |