| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 enum BlendOptFlags { | 514 enum BlendOptFlags { |
| 515 /** | 515 /** |
| 516 * No optimization | 516 * No optimization |
| 517 */ | 517 */ |
| 518 kNone_BlendOpt = 0, | 518 kNone_BlendOpt = 0, |
| 519 /** | 519 /** |
| 520 * Don't draw at all | 520 * Don't draw at all |
| 521 */ | 521 */ |
| 522 kSkipDraw_BlendOptFlag = 0x1, | 522 kSkipDraw_BlendOptFlag = 0x1, |
| 523 /** | 523 /** |
| 524 * Emit the src color, disable HW blending (replace dst with src) | |
| 525 */ | |
| 526 kDisableBlend_BlendOptFlag = 0x2, | |
| 527 /** | |
| 528 * The coverage value does not have to be computed separately from alpha
, the the output | 524 * The coverage value does not have to be computed separately from alpha
, the the output |
| 529 * color can be the modulation of the two. | 525 * color can be the modulation of the two. |
| 530 */ | 526 */ |
| 531 kCoverageAsAlpha_BlendOptFlag = 0x4, | 527 kCoverageAsAlpha_BlendOptFlag = 0x2, |
| 532 /** | 528 /** |
| 533 * Instead of emitting a src color, emit coverage in the alpha channel a
nd r,g,b are | 529 * Instead of emitting a src color, emit coverage in the alpha channel a
nd r,g,b are |
| 534 * "don't cares". | 530 * "don't cares". |
| 535 */ | 531 */ |
| 536 kEmitCoverage_BlendOptFlag = 0x8, | 532 kEmitCoverage_BlendOptFlag = 0x4, |
| 537 /** | 533 /** |
| 538 * Emit transparent black instead of the src color, no need to compute c
overage. | 534 * Emit transparent black instead of the src color, no need to compute c
overage. |
| 539 */ | 535 */ |
| 540 kEmitTransBlack_BlendOptFlag = 0x10, | 536 kEmitTransBlack_BlendOptFlag = 0x8, |
| 541 /** | 537 /** |
| 542 * Flag used to invalidate the cached BlendOptFlags, OptSrcCoeff, and Op
tDstCoeff cached by | 538 * Flag used to invalidate the cached BlendOptFlags, OptSrcCoeff, and Op
tDstCoeff cached by |
| 543 * the get BlendOpts function. | 539 * the get BlendOpts function. |
| 544 */ | 540 */ |
| 545 kInvalid_BlendOptFlag = 0x20, | 541 kInvalid_BlendOptFlag = 0x10, |
| 546 }; | 542 }; |
| 547 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); | 543 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); |
| 548 | 544 |
| 549 void invalidateBlendOptFlags() { | 545 void invalidateBlendOptFlags() { |
| 550 fBlendOptFlags = kInvalid_BlendOptFlag; | 546 fBlendOptFlags = kInvalid_BlendOptFlag; |
| 551 } | 547 } |
| 552 | 548 |
| 553 /** | 549 /** |
| 554 * We don't use suplied vertex color attributes if our blend mode is EmitCov
erage or | 550 * We don't use suplied vertex color attributes if our blend mode is EmitCov
erage or |
| 555 * EmitTransBlack | 551 * EmitTransBlack |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1005 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
| 1010 */ | 1006 */ |
| 1011 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1007 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
| 1012 | 1008 |
| 1013 typedef SkRefCnt INHERITED; | 1009 typedef SkRefCnt INHERITED; |
| 1014 }; | 1010 }; |
| 1015 | 1011 |
| 1016 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1012 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
| 1017 | 1013 |
| 1018 #endif | 1014 #endif |
| OLD | NEW |