Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: src/gpu/GrContext.cpp

Issue 1117953003: Simple CL to Compute bounds in GrContext::drawVertices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use bounds Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index b5c8e3e592b21f1d7667d33434316c92a48f5435..11bced9217f41435635d31f4da84bc30228f7211 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
bsalomon 2015/04/30 21:05:30 rm this comment? (maybe in the bounds into batch c
- target->drawBatch(&pipelineBuilder, batch, NULL);
+ target->drawBatch(&pipelineBuilder, batch, &bounds);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698