OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 kHSLSaturation_GrBlendEquation, | 44 kHSLSaturation_GrBlendEquation, |
45 kHSLColor_GrBlendEquation, | 45 kHSLColor_GrBlendEquation, |
46 kHSLLuminosity_GrBlendEquation, | 46 kHSLLuminosity_GrBlendEquation, |
47 | 47 |
48 kFirstAdvancedGrBlendEquation = kScreen_GrBlendEquation, | 48 kFirstAdvancedGrBlendEquation = kScreen_GrBlendEquation, |
49 kLast_GrBlendEquation = kHSLLuminosity_GrBlendEquation | 49 kLast_GrBlendEquation = kHSLLuminosity_GrBlendEquation |
50 }; | 50 }; |
51 | 51 |
52 static const int kGrBlendEquationCnt = kLast_GrBlendEquation + 1; | 52 static const int kGrBlendEquationCnt = kLast_GrBlendEquation + 1; |
53 | 53 |
54 inline bool GrBlendEquationIsAdvanced(GrBlendEquation equation) { | |
55 return equation >= kFirstAdvancedGrBlendEquation; | |
56 } | |
57 | |
58 /** | 54 /** |
59 * Coeffecients for alpha-blending. | 55 * Coeffecients for alpha-blending. |
60 */ | 56 */ |
61 enum GrBlendCoeff { | 57 enum GrBlendCoeff { |
62 kZero_GrBlendCoeff, //<! 0 | 58 kZero_GrBlendCoeff, //<! 0 |
63 kOne_GrBlendCoeff, //<! 1 | 59 kOne_GrBlendCoeff, //<! 1 |
64 kSC_GrBlendCoeff, //<! src color | 60 kSC_GrBlendCoeff, //<! src color |
65 kISC_GrBlendCoeff, //<! one minus src color | 61 kISC_GrBlendCoeff, //<! one minus src color |
66 kDC_GrBlendCoeff, //<! dst color | 62 kDC_GrBlendCoeff, //<! dst color |
67 kIDC_GrBlendCoeff, //<! one minus dst color | 63 kIDC_GrBlendCoeff, //<! one minus dst color |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 kIgnoreColor_OptFlag = 0x2, | 173 kIgnoreColor_OptFlag = 0x2, |
178 /** | 174 /** |
179 * GrXferProcessor will ignore coverage, thus no need to provide | 175 * GrXferProcessor will ignore coverage, thus no need to provide |
180 */ | 176 */ |
181 kIgnoreCoverage_OptFlag = 0x4, | 177 kIgnoreCoverage_OptFlag = 0x4, |
182 /** | 178 /** |
183 * Clear color stages and override input color to that returned by getOp
timizations | 179 * Clear color stages and override input color to that returned by getOp
timizations |
184 */ | 180 */ |
185 kOverrideColor_OptFlag = 0x8, | 181 kOverrideColor_OptFlag = 0x8, |
186 /** | 182 /** |
187 * Set CoverageDrawing_StateBit | |
188 */ | |
189 kSetCoverageDrawing_OptFlag = 0x10, | |
190 /** | |
191 * Can tweak alpha for coverage. Currently this flag should only be used
by a batch | 183 * Can tweak alpha for coverage. Currently this flag should only be used
by a batch |
192 */ | 184 */ |
193 kCanTweakAlphaForCoverage_OptFlag = 0x20, | 185 kCanTweakAlphaForCoverage_OptFlag = 0x20, |
194 }; | 186 }; |
195 | 187 |
196 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); | 188 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); |
197 | 189 |
198 /** | 190 /** |
199 * Determines which optimizations (as described by the ptFlags above) can be
performed by | 191 * Determines which optimizations (as described by the ptFlags above) can be
performed by |
200 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change | 192 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 enum { | 434 enum { |
443 kIllegalXPFClassID = 0, | 435 kIllegalXPFClassID = 0, |
444 }; | 436 }; |
445 static int32_t gCurrXPFClassID; | 437 static int32_t gCurrXPFClassID; |
446 | 438 |
447 typedef GrProgramElement INHERITED; | 439 typedef GrProgramElement INHERITED; |
448 }; | 440 }; |
449 | 441 |
450 #endif | 442 #endif |
451 | 443 |
OLD | NEW |