| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // GrPipelineBuilder's coverageProcInfo (like color above) to set this initi
al information. | 80 // GrPipelineBuilder's coverageProcInfo (like color above) to set this initi
al information. |
| 81 int firstCoverageStageIdx = 0; | 81 int firstCoverageStageIdx = 0; |
| 82 | 82 |
| 83 this->adjustProgramFromOptimizations(pipelineBuilder, optFlags, colorPOI, co
veragePOI, | 83 this->adjustProgramFromOptimizations(pipelineBuilder, optFlags, colorPOI, co
veragePOI, |
| 84 &firstColorStageIdx, &firstCoverageStag
eIdx); | 84 &firstColorStageIdx, &firstCoverageStag
eIdx); |
| 85 | 85 |
| 86 bool usesLocalCoords = false; | 86 bool usesLocalCoords = false; |
| 87 | 87 |
| 88 // Copy Stages from PipelineBuilder to Pipeline | 88 // Copy Stages from PipelineBuilder to Pipeline |
| 89 for (int i = firstColorStageIdx; i < pipelineBuilder.numColorFragmentStages(
); ++i) { | 89 for (int i = firstColorStageIdx; i < pipelineBuilder.numColorFragmentStages(
); ++i) { |
| 90 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 90 const GrFragmentProcessor* fp = pipelineBuilder.fColorStages[i].processo
r(); |
| 91 GrPendingFragmentStage, | 91 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, GrPendingFragmentStage, (fp)); |
| 92 (pipelineBuilder.fColorStages[i])); | 92 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); |
| 93 usesLocalCoords = usesLocalCoords || | |
| 94 pipelineBuilder.fColorStages[i].processor()->usesLocal
Coords(); | |
| 95 } | 93 } |
| 96 | 94 |
| 97 fNumColorStages = fFragmentStages.count(); | 95 fNumColorStages = fFragmentStages.count(); |
| 98 for (int i = firstCoverageStageIdx; i < pipelineBuilder.numCoverageFragmentS
tages(); ++i) { | 96 for (int i = firstCoverageStageIdx; i < pipelineBuilder.numCoverageFragmentS
tages(); ++i) { |
| 99 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 97 const GrFragmentProcessor* fp = pipelineBuilder.fCoverageStages[i].proce
ssor(); |
| 100 GrPendingFragmentStage, | 98 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, GrPendingFragmentStage, (fp)); |
| 101 (pipelineBuilder.fCoverageStages[i])); | 99 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); |
| 102 usesLocalCoords = usesLocalCoords || | |
| 103 pipelineBuilder.fCoverageStages[i].processor()->usesLo
calCoords(); | |
| 104 } | 100 } |
| 105 | 101 |
| 106 // Setup info we need to pass to GrPrimitiveProcessors that are used with th
is GrPipeline. | 102 // Setup info we need to pass to GrPrimitiveProcessors that are used with th
is GrPipeline. |
| 107 fInfoForPrimitiveProcessor.fFlags = 0; | 103 fInfoForPrimitiveProcessor.fFlags = 0; |
| 108 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) { | 104 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) { |
| 109 fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsColor_GrPipel
ineInfoFlag; | 105 fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsColor_GrPipel
ineInfoFlag; |
| 110 } | 106 } |
| 111 if (GrColor_ILLEGAL != overrideColor) { | 107 if (GrColor_ILLEGAL != overrideColor) { |
| 112 fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kUseOverrideColor_G
rPipelineInfoFlag; | 108 fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kUseOverrideColor_G
rPipelineInfoFlag; |
| 113 fInfoForPrimitiveProcessor.fOverrideColor = overrideColor; | 109 fInfoForPrimitiveProcessor.fOverrideColor = overrideColor; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); | 167 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
| 172 for (int i = 0; i < this->numFragmentStages(); i++) { | 168 for (int i = 0; i < this->numFragmentStages(); i++) { |
| 173 | 169 |
| 174 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 170 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
| 175 return false; | 171 return false; |
| 176 } | 172 } |
| 177 } | 173 } |
| 178 return true; | 174 return true; |
| 179 } | 175 } |
| 180 | 176 |
| OLD | NEW |