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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 kIgnoreColor_OptFlag = 0x2, | 132 kIgnoreColor_OptFlag = 0x2, |
137 /** | 133 /** |
138 * GrXferProcessor will ignore coverage, thus no need to provide | 134 * GrXferProcessor will ignore coverage, thus no need to provide |
139 */ | 135 */ |
140 kIgnoreCoverage_OptFlag = 0x4, | 136 kIgnoreCoverage_OptFlag = 0x4, |
141 /** | 137 /** |
142 * Clear color stages and override input color to that returned by getOp
timizations | 138 * Clear color stages and override input color to that returned by getOp
timizations |
143 */ | 139 */ |
144 kOverrideColor_OptFlag = 0x8, | 140 kOverrideColor_OptFlag = 0x8, |
145 /** | 141 /** |
146 * Set CoverageDrawing_StateBit | |
147 */ | |
148 kSetCoverageDrawing_OptFlag = 0x10, | |
149 /** | |
150 * Can tweak alpha for coverage. Currently this flag should only be used
by a batch | 142 * Can tweak alpha for coverage. Currently this flag should only be used
by a batch |
151 */ | 143 */ |
152 kCanTweakAlphaForCoverage_OptFlag = 0x20, | 144 kCanTweakAlphaForCoverage_OptFlag = 0x20, |
153 }; | 145 }; |
154 | 146 |
155 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); | 147 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); |
156 | 148 |
157 /** | 149 /** |
158 * Determines which optimizations (as described by the ptFlags above) can be
performed by | 150 * Determines which optimizations (as described by the ptFlags above) can be
performed by |
159 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change | 151 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 enum { | 392 enum { |
401 kIllegalXPFClassID = 0, | 393 kIllegalXPFClassID = 0, |
402 }; | 394 }; |
403 static int32_t gCurrXPFClassID; | 395 static int32_t gCurrXPFClassID; |
404 | 396 |
405 typedef GrProgramElement INHERITED; | 397 typedef GrProgramElement INHERITED; |
406 }; | 398 }; |
407 | 399 |
408 #endif | 400 #endif |
409 | 401 |
OLD | NEW |