aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-05-07 11:35:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-07 11:35:55 -0700
commite64eb570a5b9480bc24d0656ccabcff1ab13a229 (patch)
tree63b3e4e6bb0533a35f33b00a65e77c37d638c00a /src/gpu/GrGpu.cpp
parent3b58d75170508567436cce259384d336949407d4 (diff)
Iterate over instanced draws in GrGpu rather than above GrBatchTarget
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp7
1 files changed, 6 insertions, 1 deletions
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) {