OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrOptDrawState.h" | 8 #include "GrOptDrawState.h" |
9 | 9 |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 this->computeEffectiveCoverageStages(drawState, &descInfo, &firstCoverageSta
geIdx); | 53 this->computeEffectiveCoverageStages(drawState, &descInfo, &firstCoverageSta
geIdx); |
54 this->adjustFromBlendOpts(drawState, &descInfo, &firstColorStageIdx, &firstC
overageStageIdx, | 54 this->adjustFromBlendOpts(drawState, &descInfo, &firstColorStageIdx, &firstC
overageStageIdx, |
55 &fixedFunctionVAToRemove); | 55 &fixedFunctionVAToRemove); |
56 // Should not be setting any more FFVA to be removed at this point | 56 // Should not be setting any more FFVA to be removed at this point |
57 if (0 != fixedFunctionVAToRemove) { | 57 if (0 != fixedFunctionVAToRemove) { |
58 this->removeFixedFunctionVertexAttribs(fixedFunctionVAToRemove, &descInf
o); | 58 this->removeFixedFunctionVertexAttribs(fixedFunctionVAToRemove, &descInf
o); |
59 } | 59 } |
60 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, &d
escInfo); | 60 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, &d
escInfo); |
61 | 61 |
62 // Copy GeometryProcesssor from DS or ODS | 62 // Copy GeometryProcesssor from DS or ODS |
| 63 SkASSERT(GrGpu::IsPathRenderingDrawType(drawType) || |
| 64 GrGpu::kStencilPath_DrawType || |
| 65 drawState.hasGeometryProcessor()); |
63 if (drawState.hasGeometryProcessor()) { | 66 if (drawState.hasGeometryProcessor()) { |
64 fGeometryProcessor.initAndRef(drawState.fGeometryProcessor); | 67 fGeometryProcessor.initAndRef(drawState.fGeometryProcessor); |
65 } else if (!GrGpu::IsPathRenderingDrawType(drawType)) { | |
66 // Install default GP, this will be ignored if we are rendering with fra
gment shader only | |
67 // TODO(joshualitt) rendering code should do this | |
68 fGeometryProcessor.reset(GrDefaultGeoProcFactory::Create()); | |
69 } else { | 68 } else { |
70 fGeometryProcessor.reset(NULL); | 69 fGeometryProcessor.reset(NULL); |
71 } | 70 } |
72 | 71 |
73 // Copy Color Stages from DS to ODS | 72 // Copy Color Stages from DS to ODS |
74 if (firstColorStageIdx < drawState.numColorStages()) { | 73 if (firstColorStageIdx < drawState.numColorStages()) { |
75 fFragmentStages.reset(&drawState.getColorStage(firstColorStageIdx), | 74 fFragmentStages.reset(&drawState.getColorStage(firstColorStageIdx), |
76 drawState.numColorStages() - firstColorStageIdx); | 75 drawState.numColorStages() - firstColorStageIdx); |
77 } else { | 76 } else { |
78 fFragmentStages.reset(); | 77 fFragmentStages.reset(); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 bool explicitLocalCoords = this->fDesc.header().fLocalCoordAttributeIndex !=
-1; | 352 bool explicitLocalCoords = this->fDesc.header().fLocalCoordAttributeIndex !=
-1; |
354 for (int i = 0; i < this->numFragmentStages(); i++) { | 353 for (int i = 0; i < this->numFragmentStages(); i++) { |
355 if (!GrFragmentStage::AreCompatible(this->getFragmentStage(i), that.getF
ragmentStage(i), | 354 if (!GrFragmentStage::AreCompatible(this->getFragmentStage(i), that.getF
ragmentStage(i), |
356 explicitLocalCoords)) { | 355 explicitLocalCoords)) { |
357 return false; | 356 return false; |
358 } | 357 } |
359 } | 358 } |
360 return true; | 359 return true; |
361 } | 360 } |
362 | 361 |
OLD | NEW |