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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 GrProcessor::InvariantOutput inoutCoverage; | 740 GrProcessor::InvariantOutput inoutCoverage; |
741 inoutCoverage.fIsSingleComponent = false; | 741 inoutCoverage.fIsSingleComponent = false; |
742 if (this->hasCoverageVertexAttribute()) { | 742 if (this->hasCoverageVertexAttribute()) { |
743 inoutCoverage.fValidFlags = 0; | 743 inoutCoverage.fValidFlags = 0; |
744 inoutCoverage.fColor = 0; // suppresses any warnings. | 744 inoutCoverage.fColor = 0; // suppresses any warnings. |
745 } else { | 745 } else { |
746 inoutCoverage.fValidFlags = kRGBA_GrColorComponentFlags; | 746 inoutCoverage.fValidFlags = kRGBA_GrColorComponentFlags; |
747 inoutCoverage.fColor = this->getCoverageColor(); | 747 inoutCoverage.fColor = this->getCoverageColor(); |
748 } | 748 } |
749 | 749 |
| 750 if (this->hasGeometryProcessor()) { |
| 751 fGeometryProcessor->computeInvariantOutput(&inoutCoverage); |
| 752 } |
| 753 |
750 // Run through the coverage stages | 754 // Run through the coverage stages |
751 for (int s = 0; s < this->numCoverageStages(); ++s) { | 755 for (int s = 0; s < this->numCoverageStages(); ++s) { |
752 const GrProcessor* processor = this->getCoverageStage(s).getProcesso
r(); | 756 const GrProcessor* processor = this->getCoverageStage(s).getProcesso
r(); |
753 processor->computeInvariantOutput(&inoutCoverage); | 757 processor->computeInvariantOutput(&inoutCoverage); |
754 } | 758 } |
755 | 759 |
756 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if | 760 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if |
757 // coverage and color both have A==1. | 761 // coverage and color both have A==1. |
758 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); | 762 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); |
759 } | 763 } |
760 | 764 |
761 return inoutColor.isOpaque(); | 765 return inoutColor.isOpaque(); |
762 } | 766 } |
763 | 767 |
OLD | NEW |