Batch consecutive draw rects.
Review URL: http://codereview.appspot.com/4178057/
git-svn-id: http://skia.googlecode.com/svn/trunk@800 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext_impl.h b/gpu/include/GrContext_impl.h
index b54e927..8af38e6 100644
--- a/gpu/include/GrContext_impl.h
+++ b/gpu/include/GrContext_impl.h
@@ -30,7 +30,7 @@
GrDrawTarget::AutoReleaseGeometry geo;
- this->prepareToDraw(paint);
+ GrDrawTarget* target = this->prepareToDraw(paint, kUnbuffered_DrawCategory);
if (NULL != paint.getTexture()) {
if (NULL != texCoordSrc) {
@@ -47,7 +47,7 @@
int vertexCount = posSrc.count();
int indexCount = (NULL != idxSrc) ? idxSrc->count() : 0;
- if (!geo.set(fGpu, layout, vertexCount, indexCount)) {
+ if (!geo.set(target, layout, vertexCount, indexCount)) {
GrPrintf("Failed to get space for vertices!");
return;
}
@@ -77,9 +77,9 @@
}
if (NULL == idxSrc) {
- fGpu->drawNonIndexed(primitiveType, 0, vertexCount);
+ target->drawNonIndexed(primitiveType, 0, vertexCount);
} else {
- fGpu->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount);
+ target->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount);
}
}