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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 LOG("emitting %d verts\n", count); | 1452 LOG("emitting %d verts\n", count); |
1453 void* end = polys_to_triangles(polys, fillType, vertices); | 1453 void* end = polys_to_triangles(polys, fillType, vertices); |
1454 int actualCount = static_cast<int>( | 1454 int actualCount = static_cast<int>( |
1455 (static_cast<char*>(end) - static_cast<char*>(vertices)) / stride); | 1455 (static_cast<char*>(end) - static_cast<char*>(vertices)) / stride); |
1456 LOG("actual count: %d\n", actualCount); | 1456 LOG("actual count: %d\n", actualCount); |
1457 SkASSERT(actualCount <= count); | 1457 SkASSERT(actualCount <= count); |
1458 | 1458 |
1459 GrPrimitiveType primitiveType = WIREFRAME ? kLines_GrPrimitiveType | 1459 GrPrimitiveType primitiveType = WIREFRAME ? kLines_GrPrimitiveType |
1460 : kTriangles_GrPrimitiveType; | 1460 : kTriangles_GrPrimitiveType; |
1461 GrDrawTarget::DrawInfo drawInfo; | 1461 GrDrawTarget::DrawInfo drawInfo; |
1462 drawInfo.init(primitiveType, vertexBuffer, firstVertex, actualCount); | 1462 drawInfo.setPrimitiveType(primitiveType); |
| 1463 drawInfo.setVertexBuffer(vertexBuffer); |
| 1464 drawInfo.setStartVertex(firstVertex); |
| 1465 drawInfo.setVertexCount(actualCount); |
| 1466 drawInfo.setStartIndex(0); |
| 1467 drawInfo.setIndexCount(0); |
1463 batchTarget->draw(drawInfo); | 1468 batchTarget->draw(drawInfo); |
1464 | 1469 |
1465 batchTarget->putBackVertices((size_t)(count - actualCount), stride); | 1470 batchTarget->putBackVertices((size_t)(count - actualCount), stride); |
1466 return; | 1471 return; |
1467 } | 1472 } |
1468 | 1473 |
1469 bool onCombineIfPossible(GrBatch*) override { | 1474 bool onCombineIfPossible(GrBatch*) override { |
1470 return false; | 1475 return false; |
1471 } | 1476 } |
1472 | 1477 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 SkMatrix vmi; | 1516 SkMatrix vmi; |
1512 if (!viewM.invert(&vmi)) { | 1517 if (!viewM.invert(&vmi)) { |
1513 return false; | 1518 return false; |
1514 } | 1519 } |
1515 vmi.mapRect(&clipBounds); | 1520 vmi.mapRect(&clipBounds); |
1516 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); | 1521 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM
, clipBounds)); |
1517 target->drawBatch(pipelineBuilder, batch); | 1522 target->drawBatch(pipelineBuilder, batch); |
1518 | 1523 |
1519 return true; | 1524 return true; |
1520 } | 1525 } |
OLD | NEW |