Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrPipeline.h" | 8 #include "GrPipeline.h" |
| 9 | 9 |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin eBuilder, | 180 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin eBuilder, |
| 181 GrXferProcessor::OptFlags flags, | 181 GrXferProcessor::OptFlags flags, |
| 182 const GrProcOptInfo& colorPOI, | 182 const GrProcOptInfo& colorPOI, |
| 183 const GrProcOptInfo& coveragePOI , | 183 const GrProcOptInfo& coveragePOI , |
| 184 int* firstColorProcessorIdx, | 184 int* firstColorProcessorIdx, |
| 185 int* firstCoverageProcessorIdx) { | 185 int* firstCoverageProcessorIdx) { |
| 186 fIgnoresCoverage = SkToBool(flags & GrXferProcessor::kIgnoreCoverage_OptFlag ); | 186 fIgnoresCoverage = SkToBool(flags & GrXferProcessor::kIgnoreCoverage_OptFlag ); |
| 187 fReadsFragPosition = this->getXferProcessor().willReadFragmentPosition(); | 187 fBuiltInState = GrProcessor::kNone_BuiltInState; |
|
Chris Dalton
2016/02/25 20:38:37
We a problem here that fBuiltInState *should* inti
joshualitt
2016/02/25 20:50:27
That should be okay. We never remove the primitiv
Chris Dalton
2016/02/25 20:57:46
But the primitive processor might not exist yet, r
joshualitt
2016/02/25 21:00:50
right, but that should be okay because when we go
Chris Dalton
2016/02/25 22:24:24
I removed info about the fragment position from th
| |
| 188 | 188 |
| 189 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || | 189 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || |
| 190 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { | 190 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { |
| 191 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); | 191 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); |
| 192 } else { | 192 } else { |
| 193 if (colorPOI.readsFragPosition()) { | 193 fBuiltInState |= colorPOI.builtInState(); |
| 194 fReadsFragPosition = true; | |
| 195 } | |
| 196 } | 194 } |
| 197 | 195 |
| 198 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { | 196 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { |
| 199 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso rs(); | 197 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso rs(); |
| 200 } else { | 198 } else { |
| 201 if (coveragePOI.readsFragPosition()) { | 199 fBuiltInState |= coveragePOI.builtInState(); |
| 202 fReadsFragPosition = true; | |
| 203 } | |
| 204 } | 200 } |
| 205 } | 201 } |
| 206 | 202 |
| 207 //////////////////////////////////////////////////////////////////////////////// | 203 //////////////////////////////////////////////////////////////////////////////// |
| 208 | 204 |
| 209 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, | 205 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, |
| 210 bool ignoreCoordTransforms) { | 206 bool ignoreCoordTransforms) { |
| 211 SkASSERT(&a != &b); | 207 SkASSERT(&a != &b); |
| 212 | 208 |
| 213 if (a.getRenderTarget() != b.getRenderTarget() || | 209 if (a.getRenderTarget() != b.getRenderTarget() || |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 228 } | 224 } |
| 229 | 225 |
| 230 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 226 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
| 231 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore CoordTransforms)) { | 227 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore CoordTransforms)) { |
| 232 return false; | 228 return false; |
| 233 } | 229 } |
| 234 } | 230 } |
| 235 return true; | 231 return true; |
| 236 } | 232 } |
| 237 | 233 |
| OLD | NEW |