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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 kSkipDraw_OptFlag = 0x1, | 59 kSkipDraw_OptFlag = 0x1, |
60 /** | 60 /** |
61 * Clear color stages, remove color vertex attribs, and use input color | 61 * Clear color stages, remove color vertex attribs, and use input color |
62 */ | 62 */ |
63 kClearColorStages_OptFlag = 0x2, | 63 kClearColorStages_OptFlag = 0x2, |
64 /** | 64 /** |
65 * Clear coverage stages, remove coverage vertex attribs, and use input
coverage | 65 * Clear coverage stages, remove coverage vertex attribs, and use input
coverage |
66 */ | 66 */ |
67 kClearCoverageStages_OptFlag = 0x4, | 67 kClearCoverageStages_OptFlag = 0x4, |
68 /** | 68 /** |
| 69 * Clear color stages and override input color to that returned by getOp
timizations |
| 70 */ |
| 71 kOverrideColor_OptFlag = 0x8, |
| 72 /** |
69 * Set CoverageDrawing_StateBit | 73 * Set CoverageDrawing_StateBit |
70 */ | 74 */ |
71 kSetCoverageDrawing_OptFlag = 0x8, | 75 kSetCoverageDrawing_OptFlag = 0x10, |
72 }; | 76 }; |
73 | 77 |
74 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); | 78 GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); |
75 | 79 |
76 /** | 80 /** |
77 * Determines which optimizations (as described by the ptFlags above) can be
performed by | 81 * Determines which optimizations (as described by the ptFlags above) can be
performed by |
78 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change | 82 * the draw with this xfer processor. If this function is called, the xfer p
rocessor may change |
79 * its state to reflected the given blend optimizations. It will also set th
e output parameters, | 83 * its state to reflected the given blend optimizations. If the XP needs to
see a specific input |
80 * color and coverage, to specific values if it decides to remove all color
or coverage stages. | 84 * color to blend correctly, it will set the OverrideColor flag and the outp
ut parameter |
| 85 * overrideColor will be the required value that should be passed into the X
P. |
81 * A caller who calls this function on a XP is required to honor the returne
d OptFlags | 86 * A caller who calls this function on a XP is required to honor the returne
d OptFlags |
82 * and color/coverage values for its draw. | 87 * and color values for its draw. |
83 */ | 88 */ |
84 // TODO: remove need for isCoverageDrawing once coverageDrawing is its own X
P. | 89 // TODO: remove need for isCoverageDrawing once coverageDrawing is its own X
P. |
85 // TODO: remove need for colorWriteDisabled once colorWriteDisabled is its o
wn XP. | 90 // TODO: remove need for colorWriteDisabled once colorWriteDisabled is its o
wn XP. |
86 virtual OptFlags getOptimizations(const GrProcOptInfo& colorPOI, | 91 virtual OptFlags getOptimizations(const GrProcOptInfo& colorPOI, |
87 const GrProcOptInfo& coveragePOI, | 92 const GrProcOptInfo& coveragePOI, |
88 bool isCoverageDrawing, | 93 bool isCoverageDrawing, |
89 bool colorWriteDisabled, | 94 bool colorWriteDisabled, |
90 bool doesStencilWrite, | 95 bool doesStencilWrite, |
91 GrColor* color, | 96 GrColor* overrideColor, |
92 uint8_t* coverage, | 97 uint8_t* overrideCoverage, |
93 const GrDrawTargetCaps& caps) = 0; | 98 const GrDrawTargetCaps& caps) = 0; |
94 | 99 |
95 struct BlendInfo { | 100 struct BlendInfo { |
96 GrBlendCoeff fSrcBlend; | 101 GrBlendCoeff fSrcBlend; |
97 GrBlendCoeff fDstBlend; | 102 GrBlendCoeff fDstBlend; |
98 GrColor fBlendConstant; | 103 GrColor fBlendConstant; |
99 }; | 104 }; |
100 | 105 |
101 virtual void getBlendInfo(BlendInfo* blendInfo) const = 0; | 106 virtual void getBlendInfo(BlendInfo* blendInfo) const = 0; |
102 | 107 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 enum { | 253 enum { |
249 kIllegalXPFClassID = 0, | 254 kIllegalXPFClassID = 0, |
250 }; | 255 }; |
251 static int32_t gCurrXPFClassID; | 256 static int32_t gCurrXPFClassID; |
252 | 257 |
253 typedef GrProgramElement INHERITED; | 258 typedef GrProgramElement INHERITED; |
254 }; | 259 }; |
255 | 260 |
256 #endif | 261 #endif |
257 | 262 |
OLD | NEW |