OLD | NEW |
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 Loading... |
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, fViewMatrix, SkMatrix
::I())); | 1415 GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.fUsesLo
calCoords, |
| 1416 fPipelineInfo.fCoverageIgnored, fVie
wMatrix, |
| 1417 SkMatrix::I())); |
1416 batchTarget->initDraw(gp, pipeline); | 1418 batchTarget->initDraw(gp, pipeline); |
1417 gp->initBatchTracker(batchTarget->currentBatchTracker(), fPipelineInfo); | |
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))); |
1426 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc); | 1427 path_to_contours(fPath, tol, fClipBounds, contours.get(), alloc); |
1427 Poly* polys; | 1428 Poly* polys; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |