| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); | 215 *firstColorProcessorIdx = pipelineBuilder.numColorFragmentProcessors(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { | 218 if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) { |
| 219 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso
rs(); | 219 *firstCoverageProcessorIdx = pipelineBuilder.numCoverageFragmentProcesso
rs(); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 //////////////////////////////////////////////////////////////////////////////// | 223 //////////////////////////////////////////////////////////////////////////////// |
| 224 | 224 |
| 225 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b, | 225 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b) { |
| 226 bool ignoreCoordTransforms) { | |
| 227 SkASSERT(&a != &b); | 226 SkASSERT(&a != &b); |
| 228 | 227 |
| 229 if (a.getRenderTarget() != b.getRenderTarget() || | 228 if (a.getRenderTarget() != b.getRenderTarget() || |
| 230 a.fFragmentProcessors.count() != b.fFragmentProcessors.count() || | 229 a.fFragmentProcessors.count() != b.fFragmentProcessors.count() || |
| 231 a.fNumColorProcessors != b.fNumColorProcessors || | 230 a.fNumColorProcessors != b.fNumColorProcessors || |
| 232 a.fScissorState != b.fScissorState || | 231 a.fScissorState != b.fScissorState || |
| 233 !a.fWindowRectsState.cheapEqualTo(b.fWindowRectsState) || | 232 !a.fWindowRectsState.cheapEqualTo(b.fWindowRectsState) || |
| 234 a.fFlags != b.fFlags || | 233 a.fFlags != b.fFlags || |
| 235 a.fStencilSettings != b.fStencilSettings || | 234 a.fStencilSettings != b.fStencilSettings || |
| 236 a.fDrawFace != b.fDrawFace || | 235 a.fDrawFace != b.fDrawFace || |
| 237 a.fIgnoresCoverage != b.fIgnoresCoverage) { | 236 a.fIgnoresCoverage != b.fIgnoresCoverage) { |
| 238 return false; | 237 return false; |
| 239 } | 238 } |
| 240 | 239 |
| 241 // Most of the time both are nullptr | 240 // Most of the time both are nullptr |
| 242 if (a.fXferProcessor.get() || b.fXferProcessor.get()) { | 241 if (a.fXferProcessor.get() || b.fXferProcessor.get()) { |
| 243 if (!a.getXferProcessor().isEqual(b.getXferProcessor())) { | 242 if (!a.getXferProcessor().isEqual(b.getXferProcessor())) { |
| 244 return false; | 243 return false; |
| 245 } | 244 } |
| 246 } | 245 } |
| 247 | 246 |
| 248 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 247 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
| 249 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 248 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i))) { |
| 250 return false; | 249 return false; |
| 251 } | 250 } |
| 252 } | 251 } |
| 253 return true; | 252 return true; |
| 254 } | 253 } |
| OLD | NEW |