Chromium Code Reviews| Index: src/gpu/GrDrawState.cpp |
| diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp |
| index 872d20a1ab48cb0c9ae6b0e93fb066a4a3e9fa7c..50d1fbd4f5af3e9d3dbab1f5e8ae7d6fc37a8e56 100644 |
| --- a/src/gpu/GrDrawState.cpp |
| +++ b/src/gpu/GrDrawState.cpp |
| @@ -423,6 +423,7 @@ bool GrDrawState::hasSolidCoverage() const { |
| GrColor coverage; |
| uint32_t validComponentFlags; |
| + bool isSingleComponent = false; |
| // Initialize to an unknown starting coverage if per-vertex coverage is specified. |
| if (this->hasCoverageVertexAttribute()) { |
| validComponentFlags = 0; |
| @@ -434,11 +435,11 @@ bool GrDrawState::hasSolidCoverage() const { |
| // Run through the coverage stages and see if the coverage will be all ones at the end. |
| if (this->hasGeometryProcessor()) { |
| const GrGeometryProcessor* gp = fGeometryProcessor->getGeometryProcessor(); |
| - gp->getConstantColorComponents(&coverage, &validComponentFlags); |
| + gp->getConstantColorComponents(&coverage, &validComponentFlags, &isSingleComponent); |
| } |
| for (int s = 0; s < this->numCoverageStages(); ++s) { |
| const GrProcessor* processor = this->getCoverageStage(s).getProcessor(); |
| - processor->getConstantColorComponents(&coverage, &validComponentFlags); |
| + processor->getConstantColorComponents(&coverage, &validComponentFlags, &isSingleComponent); |
| } |
| return (kRGBA_GrColorComponentFlags == validComponentFlags) && (0xffffffff == coverage); |
| } |
| @@ -757,6 +758,7 @@ GrDrawState::BlendOptFlags GrDrawState::getBlendOpts(bool forceCoverage, |
| bool GrDrawState::srcAlphaWillBeOne() const { |
| uint32_t validComponentFlags; |
| GrColor color; |
| + bool isSingleComponent = false; |
| // Check if per-vertex or constant color may have partial alpha |
| if (this->hasColorVertexAttribute()) { |
| if (fHints & kVertexColorsAreOpaque_Hint) { |
| @@ -774,7 +776,7 @@ bool GrDrawState::srcAlphaWillBeOne() const { |
| // Run through the color stages |
| for (int s = 0; s < this->numColorStages(); ++s) { |
| const GrProcessor* processor = this->getColorStage(s).getProcessor(); |
| - processor->getConstantColorComponents(&color, &validComponentFlags); |
| + processor->getConstantColorComponents(&color, &validComponentFlags, &isSingleComponent); |
| } |
| // Check whether coverage is treated as color. If so we run through the coverage computation. |
| @@ -794,7 +796,7 @@ bool GrDrawState::srcAlphaWillBeOne() const { |
| // Run through the coverage stages |
| for (int s = 0; s < this->numCoverageStages(); ++s) { |
| const GrProcessor* processor = this->getCoverageStage(s).getProcessor(); |
| - processor->getConstantColorComponents(&coverage, &coverageComponentFlags); |
| + processor->getConstantColorComponents(&coverage, &coverageComponentFlags, &isSingleComponent); |
|
joshua.litt
2014/09/29 15:22:08
Newline
egdaniel
2014/09/29 15:50:20
Done.
|
| } |
| // Since the shader will multiply coverage and color, the only way the final A==1 is if |