Exit early from 0 prim draws in GrDrawTarget
Review URL: http://codereview.appspot.com/4929045/
git-svn-id: http://skia.googlecode.com/svn/trunk@2159 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrDrawTarget.cpp b/gpu/src/GrDrawTarget.cpp
index 1dd750d..7efe381 100644
--- a/gpu/src/GrDrawTarget.cpp
+++ b/gpu/src/GrDrawTarget.cpp
@@ -658,8 +658,10 @@
GrCrash("Indexed drawing outside valid index range.");
}
#endif
- this->onDrawIndexed(type, startVertex, startIndex,
- vertexCount, indexCount);
+ if (indexCount > 0) {
+ this->onDrawIndexed(type, startVertex, startIndex,
+ vertexCount, indexCount);
+ }
}
@@ -686,7 +688,9 @@
GrCrash("Non-indexed drawing outside valid vertex range.");
}
#endif
- this->onDrawNonIndexed(type, startVertex, vertexCount);
+ if (vertexCount > 0) {
+ this->onDrawNonIndexed(type, startVertex, vertexCount);
+ }
}
////////////////////////////////////////////////////////////////////////////////