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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds, | 151 void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds, |
152 GrXferProcessor::OptFlags fl
ags, | 152 GrXferProcessor::OptFlags fl
ags, |
153 const GrProcOptInfo& colorPO
I, | 153 const GrProcOptInfo& colorPO
I, |
154 const GrProcOptInfo& coverag
ePOI, | 154 const GrProcOptInfo& coverag
ePOI, |
155 int* firstColorStageIdx, | 155 int* firstColorStageIdx, |
156 int* firstCoverageStageIdx)
{ | 156 int* firstCoverageStageIdx)
{ |
157 fDescInfo.fReadsDst = false; | 157 fDescInfo.fReadsDst = false; |
158 fDescInfo.fReadsFragPosition = false; | 158 fDescInfo.fReadsFragPosition = false; |
159 | 159 |
160 if (flags & GrXferProcessor::kClearColorStages_OptFlag) { | 160 if (flags & GrXferProcessor::kClearColorStages_OptFlag || |
| 161 flags & GrXferProcessor::kOverrideColor_OptFlag) { |
161 fDescInfo.fInputColorIsUsed = true; | 162 fDescInfo.fInputColorIsUsed = true; |
162 *firstColorStageIdx = ds.numColorStages(); | 163 *firstColorStageIdx = ds.numColorStages(); |
163 fDescInfo.fHasVertexColor = false; | 164 fDescInfo.fHasVertexColor = false; |
164 } else { | 165 } else { |
165 fDescInfo.fReadsDst = colorPOI.readsDst(); | 166 fDescInfo.fReadsDst = colorPOI.readsDst(); |
166 fDescInfo.fReadsFragPosition = colorPOI.readsFragPosition(); | 167 fDescInfo.fReadsFragPosition = colorPOI.readsFragPosition(); |
167 } | 168 } |
168 | 169 |
169 if (flags & GrXferProcessor::kClearCoverageStages_OptFlag) { | 170 if (flags & GrXferProcessor::kClearCoverageStages_OptFlag) { |
170 fDescInfo.fInputCoverageIsUsed = true; | 171 fDescInfo.fInputCoverageIsUsed = true; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); | 232 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
232 for (int i = 0; i < this->numFragmentStages(); i++) { | 233 for (int i = 0; i < this->numFragmentStages(); i++) { |
233 | 234 |
234 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 235 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
235 return false; | 236 return false; |
236 } | 237 } |
237 } | 238 } |
238 return true; | 239 return true; |
239 } | 240 } |
240 | 241 |
OLD | NEW |