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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 /** | 612 /** |
613 * Usually coverage is applied after color blending. The color is blende
d using the coeffs | 613 * Usually coverage is applied after color blending. The color is blende
d using the coeffs |
614 * specified by setBlendFunc(). The blended color is then combined with
dst using coeffs | 614 * specified by setBlendFunc(). The blended color is then combined with
dst using coeffs |
615 * of src_coverage, 1-src_coverage. Sometimes we are explicitly drawing
a coverage mask. In | 615 * of src_coverage, 1-src_coverage. Sometimes we are explicitly drawing
a coverage mask. In |
616 * this case there is no distinction between coverage and color and the
caller needs direct | 616 * this case there is no distinction between coverage and color and the
caller needs direct |
617 * control over the blend coeffs. When set, there will be a single blend
step controlled by | 617 * control over the blend coeffs. When set, there will be a single blend
step controlled by |
618 * setBlendFunc() which will use coverage*color as the src color. | 618 * setBlendFunc() which will use coverage*color as the src color. |
619 */ | 619 */ |
620 kCoverageDrawing_StateBit = 0x10, | 620 kCoverageDrawing_StateBit = 0x10, |
621 | 621 kLast_StateBit = kCoverageDrawing_StateBit, |
622 // Users of the class may add additional bits to the vector | |
623 kDummyStateBit, | |
624 kLastPublicStateBit = kDummyStateBit-1, | |
625 }; | 622 }; |
626 | 623 |
627 uint32_t getFlagBits() const { return fFlagBits; } | 624 uint32_t getFlagBits() const { return fFlagBits; } |
628 | 625 |
629 bool isStateFlagEnabled(uint32_t stateBit) const { return 0 != (stateBit & f
FlagBits); } | 626 bool isStateFlagEnabled(uint32_t stateBit) const { return 0 != (stateBit & f
FlagBits); } |
630 | 627 |
631 bool isClipState() const { return 0 != (fFlagBits & kClip_StateBit); } | 628 bool isClipState() const { return 0 != (fFlagBits & kClip_StateBit); } |
632 bool isColorWriteDisabled() const { return 0 != (fFlagBits & kNoColorWrites_
StateBit); } | 629 bool isColorWriteDisabled() const { return 0 != (fFlagBits & kNoColorWrites_
StateBit); } |
633 bool isCoverageDrawing() const { return 0 != (fFlagBits & kCoverageDrawing_S
tateBit); } | 630 bool isCoverageDrawing() const { return 0 != (fFlagBits & kCoverageDrawing_S
tateBit); } |
634 | 631 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 mutable uint32_t fCachedCapsID; | 853 mutable uint32_t fCachedCapsID; |
857 | 854 |
858 friend class GrOptDrawState; | 855 friend class GrOptDrawState; |
859 | 856 |
860 typedef SkRefCnt INHERITED; | 857 typedef SkRefCnt INHERITED; |
861 }; | 858 }; |
862 | 859 |
863 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 860 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
864 | 861 |
865 #endif | 862 #endif |
OLD | NEW |