From e64eb570a5b9480bc24d0656ccabcff1ab13a229 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Thu, 7 May 2015 11:35:55 -0700 Subject: Iterate over instanced draws in GrGpu rather than above GrBatchTarget Review URL: https://codereview.chromium.org/1127273007 --- src/gpu/GrGpu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gpu/GrGpu.cpp') diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 8222504b0e..15e4b28c3a 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -29,6 +29,7 @@ GrVertices& GrVertices::operator =(const GrVertices& di) { 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::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { 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) { -- cgit v1.2.3