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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 count += (poly->fCount - 2) * (WIREFRAME ? 6 : 3); | 1432 count += (poly->fCount - 2) * (WIREFRAME ? 6 : 3); |
1433 } | 1433 } |
1434 } | 1434 } |
1435 if (0 == count) { | 1435 if (0 == count) { |
1436 return; | 1436 return; |
1437 } | 1437 } |
1438 | 1438 |
1439 size_t stride = gp->getVertexStride(); | 1439 size_t stride = gp->getVertexStride(); |
1440 const GrVertexBuffer* vertexBuffer; | 1440 const GrVertexBuffer* vertexBuffer; |
1441 int firstVertex; | 1441 int firstVertex; |
1442 void* verts = batchTarget->vertexPool()->makeSpace(stride, | 1442 void* verts = batchTarget->makeVertSpace(stride, count, &vertexBuffer, &
firstVertex); |
1443 count, | |
1444 &vertexBuffer, | |
1445 &firstVertex); | |
1446 | |
1447 if (!verts) { | 1443 if (!verts) { |
1448 SkDebugf("Could not allocate vertices\n"); | 1444 SkDebugf("Could not allocate vertices\n"); |
1449 return; | 1445 return; |
1450 } | 1446 } |
1451 | 1447 |
1452 LOG("emitting %d verts\n", count); | 1448 LOG("emitting %d verts\n", count); |
1453 void* end = polys_to_triangles(polys, fillType, verts); | 1449 void* end = polys_to_triangles(polys, fillType, verts); |
1454 int actualCount = static_cast<int>( | 1450 int actualCount = static_cast<int>( |
1455 (static_cast<char*>(end) - static_cast<char*>(verts)) / stride); | 1451 (static_cast<char*>(end) - static_cast<char*>(verts)) / stride); |
1456 LOG("actual count: %d\n", actualCount); | 1452 LOG("actual count: %d\n", actualCount); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 SkMatrix vmi; | 1507 SkMatrix vmi; |
1512 if (!viewM.invert(&vmi)) { | 1508 if (!viewM.invert(&vmi)) { |
1513 return false; | 1509 return false; |
1514 } | 1510 } |
1515 vmi.mapRect(&clipBounds); | 1511 vmi.mapRect(&clipBounds); |
1516 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); | 1512 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); |
1517 target->drawBatch(pipelineBuilder, batch); | 1513 target->drawBatch(pipelineBuilder, batch); |
1518 | 1514 |
1519 return true; | 1515 return true; |
1520 } | 1516 } |
OLD | NEW |