| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 */ | 544 */ |
| 545 kInvalid_BlendOptFlag = 0x20, | 545 kInvalid_BlendOptFlag = 0x20, |
| 546 }; | 546 }; |
| 547 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); | 547 GR_DECL_BITFIELD_OPS_FRIENDS(BlendOptFlags); |
| 548 | 548 |
| 549 void invalidateBlendOptFlags() { | 549 void invalidateBlendOptFlags() { |
| 550 fBlendOptFlags = kInvalid_BlendOptFlag; | 550 fBlendOptFlags = kInvalid_BlendOptFlag; |
| 551 } | 551 } |
| 552 | 552 |
| 553 /** | 553 /** |
| 554 * We don't use suplied vertex color attributes if our blend mode is EmitCov
erage or |
| 555 * EmitTransBlack |
| 556 */ |
| 557 bool canIgnoreColorAttribute() const; |
| 558 |
| 559 /** |
| 554 * Determines what optimizations can be applied based on the blend. The coef
ficients may have | 560 * Determines what optimizations can be applied based on the blend. The coef
ficients may have |
| 555 * to be tweaked in order for the optimization to work. srcCoeff and dstCoef
f are optional | 561 * to be tweaked in order for the optimization to work. srcCoeff and dstCoef
f are optional |
| 556 * params that receive the tweaked coefficients. Normally the function looks
at the current | 562 * params that receive the tweaked coefficients. Normally the function looks
at the current |
| 557 * state to see if coverage is enabled. By setting forceCoverage the caller
can speculatively | 563 * state to see if coverage is enabled. By setting forceCoverage the caller
can speculatively |
| 558 * determine the blend optimizations that would be used if there was partial
pixel coverage. | 564 * determine the blend optimizations that would be used if there was partial
pixel coverage. |
| 559 * | 565 * |
| 560 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j
ust buffer for | 566 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j
ust buffer for |
| 561 * playback) must call this function and respect the flags that replace the
output color. | 567 * playback) must call this function and respect the flags that replace the
output color. |
| 562 * | 568 * |
| 563 * If the cached BlendOptFlags does not have the invalidate bit set, then ge
tBlendOpts will | 569 * If the cached BlendOptFlags does not have the invalidate bit set, then ge
tBlendOpts will |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1009 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
| 1004 */ | 1010 */ |
| 1005 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1011 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
| 1006 | 1012 |
| 1007 typedef SkRefCnt INHERITED; | 1013 typedef SkRefCnt INHERITED; |
| 1008 }; | 1014 }; |
| 1009 | 1015 |
| 1010 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1016 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
| 1011 | 1017 |
| 1012 #endif | 1018 #endif |
| OLD | NEW |