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

Unified Diff: src/gpu/batches/GrAAConvexPathRenderer.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/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index 9af3d797593c3115001963e329b9e8aa1bd16f04..f7a1221247de8870fd5459501252352afb9a19ae 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -793,7 +793,7 @@ private:
return;
}
- target->initDraw(gp, this->pipeline());
+ target->initDraw(gp, kTriangles_GrPrimitiveType);
size_t vertexStride = gp->getVertexStride();
@@ -836,8 +836,7 @@ private:
extract_verts(tess, verts, vertexStride, args.fColor, idxs, canTweakAlphaForCoverage);
GrVertices info;
- info.initIndexed(kTriangles_GrPrimitiveType,
- vertexBuffer, indexBuffer,
+ info.initIndexed(vertexBuffer, indexBuffer,
firstVertex, firstIndex,
tess.numPts(), tess.numIndices());
target->draw(info);
@@ -864,7 +863,7 @@ private:
SkAutoTUnref<GrGeometryProcessor> quadProcessor(
QuadEdgeEffect::Create(this->color(), invert, this->usesLocalCoords()));
- target->initDraw(quadProcessor, this->pipeline());
+ target->initDraw(quadProcessor, kTriangles_GrPrimitiveType);
// TODO generate all segments for all paths and use one vertex buffer
for (int i = 0; i < instanceCount; i++) {
@@ -928,8 +927,8 @@ private:
for (int j = 0; j < draws.count(); ++j) {
const Draw& draw = draws[j];
- vertices.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer,
- firstVertex, firstIndex, draw.fVertexCnt, draw.fIndexCnt);
+ vertices.initIndexed(vertexBuffer, indexBuffer, firstVertex, firstIndex,
+ draw.fVertexCnt, draw.fIndexCnt);
target->draw(vertices);
firstVertex += draw.fVertexCnt;
firstIndex += draw.fIndexCnt;

Powered by Google App Engine
This is Rietveld 408576698