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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 979343002: handle null vertex or index buffers in batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 10 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 | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index fc8c18410cad0f76d20ed4226a2b8ab2317f3880..20ae77cb5244a258bec1de34730772d4f2f2d33f 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -762,6 +762,11 @@ public:
&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 @@ public:
&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 @@ public:
&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 @@ public:
&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 @@ public:
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698