From bca46e29e9f96999df0b38fb9359e71b73217c94 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 15 May 2017 11:03:26 -0600 Subject: Convert GrMesh back to a class Specific methods that limit the data to valid configurations are better than a runtime mega-assert. Bug: skia: Change-Id: Ie15f2dc79659e44cfaddd16eb474795b110fda73 Reviewed-on: https://skia-review.googlesource.com/16577 Commit-Queue: Chris Dalton Reviewed-by: Brian Salomon --- src/gpu/ops/GrDrawVerticesOp.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/gpu/ops/GrDrawVerticesOp.cpp') diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 4921b42c78..557bb320cf 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -235,16 +235,11 @@ void GrDrawVerticesOp::onPrepareDraws(Target* target) const { vertexOffset += vertexCount; } - GrMesh mesh; - mesh.fPrimitiveType = this->primitiveType(); + GrMesh mesh(this->primitiveType()); if (indices) { - mesh.fIndexBuffer.reset(indexBuffer); - mesh.fIndexCount = fIndexCount; - mesh.fBaseIndex = firstIndex; + mesh.setIndexed(indexBuffer, fIndexCount, firstIndex); } - mesh.fVertexBuffer.reset(vertexBuffer); - mesh.fVertexCount = fVertexCount; - mesh.fBaseVertex = firstVertex; + mesh.setVertices(vertexBuffer, fVertexCount, firstVertex); target->draw(gp.get(), this->pipeline(), mesh); } -- cgit v1.2.3