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
This commit is contained in:
bsalomon@google.com 2011-08-23 14:32:40 +00:00
parent 52c748b169
commit 8214587a79

View File

@ -658,8 +658,10 @@ void GrDrawTarget::drawIndexed(GrPrimitiveType type, int startVertex,
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 @@ void GrDrawTarget::drawNonIndexed(GrPrimitiveType type,
GrCrash("Non-indexed drawing outside valid vertex range.");
}
#endif
this->onDrawNonIndexed(type, startVertex, vertexCount);
if (vertexCount > 0) {
this->onDrawNonIndexed(type, startVertex, vertexCount);
}
}
////////////////////////////////////////////////////////////////////////////////