| 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 uint8_t getCoverage() const { | 314 /** |
| 315 return GrColorUnpackR(fCommon.fCoverage); | 315 * Version of above that specifies 4 channel per-vertex color. The value |
| 316 * should be premultiplied. |
| 317 */ |
| 318 void setCoverage4(GrColor coverage) { |
| 319 fCommon.fCoverage = coverage; |
| 316 } | 320 } |
| 317 | 321 |
| 318 GrColor getCoverageColor() const { | 322 GrColor getCoverage() const { |
| 319 return fCommon.fCoverage; | 323 return fCommon.fCoverage; |
| 320 } | 324 } |
| 321 | 325 |
| 322 /// @} | 326 /// @} |
| 323 | 327 |
| 324 /////////////////////////////////////////////////////////////////////////// | 328 /////////////////////////////////////////////////////////////////////////// |
| 325 /// @name Effect Stages | 329 /// @name Effect Stages |
| 326 /// Each stage hosts a GrEffect. The effect produces an output color or cove
rage in the fragment | 330 /// Each stage hosts a GrEffect. The effect produces an output color or cove
rage in the fragment |
| 327 /// shader. Its inputs are the output from the previous stage as well as som
e variables | 331 /// shader. Its inputs are the output from the previous stage as well as som
e variables |
| 328 /// available to it in the fragment and vertex shader (e.g. the vertex posit
ion, the dst color, | 332 /// 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... |
| 1053 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1057 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
| 1054 */ | 1058 */ |
| 1055 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1059 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
| 1056 | 1060 |
| 1057 typedef SkRefCnt INHERITED; | 1061 typedef SkRefCnt INHERITED; |
| 1058 }; | 1062 }; |
| 1059 | 1063 |
| 1060 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1064 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
| 1061 | 1065 |
| 1062 #endif | 1066 #endif |
| OLD | NEW |