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

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

Issue 1275083002: Don't pass pipeline to GrBatch::generateGeometry() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months 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
« no previous file with comments | « src/gpu/GrBatch.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 init.getOverrideColorIfSet(&fGeoData[0].fColor); 243 init.getOverrideColorIfSet(&fGeoData[0].fColor);
244 244
245 // setup batch properties 245 // setup batch properties
246 fBatch.fColorIgnored = !init.readsColor(); 246 fBatch.fColorIgnored = !init.readsColor();
247 fBatch.fColor = fGeoData[0].fColor; 247 fBatch.fColor = fGeoData[0].fColor;
248 fBatch.fUsesLocalCoords = init.readsLocalCoords(); 248 fBatch.fUsesLocalCoords = init.readsLocalCoords();
249 fBatch.fCoverageIgnored = !init.readsCoverage(); 249 fBatch.fCoverageIgnored = !init.readsCoverage();
250 } 250 }
251 251
252 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 252 void generateGeometry(GrBatchTarget* batchTarget) override {
253 SkAutoTUnref<const GrGeometryProcessor> gp; 253 SkAutoTUnref<const GrGeometryProcessor> gp;
254 { 254 {
255 using namespace GrDefaultGeoProcFactory; 255 using namespace GrDefaultGeoProcFactory;
256 Color color(this->color()); 256 Color color(this->color());
257 Coverage coverage(this->coverage()); 257 Coverage coverage(this->coverage());
258 if (this->coverageIgnored()) { 258 if (this->coverageIgnored()) {
259 coverage.fType = Coverage::kNone_Type; 259 coverage.fType = Coverage::kNone_Type;
260 } 260 }
261 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUseP osition_Type : 261 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUseP osition_Type :
262 LocalCoords::kUnus ed_Type); 262 LocalCoords::kUnus ed_Type);
263 gp.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord s, 263 gp.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord s,
264 this->viewMatrix())); 264 this->viewMatrix()));
265 } 265 }
266 266
267 size_t vertexStride = gp->getVertexStride(); 267 size_t vertexStride = gp->getVertexStride();
268 SkASSERT(vertexStride == sizeof(SkPoint)); 268 SkASSERT(vertexStride == sizeof(SkPoint));
269 269
270 batchTarget->initDraw(gp, pipeline); 270 batchTarget->initDraw(gp, this->pipeline());
271 271
272 int instanceCount = fGeoData.count(); 272 int instanceCount = fGeoData.count();
273 273
274 // compute number of vertices 274 // compute number of vertices
275 int maxVertices = 0; 275 int maxVertices = 0;
276 276
277 // We will use index buffers if we have multiple paths or one path with multiple contours 277 // We will use index buffers if we have multiple paths or one path with multiple contours
278 bool isIndexed = instanceCount > 1; 278 bool isIndexed = instanceCount > 1;
279 for (int i = 0; i < instanceCount; i++) { 279 for (int i = 0; i < instanceCount; i++) {
280 Geometry& args = fGeoData[i]; 280 Geometry& args = fGeoData[i];
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 geometry.fColor = color; 753 geometry.fColor = color;
754 geometry.fPath = path; 754 geometry.fPath = path;
755 geometry.fTolerance = srcSpaceTol; 755 geometry.fTolerance = srcSpaceTol;
756 756
757 viewMatrix.mapRect(&bounds); 757 viewMatrix.mapRect(&bounds);
758 uint8_t coverage = GrRandomCoverage(random); 758 uint8_t coverage = GrRandomCoverage(random);
759 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds ); 759 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds );
760 } 760 }
761 761
762 #endif 762 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBatch.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698