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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 1124633003: Revert of Start on simplifying generateGeometry() overrides (Closed) Base URL: https://skia.googlesource.com/skia.git@ibcache
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ }
}
}
}
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698