| 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 "GrDrawState.h" | 10 #include "GrDrawState.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, ha
sLocalCoords, | 94 this->getStageStats(drawState, firstColorStageIdx, firstCoverageStageIdx, ha
sLocalCoords, |
| 95 &descInfo); | 95 &descInfo); |
| 96 | 96 |
| 97 // Copy GeometryProcesssor from DS or ODS | 97 // Copy GeometryProcesssor from DS or ODS |
| 98 SkASSERT(GrGpu::IsPathRenderingDrawType(drawType) || | 98 SkASSERT(GrGpu::IsPathRenderingDrawType(drawType) || |
| 99 GrGpu::kStencilPath_DrawType || | 99 GrGpu::kStencilPath_DrawType || |
| 100 drawState.hasGeometryProcessor()); | 100 drawState.hasGeometryProcessor()); |
| 101 fGeometryProcessor.reset(drawState.getGeometryProcessor()); | 101 fGeometryProcessor.reset(drawState.getGeometryProcessor()); |
| 102 | 102 |
| 103 // Create XferProcessor from DS's XPFactory |
| 104 const GrXferProcessor* xpProcessor = drawState.getXPFactory()->createXferPro
cessor(); |
| 105 fXferProcessor.reset(xpProcessor); |
| 106 xpProcessor->unref(); |
| 107 |
| 103 // Copy Stages from DS to ODS | 108 // Copy Stages from DS to ODS |
| 104 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { | 109 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { |
| 105 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 110 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, |
| 106 GrPendingFragmentStage, | 111 GrPendingFragmentStage, |
| 107 (drawState.fColorStages[i], hasLocalCoords)); | 112 (drawState.fColorStages[i], hasLocalCoords)); |
| 108 } | 113 } |
| 109 fNumColorStages = fFragmentStages.count(); | 114 fNumColorStages = fFragmentStages.count(); |
| 110 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i)
{ | 115 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i)
{ |
| 111 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, | 116 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, |
| 112 GrPendingFragmentStage, | 117 GrPendingFragmentStage, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); | 266 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
| 262 for (int i = 0; i < this->numFragmentStages(); i++) { | 267 for (int i = 0; i < this->numFragmentStages(); i++) { |
| 263 | 268 |
| 264 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 269 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
| 265 return false; | 270 return false; |
| 266 } | 271 } |
| 267 } | 272 } |
| 268 return true; | 273 return true; |
| 269 } | 274 } |
| 270 | 275 |
| OLD | NEW |