diff options
author | 2017-05-15 11:03:26 -0600 | |
---|---|---|
committer | 2017-05-15 18:01:59 +0000 | |
commit | bca46e29e9f96999df0b38fb9359e71b73217c94 (patch) | |
tree | 0bd487809346776fccfee12540968cb23aa6cb7a /src/gpu/ops/GrDrawVerticesOp.cpp | |
parent | 18e9484ad5b5755757dc6badb986017a088a9c6b (diff) |
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 <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops/GrDrawVerticesOp.cpp')
-rw-r--r-- | src/gpu/ops/GrDrawVerticesOp.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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); } |