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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j
ust buffer for | 796 * Subclasses of GrDrawTarget that actually draw (as opposed to those that j
ust buffer for |
797 * playback) must call this function and respect the flags that replace the
output color. | 797 * playback) must call this function and respect the flags that replace the
output color. |
798 * | 798 * |
799 * If the cached BlendOptFlags does not have the invalidate bit set, then ge
tBlendOpts will | 799 * If the cached BlendOptFlags does not have the invalidate bit set, then ge
tBlendOpts will |
800 * simply returned the cached flags and coefficients. Otherwise it will calc
ulate the values. | 800 * simply returned the cached flags and coefficients. Otherwise it will calc
ulate the values. |
801 */ | 801 */ |
802 BlendOptFlags getBlendOpts(bool forceCoverage = false, | 802 BlendOptFlags getBlendOpts(bool forceCoverage = false, |
803 GrBlendCoeff* srcCoeff = NULL, | 803 GrBlendCoeff* srcCoeff = NULL, |
804 GrBlendCoeff* dstCoeff = NULL) const; | 804 GrBlendCoeff* dstCoeff = NULL) const; |
805 | 805 |
| 806 const GrProcOptInfo& colorProcInfo() const { |
| 807 this->calcColorInvariantOutput(); |
| 808 return fColorProcInfo; |
| 809 } |
| 810 |
| 811 const GrProcOptInfo& coverageProcInfo() const { |
| 812 this->calcCoverageInvariantOutput(); |
| 813 return fCoverageProcInfo; |
| 814 } |
| 815 |
806 /** | 816 /** |
807 * Determines whether src alpha is guaranteed to be one for all src pixels | 817 * Determines whether src alpha is guaranteed to be one for all src pixels |
808 */ | 818 */ |
809 bool srcAlphaWillBeOne() const; | 819 bool srcAlphaWillBeOne() const; |
810 | 820 |
811 /** | 821 /** |
812 * If fColorProcInfoValid is false, function calculates the invariant output
for the color | 822 * If fColorProcInfoValid is false, function calculates the invariant output
for the color |
813 * stages and results are stored in fColorProcInfo. | 823 * stages and results are stored in fColorProcInfo. |
814 */ | 824 */ |
815 void calcColorInvariantOutput() const; | 825 void calcColorInvariantOutput() const; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 mutable bool fCoverageProcInfoValid; | 872 mutable bool fCoverageProcInfoValid; |
863 | 873 |
864 friend class GrOptDrawState; | 874 friend class GrOptDrawState; |
865 | 875 |
866 typedef SkRefCnt INHERITED; | 876 typedef SkRefCnt INHERITED; |
867 }; | 877 }; |
868 | 878 |
869 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 879 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
870 | 880 |
871 #endif | 881 #endif |
OLD | NEW |