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

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

Issue 1213013003: Revert of Rework GrPipelineInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/GrRectBatch.cpp ('k') | src/gpu/GrTestBatch.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 1368 void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
1369 out->setKnownFourComponents(fColor); 1369 out->setKnownFourComponents(fColor);
1370 } 1370 }
1371 1371
1372 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 1372 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
1373 out->setUnknownSingleComponent(); 1373 out->setUnknownSingleComponent();
1374 } 1374 }
1375 1375
1376 void initBatchTracker(const GrPipelineInfo& init) override { 1376 void initBatchTracker(const GrPipelineInfo& init) override {
1377 // Handle any color overrides 1377 // Handle any color overrides
1378 if (!init.readsColor()) { 1378 if (init.fColorIgnored) {
1379 fColor = GrColor_ILLEGAL; 1379 fColor = GrColor_ILLEGAL;
1380 } else if (GrColor_ILLEGAL != init.fOverrideColor) {
1381 fColor = init.fOverrideColor;
1380 } 1382 }
1381 init.getOverrideColorIfSet(&fColor);
1382 fPipelineInfo = init; 1383 fPipelineInfo = init;
1383 } 1384 }
1384 1385
1385 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 1386 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override {
1386 SkRect pathBounds = fPath.getBounds(); 1387 SkRect pathBounds = fPath.getBounds();
1387 Comparator c; 1388 Comparator c;
1388 if (pathBounds.width() > pathBounds.height()) { 1389 if (pathBounds.width() > pathBounds.height()) {
1389 c.sweep_lt = sweep_lt_horiz; 1390 c.sweep_lt = sweep_lt_horiz;
1390 c.sweep_gt = sweep_gt_horiz; 1391 c.sweep_gt = sweep_gt_horiz;
1391 } else { 1392 } else {
(...skipping 12 matching lines...) Expand all
1404 return; 1405 return;
1405 } 1406 }
1406 SkPath::FillType fillType = fPath.getFillType(); 1407 SkPath::FillType fillType = fPath.getFillType();
1407 if (SkPath::IsInverseFillType(fillType)) { 1408 if (SkPath::IsInverseFillType(fillType)) {
1408 contourCnt++; 1409 contourCnt++;
1409 } 1410 }
1410 1411
1411 LOG("got %d pts, %d contours\n", maxPts, contourCnt); 1412 LOG("got %d pts, %d contours\n", maxPts, contourCnt);
1412 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType; 1413 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType;
1413 SkAutoTUnref<const GrGeometryProcessor> gp( 1414 SkAutoTUnref<const GrGeometryProcessor> gp(
1414 GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.readsLo calCoords(), 1415 GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.fUsesLo calCoords,
1415 !fPipelineInfo.readsCoverage(), fVie wMatrix, 1416 fPipelineInfo.fCoverageIgnored, fVie wMatrix,
1416 SkMatrix::I())); 1417 SkMatrix::I()));
1417 batchTarget->initDraw(gp, pipeline); 1418 batchTarget->initDraw(gp, pipeline);
1418 1419
1419 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt)); 1420 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt));
1420 1421
1421 // For the initial size of the chunk allocator, estimate based on the po int count: 1422 // For the initial size of the chunk allocator, estimate based on the po int count:
1422 // one vertex per point for the initial passes, plus two for the vertice s in the 1423 // one vertex per point for the initial passes, plus two for the vertice s in the
1423 // resulting Polys, since the same point may end up in two Polys. Assum e minimal 1424 // resulting Polys, since the same point may end up in two Polys. Assum e minimal
1424 // connectivity of one Edge per Vertex (will grow for intersections). 1425 // connectivity of one Edge per Vertex (will grow for intersections).
1425 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge))); 1426 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge)));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 SkMatrix vmi; 1529 SkMatrix vmi;
1529 bool result = viewMatrix.invert(&vmi); 1530 bool result = viewMatrix.invert(&vmi);
1530 if (!result) { 1531 if (!result) {
1531 SkFAIL("Cannot invert matrix\n"); 1532 SkFAIL("Cannot invert matrix\n");
1532 } 1533 }
1533 vmi.mapRect(&clipBounds); 1534 vmi.mapRect(&clipBounds);
1534 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds); 1535 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds);
1535 } 1536 }
1536 1537
1537 #endif 1538 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrRectBatch.cpp ('k') | src/gpu/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698