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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 this->removeFixedFunctionVertexAttribs(fixedFunctionVAToRemove, &descInf
o); | 99 this->removeFixedFunctionVertexAttribs(fixedFunctionVAToRemove, &descInf
o); |
100 } | 100 } |
101 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, &d
escInfo); | 101 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, &d
escInfo); |
102 | 102 |
103 // Copy GeometryProcesssor from DS or ODS | 103 // Copy GeometryProcesssor from DS or ODS |
104 SkASSERT(GrGpu::IsPathRenderingDrawType(drawType) || | 104 SkASSERT(GrGpu::IsPathRenderingDrawType(drawType) || |
105 GrGpu::kStencilPath_DrawType || | 105 GrGpu::kStencilPath_DrawType || |
106 drawState.hasGeometryProcessor()); | 106 drawState.hasGeometryProcessor()); |
107 fGeometryProcessor.reset(drawState.getGeometryProcessor()); | 107 fGeometryProcessor.reset(drawState.getGeometryProcessor()); |
108 | 108 |
| 109 // Create XferProcessor from DS's XPFactory |
| 110 const GrXferProcessor* xpProcessor = drawState.getXPFactory()->createXferPro
cessor(); |
| 111 fXferProcessor.reset(xpProcessor); |
| 112 xpProcessor->unref(); |
| 113 |
109 // Copy Stages from DS to ODS | 114 // Copy Stages from DS to ODS |
110 bool explicitLocalCoords = descInfo.hasLocalCoordAttribute(); | 115 bool explicitLocalCoords = descInfo.hasLocalCoordAttribute(); |
111 | 116 |
112 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { | 117 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { |
113 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 118 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, |
114 GrPendingFragmentStage, | 119 GrPendingFragmentStage, |
115 (drawState.fColorStages[i], explicitLocalCoords))
; | 120 (drawState.fColorStages[i], explicitLocalCoords))
; |
116 } | 121 } |
117 fNumColorStages = fFragmentStages.count(); | 122 fNumColorStages = fFragmentStages.count(); |
118 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i)
{ | 123 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i)
{ |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); | 312 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
308 for (int i = 0; i < this->numFragmentStages(); i++) { | 313 for (int i = 0; i < this->numFragmentStages(); i++) { |
309 | 314 |
310 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 315 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
311 return false; | 316 return false; |
312 } | 317 } |
313 } | 318 } |
314 return true; | 319 return true; |
315 } | 320 } |
316 | 321 |
OLD | NEW |