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

Unified Diff: src/gpu/batches/GrAAHairLinePathRenderer.cpp

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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
Index: src/gpu/batches/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 87e194064044267f17b7aae2e2161fc92ebf0e2a..7d45ed71f9fc255d490a5c8c36bfe3192ef8f535 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -860,7 +860,7 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
if (lineCount) {
SkAutoTUnref<const GrIndexBuffer> linesIndexBuffer(
ref_lines_index_buffer(target->resourceProvider()));
- target->initDraw(lineGP, this->pipeline());
+ target->initDraw(lineGP);
const GrVertexBuffer* vertexBuffer;
int firstVertex;
@@ -882,11 +882,11 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
}
{
- GrVertices vertices;
- vertices.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer,
- firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, lineCount,
- kLineSegsNumInIdxBuffer);
- target->draw(vertices);
+ GrMesh mesh;
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer,
+ firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, lineCount,
+ kLineSegsNumInIdxBuffer);
+ target->draw(mesh);
}
}
@@ -922,27 +922,27 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
}
if (quadCount > 0) {
- target->initDraw(quadGP, this->pipeline());
+ target->initDraw(quadGP);
{
- GrVertices tempVerts;
- tempVerts.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
- firstVertex, kQuadNumVertices, kIdxsPerQuad, quadCount,
- kQuadsNumInIdxBuffer);
- target->draw(tempVerts);
+ GrMesh mesh;
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
+ firstVertex, kQuadNumVertices, kIdxsPerQuad, quadCount,
+ kQuadsNumInIdxBuffer);
+ target->draw(mesh);
firstVertex += quadCount * kQuadNumVertices;
}
}
if (conicCount > 0) {
- target->initDraw(conicGP, this->pipeline());
+ target->initDraw(conicGP);
{
- GrVertices tempVerts;
- tempVerts.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
- firstVertex, kQuadNumVertices, kIdxsPerQuad, conicCount,
- kQuadsNumInIdxBuffer);
- target->draw(tempVerts);
+ GrMesh mesh;
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
+ firstVertex, kQuadNumVertices, kIdxsPerQuad, conicCount,
+ kQuadsNumInIdxBuffer);
+ target->draw(mesh);
}
}
}
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698