diff options
author | 2015-04-30 14:03:02 -0700 | |
---|---|---|
committer | 2015-04-30 14:03:02 -0700 | |
commit | a09c0461463a5976908af5232b755e1663b972bf (patch) | |
tree | da4004d964138ca37120f4071afedadf72f4877b /src/gpu/GrContext.cpp | |
parent | 3e708c53f79a04b588b6ca8e535e61f986d80b47 (diff) |
Simple CL to Compute bounds in GrContext::drawVertices
BUG=skia:
Review URL: https://codereview.chromium.org/1117953003
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-x | src/gpu/GrContext.cpp | 9 |
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); } /////////////////////////////////////////////////////////////////////////////// |