OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 /** | 305 /** |
306 * Sets a constant fractional coverage to be applied to the draw. The | 306 * Sets a constant fractional coverage to be applied to the draw. The |
307 * initial value (after construction or reset()) is 0xff. The constant | 307 * initial value (after construction or reset()) is 0xff. The constant |
308 * coverage is ignored when per-vertex coverage is provided. | 308 * coverage is ignored when per-vertex coverage is provided. |
309 */ | 309 */ |
310 void setCoverage(uint8_t coverage) { | 310 void setCoverage(uint8_t coverage) { |
311 fCommon.fCoverage = GrColorPackRGBA(coverage, coverage, coverage, covera
ge); | 311 fCommon.fCoverage = GrColorPackRGBA(coverage, coverage, coverage, covera
ge); |
312 } | 312 } |
313 | 313 |
314 /** | 314 uint8_t getCoverage() const { |
315 * Version of above that specifies 4 channel per-vertex color. The value | 315 return GrColorUnpackR(fCommon.fCoverage); |
316 * should be premultiplied. | |
317 */ | |
318 void setCoverage4(GrColor coverage) { | |
319 fCommon.fCoverage = coverage; | |
320 } | 316 } |
321 | 317 |
322 GrColor getCoverage() const { | 318 GrColor getCoverageColor() const { |
323 return fCommon.fCoverage; | 319 return fCommon.fCoverage; |
324 } | 320 } |
325 | 321 |
326 /// @} | 322 /// @} |
327 | 323 |
328 /////////////////////////////////////////////////////////////////////////// | 324 /////////////////////////////////////////////////////////////////////////// |
329 /// @name Effect Stages | 325 /// @name Effect Stages |
330 /// Each stage hosts a GrEffect. The effect produces an output color or cove
rage in the fragment | 326 /// Each stage hosts a GrEffect. The effect produces an output color or cove
rage in the fragment |
331 /// shader. Its inputs are the output from the previous stage as well as som
e variables | 327 /// shader. Its inputs are the output from the previous stage as well as som
e variables |
332 /// available to it in the fragment and vertex shader (e.g. the vertex posit
ion, the dst color, | 328 /// available to it in the fragment and vertex shader (e.g. the vertex posit
ion, the dst color, |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1053 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
1058 */ | 1054 */ |
1059 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1055 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1060 | 1056 |
1061 typedef SkRefCnt INHERITED; | 1057 typedef SkRefCnt INHERITED; |
1062 }; | 1058 }; |
1063 | 1059 |
1064 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1060 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1065 | 1061 |
1066 #endif | 1062 #endif |
OLD | NEW |