aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-04-30 14:03:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-30 14:03:02 -0700
commita09c0461463a5976908af5232b755e1663b972bf (patch)
treeda4004d964138ca37120f4071afedadf72f4877b /src/gpu/GrContext.cpp
parent3e708c53f79a04b588b6ca8e535e61f986d80b47 (diff)
Simple CL to Compute bounds in GrContext::drawVertices
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-xsrc/gpu/GrContext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index b5c8e3e592..11bced9217 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1119,6 +1119,13 @@ void GrContext::drawVertices(GrRenderTarget* rt,
GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target);
+ // TODO clients should give us bounds
+ SkRect bounds;
+ if (!bounds.setBoundsCheck(positions, vertexCount)) {
+ SkDebugf("drawVertices call empty bounds\n");
+ return;
+ }
+
DrawVerticesBatch::Geometry geometry;
geometry.fColor = paint.getColor();
@@ -1127,7 +1134,7 @@ void GrContext::drawVertices(GrRenderTarget* rt,
indexCount,colors, texCoords));
// TODO figure out bounds
- target->drawBatch(&pipelineBuilder, batch, NULL);
+ target->drawBatch(&pipelineBuilder, batch, &bounds);
}
///////////////////////////////////////////////////////////////////////////////