Iterate over instanced draws in GrGpu rather than above GrBatchTarget
Review URL: https://codereview.chromium.org/1127273007
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 8222504..15e4b28 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -29,6 +29,7 @@
fInstanceCount = di.fInstanceCount;
fVerticesPerInstance = di.fVerticesPerInstance;
fIndicesPerInstance = di.fIndicesPerInstance;
+ fMaxInstancesPerDraw = di.fMaxInstancesPerDraw;
fVertexBuffer.reset(di.vertexBuffer());
fIndexBuffer.reset(di.indexBuffer());
@@ -288,7 +289,11 @@
void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
this->handleDirtyContext();
- this->onDraw(args, vertices);
+ GrVertices::Iterator iter;
+ const GrNonInstancedVertices* verts = iter.init(vertices);
+ do {
+ this->onDraw(args, *verts);
+ } while ((verts = iter.next()));
}
void GrGpu::stencilPath(const GrPath* path, const StencilPathState& state) {