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(); | |
188 | 187 |
189 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || | 188 if ((flags & GrXferProcessor::kIgnoreColor_OptFlag) || |
190 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { | 189 (flags & GrXferProcessor::kOverrideColor_OptFlag)) { |
191 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); | 190 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); |
192 } else { | |
193 if (colorPOI.readsFragPosition()) { | |
194 fReadsFragPosition = true; | |
195 } | |
196 } | 191 } |
197 | 192 |
198 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { | 193 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { |
199 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso
rs(); | 194 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso
rs(); |
200 } else { | |
201 if (coveragePOI.readsFragPosition()) { | |
202 fReadsFragPosition = true; | |
203 } | |
204 } | 195 } |
205 } | 196 } |
206 | 197 |
207 //////////////////////////////////////////////////////////////////////////////// | 198 //////////////////////////////////////////////////////////////////////////////// |
208 | 199 |
209 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, | 200 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, |
210 bool ignoreCoordTransforms) { | 201 bool ignoreCoordTransforms) { |
211 SkASSERT(&a != &b); | 202 SkASSERT(&a != &b); |
212 | 203 |
213 if (a.getRenderTarget() != b.getRenderTarget() || | 204 if (a.getRenderTarget() != b.getRenderTarget() || |
(...skipping 14 matching lines...) Expand all Loading... |
228 } | 219 } |
229 | 220 |
230 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 221 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
231 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 222 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { |
232 return false; | 223 return false; |
233 } | 224 } |
234 } | 225 } |
235 return true; | 226 return true; |
236 } | 227 } |
237 | 228 |
OLD | NEW |