Index: src/gpu/GrAAHairLinePathRenderer.cpp |
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp |
index ba6dcecd43d08340bd57deac5a2dec20219c2a77..f046af871f5ef1dab82218130e02defc63480e67 100644 |
--- a/src/gpu/GrAAHairLinePathRenderer.cpp |
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp |
@@ -888,14 +888,23 @@ |
} |
{ |
- int linesLeft = lineCount; |
GrDrawTarget::DrawInfo info; |
- info.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer, |
- firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, &linesLeft, |
- kLineSegsNumInIdxBuffer); |
- do { |
+ info.setVertexBuffer(vertexBuffer); |
+ info.setIndexBuffer(linesIndexBuffer); |
+ info.setPrimitiveType(kTriangles_GrPrimitiveType); |
+ info.setStartIndex(0); |
+ |
+ int lines = 0; |
+ while (lines < lineCount) { |
+ int n = SkTMin(lineCount - lines, kLineSegsNumInIdxBuffer); |
+ |
+ info.setStartVertex(kLineSegNumVertices*lines + firstVertex); |
+ info.setVertexCount(kLineSegNumVertices*n); |
+ info.setIndexCount(kIdxsPerLineSeg*n); |
batchTarget->draw(info); |
- } while (info.nextInstances(&linesLeft, kLineSegsNumInIdxBuffer)); |
+ |
+ lines += n; |
+ } |
} |
} |
@@ -944,15 +953,23 @@ |
quadGP->initBatchTracker(batchTarget->currentBatchTracker(), init); |
{ |
- int quadsLeft = quadCount; |
- GrDrawTarget::DrawInfo info; |
- info.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer, |
- firstVertex, kQuadNumVertices, kIdxsPerQuad, &quadsLeft, |
- kQuadsNumInIdxBuffer); |
- do { |
+ GrDrawTarget::DrawInfo info; |
+ info.setVertexBuffer(vertexBuffer); |
+ info.setIndexBuffer(quadsIndexBuffer); |
+ info.setPrimitiveType(kTriangles_GrPrimitiveType); |
+ info.setStartIndex(0); |
+ |
+ int quads = 0; |
+ while (quads < quadCount) { |
+ int n = SkTMin(quadCount - quads, kQuadsNumInIdxBuffer); |
+ |
+ info.setStartVertex(kQuadNumVertices*quads + firstVertex); |
+ info.setVertexCount(kQuadNumVertices*n); |
+ info.setIndexCount(kIdxsPerQuad*n); |
batchTarget->draw(info); |
- } while (info.nextInstances(&quadsLeft, kQuadsNumInIdxBuffer)); |
- firstVertex += quadCount * kQuadNumVertices; |
+ |
+ quads += n; |
+ } |
} |
} |
@@ -968,14 +985,23 @@ |
conicGP->initBatchTracker(batchTarget->currentBatchTracker(), init); |
{ |
- int conicsLeft = conicCount; |
GrDrawTarget::DrawInfo info; |
- info.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer, |
- firstVertex, kQuadNumVertices, kIdxsPerQuad, &conicsLeft, |
- kQuadsNumInIdxBuffer); |
- do { |
+ info.setVertexBuffer(vertexBuffer); |
+ info.setIndexBuffer(quadsIndexBuffer); |
+ info.setPrimitiveType(kTriangles_GrPrimitiveType); |
+ info.setStartIndex(0); |
+ |
+ int conics = 0; |
+ while (conics < conicCount) { |
+ int n = SkTMin(conicCount - conics, kQuadsNumInIdxBuffer); |
+ |
+ info.setStartVertex(kQuadNumVertices*(quadCount + conics) + firstVertex); |
+ info.setVertexCount(kQuadNumVertices*n); |
+ info.setIndexCount(kIdxsPerQuad*n); |
batchTarget->draw(info); |
- } while (info.nextInstances(&conicsLeft, kQuadsNumInIdxBuffer)); |
+ |
+ conics += n; |
+ } |
} |
} |
} |