handle null vertex or index buffers in batch
BUG=skia:
Review URL: https://codereview.chromium.org/979343002
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index fc8c184..20ae77c 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -762,6 +762,11 @@
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
CircleVertex* verts = reinterpret_cast<CircleVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
@@ -1012,6 +1017,11 @@
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
@@ -1303,6 +1313,11 @@
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
DIEllipseVertex* verts = reinterpret_cast<DIEllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
@@ -1692,6 +1707,11 @@
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
CircleVertex* verts = reinterpret_cast<CircleVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
@@ -1896,6 +1916,11 @@
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {