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

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: rebase 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..e44a0467b117c24c79c9d74768f8084646ae96cf 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, kTriangles_GrPrimitiveType);
const GrVertexBuffer* vertexBuffer;
int firstVertex;
@@ -883,9 +883,8 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
{
GrVertices vertices;
- vertices.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer,
- firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, lineCount,
- kLineSegsNumInIdxBuffer);
+ vertices.initInstanced(vertexBuffer, linesIndexBuffer, firstVertex, kLineSegNumVertices,
+ kIdxsPerLineSeg, lineCount, kLineSegsNumInIdxBuffer);
target->draw(vertices);
}
}
@@ -922,12 +921,12 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
}
if (quadCount > 0) {
- target->initDraw(quadGP, this->pipeline());
+ target->initDraw(quadGP, kTriangles_GrPrimitiveType);
{
GrVertices tempVerts;
- tempVerts.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
- firstVertex, kQuadNumVertices, kIdxsPerQuad, quadCount,
+ tempVerts.initInstanced(vertexBuffer, quadsIndexBuffer, firstVertex,
+ kQuadNumVertices, kIdxsPerQuad, quadCount,
kQuadsNumInIdxBuffer);
target->draw(tempVerts);
firstVertex += quadCount * kQuadNumVertices;
@@ -935,12 +934,12 @@ void AAHairlineBatch::onPrepareDraws(Target* target) const {
}
if (conicCount > 0) {
- target->initDraw(conicGP, this->pipeline());
+ target->initDraw(conicGP, kTriangles_GrPrimitiveType);
{
GrVertices tempVerts;
- tempVerts.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
- firstVertex, kQuadNumVertices, kIdxsPerQuad, conicCount,
+ tempVerts.initInstanced(vertexBuffer, quadsIndexBuffer, firstVertex,
+ kQuadNumVertices, kIdxsPerQuad, conicCount,
kQuadsNumInIdxBuffer);
target->draw(tempVerts);
}

Powered by Google App Engine
This is Rietveld 408576698