OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "GrDrawState.h" | 8 #include "GrDrawState.h" |
9 | 9 |
10 #include "GrOptDrawState.h" | 10 #include "GrOptDrawState.h" |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 } | 735 } |
736 | 736 |
737 // Since the shader will multiply coverage and color, the only way the f inal A==1 is if | 737 // Since the shader will multiply coverage and color, the only way the f inal A==1 is if |
738 // coverage and color both have A==1. | 738 // coverage and color both have A==1. |
739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); | 739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); |
740 } | 740 } |
741 | 741 |
742 return inoutColor.isOpaque(); | 742 return inoutColor.isOpaque(); |
743 } | 743 } |
744 | 744 |
745 bool GrDrawState::isUnblended() const { | |
746 if (!this->hasSolidCoverage()) { | |
747 return false; | |
748 } | |
749 | |
750 bool srcAIsOne = this->srcAlphaWillBeOne(); | |
751 GrBlendCoeff srcCoeff = this->getSrcBlendCoeff(); | |
752 GrBlendCoeff dstCoeff = this->getDstBlendCoeff(); | |
753 bool dstCoeffIsZero = kZero_GrBlendCoeff == dstCoeff || | |
bsalomon
2014/11/11 20:49:56
The fact that the blend opts code doesn't directly
egdaniel
2014/11/11 21:05:55
Done.
| |
754 (kISA_GrBlendCoeff == dstCoeff && srcAIsOne); | |
755 if (kOne_GrBlendCoeff != srcCoeff || !dstCoeffIsZero || this->willEffectRead DstColor()) { | |
756 return false; | |
757 } | |
758 | |
759 return true; | |
760 } | |
761 | |
OLD | NEW |