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>
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 212605c..9d9cf27 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -679,17 +679,13 @@
 
     void flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
         if (flushInfo->fInstancesToFlush) {
-            GrMesh mesh;
+            GrMesh mesh(kTriangles_GrPrimitiveType);
             int maxInstancesPerDraw =
                 static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
-            mesh.fPrimitiveType = kTriangles_GrPrimitiveType;
-            mesh.fIndexBuffer.reset(flushInfo->fIndexBuffer.get());
-            mesh.fIndexCount = kIndicesPerQuad;
-            mesh.fVertexBuffer.reset(flushInfo->fVertexBuffer.get());
-            mesh.fVertexCount = kVerticesPerQuad;
-            mesh.fBaseVertex = flushInfo->fVertexOffset;
-            mesh.fPatternRepeatCount = flushInfo->fInstancesToFlush;
-            mesh.fMaxPatternRepetitionsInIndexBuffer = maxInstancesPerDraw;
+            mesh.setIndexedPatterned(flushInfo->fIndexBuffer.get(), kIndicesPerQuad,
+                                     flushInfo->fInstancesToFlush, maxInstancesPerDraw);
+            mesh.setVertices(flushInfo->fVertexBuffer.get(), kVerticesPerQuad,
+                             flushInfo->fVertexOffset);
             target->draw(flushInfo->fGeometryProcessor.get(), this->pipeline(), mesh);
             flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFlush;
             flushInfo->fInstancesToFlush = 0;