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

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

Issue 1261083003: Use new API everywhere for GrDefaultGeoProcFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup2
Patch Set: tweaks 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/GrRectBatch.cpp ('k') | src/gpu/effects/GrDashingEffect.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 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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 if (maxPts > ((int)SK_MaxU16 + 1)) { 1397 if (maxPts > ((int)SK_MaxU16 + 1)) {
1398 SkDebugf("Path not rendered, too many verts (%d)\n", maxPts); 1398 SkDebugf("Path not rendered, too many verts (%d)\n", maxPts);
1399 return; 1399 return;
1400 } 1400 }
1401 SkPath::FillType fillType = fPath.getFillType(); 1401 SkPath::FillType fillType = fPath.getFillType();
1402 if (SkPath::IsInverseFillType(fillType)) { 1402 if (SkPath::IsInverseFillType(fillType)) {
1403 contourCnt++; 1403 contourCnt++;
1404 } 1404 }
1405 1405
1406 LOG("got %d pts, %d contours\n", maxPts, contourCnt); 1406 LOG("got %d pts, %d contours\n", maxPts, contourCnt);
1407 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType; 1407 SkAutoTUnref<const GrGeometryProcessor> gp;
1408 SkAutoTUnref<const GrGeometryProcessor> gp( 1408 {
1409 GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.readsLo calCoords(), 1409 using namespace GrDefaultGeoProcFactory;
1410 !fPipelineInfo.readsCoverage(), fVie wMatrix, 1410
1411 SkMatrix::I())); 1411 Color color(fColor);
1412 LocalCoords localCoords(fPipelineInfo.readsLocalCoords() ?
1413 LocalCoords::kUsePosition_Type :
1414 LocalCoords::kUnused_Type);
1415 Coverage::Type coverageType;
1416 if (fPipelineInfo.readsCoverage()) {
1417 coverageType = Coverage::kSolid_Type;
1418 } else {
1419 coverageType = Coverage::kNone_Type;
1420 }
1421 Coverage coverage(coverageType);
1422 gp.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord s,
1423 fViewMatrix));
1424 }
1412 batchTarget->initDraw(gp, pipeline); 1425 batchTarget->initDraw(gp, pipeline);
1413 1426
1414 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt)); 1427 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt));
1415 1428
1416 // For the initial size of the chunk allocator, estimate based on the po int count: 1429 // For the initial size of the chunk allocator, estimate based on the po int count:
1417 // one vertex per point for the initial passes, plus two for the vertice s in the 1430 // one vertex per point for the initial passes, plus two for the vertice s in the
1418 // resulting Polys, since the same point may end up in two Polys. Assum e minimal 1431 // resulting Polys, since the same point may end up in two Polys. Assum e minimal
1419 // connectivity of one Edge per Vertex (will grow for intersections). 1432 // connectivity of one Edge per Vertex (will grow for intersections).
1420 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge))); 1433 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge)));
1421 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc); 1434 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 SkMatrix vmi; 1531 SkMatrix vmi;
1519 bool result = viewMatrix.invert(&vmi); 1532 bool result = viewMatrix.invert(&vmi);
1520 if (!result) { 1533 if (!result) {
1521 SkFAIL("Cannot invert matrix\n"); 1534 SkFAIL("Cannot invert matrix\n");
1522 } 1535 }
1523 vmi.mapRect(&clipBounds); 1536 vmi.mapRect(&clipBounds);
1524 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds); 1537 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds);
1525 } 1538 }
1526 1539
1527 #endif 1540 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrRectBatch.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698