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

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

Issue 1132323003: Revert of Preliminary attempt to remove batch tracker (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup5
Patch Set: Created 5 years, 7 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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 return; 1405 return;
1406 } 1406 }
1407 SkPath::FillType fillType = fPath.getFillType(); 1407 SkPath::FillType fillType = fPath.getFillType();
1408 if (SkPath::IsInverseFillType(fillType)) { 1408 if (SkPath::IsInverseFillType(fillType)) {
1409 contourCnt++; 1409 contourCnt++;
1410 } 1410 }
1411 1411
1412 LOG("got %d pts, %d contours\n", maxPts, contourCnt); 1412 LOG("got %d pts, %d contours\n", maxPts, contourCnt);
1413 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType; 1413 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType;
1414 SkAutoTUnref<const GrGeometryProcessor> gp( 1414 SkAutoTUnref<const GrGeometryProcessor> gp(
1415 GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.fUsesLo calCoords, 1415 GrDefaultGeoProcFactory::Create(flags, fColor, fViewMatrix, SkMatrix ::I()));
1416 fPipelineInfo.fCoverageIgnored, fVie wMatrix,
1417 SkMatrix::I()));
1418 batchTarget->initDraw(gp, pipeline); 1416 batchTarget->initDraw(gp, pipeline);
1417 gp->initBatchTracker(batchTarget->currentBatchTracker(), fPipelineInfo);
1419 1418
1420 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt)); 1419 SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt));
1421 1420
1422 // For the initial size of the chunk allocator, estimate based on the po int count: 1421 // For the initial size of the chunk allocator, estimate based on the po int count:
1423 // one vertex per point for the initial passes, plus two for the vertice s in the 1422 // one vertex per point for the initial passes, plus two for the vertice s in the
1424 // resulting Polys, since the same point may end up in two Polys. Assum e minimal 1423 // resulting Polys, since the same point may end up in two Polys. Assum e minimal
1425 // connectivity of one Edge per Vertex (will grow for intersections). 1424 // connectivity of one Edge per Vertex (will grow for intersections).
1426 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge))); 1425 SkChunkAlloc alloc(maxPts * (3 * sizeof(Vertex) + sizeof(Edge)));
1427 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc); 1426 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc);
1428 Poly* polys; 1427 Poly* polys;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 SkMatrix vmi; 1528 SkMatrix vmi;
1530 bool result = viewMatrix.invert(&vmi); 1529 bool result = viewMatrix.invert(&vmi);
1531 if (!result) { 1530 if (!result) {
1532 SkFAIL("Cannot invert matrix\n"); 1531 SkFAIL("Cannot invert matrix\n");
1533 } 1532 }
1534 vmi.mapRect(&clipBounds); 1533 vmi.mapRect(&clipBounds);
1535 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds); 1534 return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds);
1536 } 1535 }
1537 1536
1538 #endif 1537 #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