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

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

Issue 1261083003: Use new API everywhere for GrDefaultGeoProcFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup2
Patch Set: feedback inc 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
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, const GrPipeline* pipeline ) override {
253 SkAutoTUnref<const GrGeometryProcessor> gp( 253 SkAutoTUnref<const GrGeometryProcessor> gp;
254 GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPositi on_GPType, 254 {
255 this->color(), 255 using namespace GrDefaultGeoProcFactory;
256 this->usesLocalCoords(), 256 Color color(this->color());
257 this->coverageIgnored(), 257 Coverage coverage(this->coverage());
258 this->viewMatrix(), 258 if (this->coverageIgnored()) {
259 SkMatrix::I(), 259 coverage.fType = Coverage::kNone_Type;
260 this->coverage())); 260 }
261 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUseP osition_Type :
262 LocalCoords::kUnus ed_Type);
263 gp.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord s,
264 this->viewMatrix()));
265 }
261 266
262 size_t vertexStride = gp->getVertexStride(); 267 size_t vertexStride = gp->getVertexStride();
263 SkASSERT(vertexStride == sizeof(SkPoint)); 268 SkASSERT(vertexStride == sizeof(SkPoint));
264 269
265 batchTarget->initDraw(gp, pipeline); 270 batchTarget->initDraw(gp, pipeline);
266 271
267 int instanceCount = fGeoData.count(); 272 int instanceCount = fGeoData.count();
268 273
269 // compute number of vertices 274 // compute number of vertices
270 int maxVertices = 0; 275 int maxVertices = 0;
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 geometry.fColor = color; 767 geometry.fColor = color;
763 geometry.fPath = path; 768 geometry.fPath = path;
764 geometry.fTolerance = srcSpaceTol; 769 geometry.fTolerance = srcSpaceTol;
765 770
766 viewMatrix.mapRect(&bounds); 771 viewMatrix.mapRect(&bounds);
767 uint8_t coverage = GrRandomCoverage(random); 772 uint8_t coverage = GrRandomCoverage(random);
768 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds ); 773 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds );
769 } 774 }
770 775
771 #endif 776 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698