Index: src/gpu/GrOptDrawState.cpp |
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp |
index 4a6cd142eb08ee49756564eb294f5bb7f9af64bb..b60a4cef8a3e3258288c6ab240921390d3a6ee6b 100644 |
--- a/src/gpu/GrOptDrawState.cpp |
+++ b/src/gpu/GrOptDrawState.cpp |
@@ -69,12 +69,12 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, |
} |
// Copy Coverage Stages from DS to ODS |
- if (drawState.numCoverageStages() > 0 && separateCoverageFromColor) { |
+ if (firstCoverageStageIdx < drawState.numCoverageStages() && separateCoverageFromColor) { |
fCoverageStages.reset(&drawState.getCoverageStage(firstCoverageStageIdx), |
drawState.numCoverageStages() - firstCoverageStageIdx); |
} else { |
fCoverageStages.reset(); |
- if (drawState.numCoverageStages() > 0) { |
+ if (firstCoverageStageIdx < drawState.numCoverageStages()) { |
// TODO: Once we have flag to know if we only multiply on stages, only push coverage |
// into color stages if everything is multiply |
fColorStages.push_back_n(drawState.numCoverageStages() - firstCoverageStageIdx, |