OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrOptDrawState.h" | 8 #include "GrOptDrawState.h" |
9 | 9 |
10 #include "GrDrawState.h" | 10 #include "GrDrawState.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { | 148 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { |
149 *firstCoverageStageIdx = ds.numCoverageStages(); | 149 *firstCoverageStageIdx = ds.numCoverageStages(); |
150 } else { | 150 } else { |
151 if (coveragePOI.readsDst()) { | 151 if (coveragePOI.readsDst()) { |
152 fDescInfo.fReadsDst = true; | 152 fDescInfo.fReadsDst = true; |
153 } | 153 } |
154 if (coveragePOI.readsFragPosition()) { | 154 if (coveragePOI.readsFragPosition()) { |
155 fDescInfo.fReadsFragPosition = true; | 155 fDescInfo.fReadsFragPosition = true; |
156 } | 156 } |
157 } | 157 } |
| 158 |
| 159 if (fXferProcessor->willReadDstColor()) { |
| 160 fDescInfo.fReadsDst = true; |
| 161 } |
158 } | 162 } |
159 | 163 |
160 void GrOptDrawState::finalize(GrGpu* gpu) { | 164 void GrOptDrawState::finalize(GrGpu* gpu) { |
161 gpu->buildProgramDesc(*this, fDescInfo, fDrawType, &fDesc); | 165 gpu->buildProgramDesc(*this, fDescInfo, fDrawType, &fDesc); |
162 fFinalized = true; | 166 fFinalized = true; |
163 } | 167 } |
164 | 168 |
165 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
166 | 170 |
167 bool GrOptDrawState::combineIfPossible(const GrOptDrawState& that) { | 171 bool GrOptDrawState::combineIfPossible(const GrOptDrawState& that) { |
(...skipping 30 matching lines...) Expand all Loading... |
198 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 202 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
199 return false; | 203 return false; |
200 } | 204 } |
201 } | 205 } |
202 | 206 |
203 // Now update the GrPrimitiveProcessor's batch tracker | 207 // Now update the GrPrimitiveProcessor's batch tracker |
204 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); | 208 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); |
205 return true; | 209 return true; |
206 } | 210 } |
207 | 211 |
OLD | NEW |