Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3297)

Side by Side Diff: src/gpu/GrOptDrawState.cpp

Issue 751283002: Add XferProcessor factory in GrPaint and GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Review changes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« src/gpu/GrDrawState.cpp ('K') | « src/gpu/GrOptDrawState.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698