| 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 | 180 |
| 181 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin
eBuilder, | 181 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin
eBuilder, |
| 182 GrXferProcessor::OptFlags flags, | 182 GrXferProcessor::OptFlags flags, |
| 183 const GrProcOptInfo& colorPOI, | 183 const GrProcOptInfo& colorPOI, |
| 184 const GrProcOptInfo& coveragePOI
, | 184 const GrProcOptInfo& coveragePOI
, |
| 185 int* firstColorProcessorIdx, | 185 int* firstColorProcessorIdx, |
| 186 int* firstCoverageProcessorIdx)
{ | 186 int* firstCoverageProcessorIdx)
{ |
| 187 fIgnoresCoverage = SkToBool(flags & GrXferProcessor::kIgnoreCoverage_OptFlag
); |
| 187 fReadsFragPosition = fXferProcessor->willReadFragmentPosition(); | 188 fReadsFragPosition = fXferProcessor->willReadFragmentPosition(); |
| 188 | 189 |
| 189 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || | 190 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || |
| 190 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { | 191 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { |
| 191 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); | 192 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); |
| 192 } else { | 193 } else { |
| 193 if (coveragePOI.readsFragPosition()) { | 194 if (coveragePOI.readsFragPosition()) { |
| 194 fReadsFragPosition = true; | 195 fReadsFragPosition = true; |
| 195 } | 196 } |
| 196 } | 197 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 225 } | 226 } |
| 226 | 227 |
| 227 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 228 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
| 228 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 229 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { |
| 229 return false; | 230 return false; |
| 230 } | 231 } |
| 231 } | 232 } |
| 232 return true; | 233 return true; |
| 233 } | 234 } |
| 234 | 235 |
| OLD | NEW |