aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrOvalOpFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops/GrOvalOpFactory.cpp')
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index f5cc2ec7f2..a8081826df 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -1096,14 +1096,9 @@ private:
vertices += circle_type_to_vert_count(geom.fStroked) * vertexStride;
}
- GrMesh mesh;
- mesh.fPrimitiveType = kTriangles_GrPrimitiveType;
- mesh.fIndexBuffer.reset(indexBuffer);
- mesh.fIndexCount = fIndexCount;
- mesh.fBaseIndex = firstIndex;
- mesh.fVertexBuffer.reset(vertexBuffer);
- mesh.fVertexCount = fVertCount;
- mesh.fBaseVertex = firstVertex;
+ GrMesh mesh(kTriangles_GrPrimitiveType);
+ mesh.setIndexed(indexBuffer, fIndexCount, firstIndex);
+ mesh.setVertices(vertexBuffer, fVertCount, firstVertex);
target->draw(gp.get(), this->pipeline(), mesh);
}
@@ -2002,14 +1997,9 @@ private:
currStartVertex += rrect_type_to_vert_count(args.fType);
}
- GrMesh mesh;
- mesh.fPrimitiveType = kTriangles_GrPrimitiveType;
- mesh.fIndexBuffer.reset(indexBuffer);
- mesh.fIndexCount = fIndexCount;
- mesh.fBaseIndex = firstIndex;
- mesh.fVertexBuffer.reset(vertexBuffer);
- mesh.fVertexCount = fVertCount;
- mesh.fBaseVertex = firstVertex;
+ GrMesh mesh(kTriangles_GrPrimitiveType);
+ mesh.setIndexed(indexBuffer, fIndexCount, firstIndex);
+ mesh.setVertices(vertexBuffer, fVertCount, firstVertex);
target->draw(gp.get(), this->pipeline(), mesh);
}
@@ -2195,10 +2185,10 @@ private:
sk_sp<const GrBuffer> indexBuffer(ref_rrect_index_buffer(
fStroked ? kStroke_RRectType : kFill_RRectType, target->resourceProvider()));
- PatternHelper helper;
+ PatternHelper helper(kTriangles_GrPrimitiveType);
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(
- helper.init(target, kTriangles_GrPrimitiveType, vertexStride, indexBuffer.get(),
- kVertsPerStandardRRect, indicesPerInstance, instanceCount));
+ helper.init(target, vertexStride, indexBuffer.get(), kVertsPerStandardRRect,
+ indicesPerInstance, instanceCount));
if (!verts || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
return;