Index: src/gpu/GrAARectRenderer.cpp |
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp |
index 7c34c25abd405dfd64a7c51ab61dd3e54627174a..6affc927ac6de376cd25c9f8c5bbc8b2fa97eb5b 100644 |
--- a/src/gpu/GrAARectRenderer.cpp |
+++ b/src/gpu/GrAARectRenderer.cpp |
@@ -134,6 +134,11 @@ public: |
&vertexBuffer, |
&firstVertex); |
+ if (!vertices) { |
+ SkDebugf("Could not allocate vertices\n"); |
+ return; |
+ } |
+ |
for (int i = 0; i < instanceCount; i++) { |
const Geometry& args = fGeoData[i]; |
this->generateAAFillRectGeometry(vertices, |
@@ -445,13 +450,18 @@ void GrAARectRenderer::geometryFillAARect(GrDrawTarget* target, |
const SkMatrix& viewMatrix, |
const SkRect& rect, |
const SkRect& devRect) { |
- if (NULL == fAAFillRectIndexBuffer) { |
+ if (!fAAFillRectIndexBuffer) { |
fAAFillRectIndexBuffer = fGpu->createInstancedIndexBuffer(gFillAARectIdx, |
kIndicesPerAAFillRect, |
kNumAAFillRectsInIndexBuffer, |
kVertsPerAAFillRect); |
} |
+ if (!fAAFillRectIndexBuffer) { |
+ SkDebugf("Unable to create index buffer\n"); |
+ return; |
+ } |
+ |
AAFillRectBatch::Geometry geometry; |
geometry.fRect = rect; |
geometry.fViewMatrix = viewMatrix; |
@@ -623,6 +633,11 @@ public: |
&vertexBuffer, |
&firstVertex); |
+ if (!vertices) { |
+ SkDebugf("Could not allocate vertices\n"); |
+ return; |
+ } |
+ |
for (int i = 0; i < instanceCount; i++) { |
const Geometry& args = fGeoData[i]; |
this->generateAAStrokeRectGeometry(vertices, |
@@ -846,7 +861,7 @@ void GrAARectRenderer::geometryStrokeAARect(GrDrawTarget* target, |
const SkRect& devInside, |
bool miterStroke) { |
GrIndexBuffer* indexBuffer = this->aaStrokeRectIndexBuffer(miterStroke); |
- if (NULL == indexBuffer) { |
+ if (!indexBuffer) { |
SkDebugf("Failed to create index buffer!\n"); |
return; |
} |