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