Chromium Code Reviews| 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 SkASSERT(drawState.hasXPFactory()); | |
| 111 const GrXferProcessor* xpProcessor = drawState.getXPFactory()->createXferPro cessor(); | |
| 112 fXferProcessor.reset(xpProcessor); | |
| 113 SkSafeUnref(xpProcessor); | |
|
bsalomon
2014/11/26 21:02:45
SkUnref() or ->unref(), no need for safety, right?
egdaniel
2014/12/01 18:18:24
correct
| |
| 114 | |
| 109 // Copy Stages from DS to ODS | 115 // Copy Stages from DS to ODS |
| 110 bool explicitLocalCoords = descInfo.hasLocalCoordAttribute(); | 116 bool explicitLocalCoords = descInfo.hasLocalCoordAttribute(); |
| 111 | 117 |
| 112 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { | 118 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { |
| 113 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 119 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, |
| 114 GrPendingFragmentStage, | 120 GrPendingFragmentStage, |
| 115 (drawState.fColorStages[i], explicitLocalCoords)) ; | 121 (drawState.fColorStages[i], explicitLocalCoords)) ; |
| 116 } | 122 } |
| 117 fNumColorStages = fFragmentStages.count(); | 123 fNumColorStages = fFragmentStages.count(); |
| 118 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i) { | 124 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()); | 313 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
| 308 for (int i = 0; i < this->numFragmentStages(); i++) { | 314 for (int i = 0; i < this->numFragmentStages(); i++) { |
| 309 | 315 |
| 310 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 316 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
| 311 return false; | 317 return false; |
| 312 } | 318 } |
| 313 } | 319 } |
| 314 return true; | 320 return true; |
| 315 } | 321 } |
| 316 | 322 |
| OLD | NEW |