Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index 0db31f29de983f5b9adbe48a1f819b63ea255f46..c5fde68a9e3010d0a5cb0a407105c95db73cc19b 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -255,7 +255,10 @@ void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, |
args.fScissor = &appliedClip.scissorState(); |
args.fHasStencilClip = appliedClip.hasStencilClip(); |
if (pipelineBuilder.hasUserStencilSettings() || appliedClip.hasStencilClip()) { |
- fResourceProvider->attachStencilAttachment(pipelineBuilder.getRenderTarget()); |
+ if (!fResourceProvider->attachStencilAttachment(pipelineBuilder.getRenderTarget())) { |
+ SkDebugf("ERROR creating stencil attachment. Draw skipped.\n"); |
+ return; |
+ } |
} |
batch->getPipelineOptimizations(&args.fOpts); |
GrScissorState finalScissor; |
@@ -330,6 +333,10 @@ void GrDrawTarget::stencilPath(const GrPipelineBuilder& pipelineBuilder, |
GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
GrStencilAttachment* stencilAttachment = fResourceProvider->attachStencilAttachment(rt); |
+ if (!stencilAttachment) { |
+ SkDebugf("ERROR creating stencil attachment. Draw skipped.\n"); |
+ return; |
+ } |
GrBatch* batch = GrStencilPathBatch::Create(viewMatrix, |
pipelineBuilder.isHWAntialias(), |