Chromium Code Reviews| Index: src/gpu/GrDrawTarget.cpp |
| diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
| index 0db31f29de983f5b9adbe48a1f819b63ea255f46..0af773735660bd2ae3ea1901ed738a397138695c 100644 |
| --- a/src/gpu/GrDrawTarget.cpp |
| +++ b/src/gpu/GrDrawTarget.cpp |
| @@ -255,7 +255,9 @@ 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())) { |
| + return; |
|
Chris Dalton
2016/05/13 16:56:55
Do we want to fail silently or print a debug messa
bsalomon
2016/05/13 17:43:01
It's probably a good idea to print here for now. W
Chris Dalton
2016/05/13 18:03:08
Done.
|
| + } |
| } |
| batch->getPipelineOptimizations(&args.fOpts); |
| GrScissorState finalScissor; |
| @@ -330,6 +332,9 @@ void GrDrawTarget::stencilPath(const GrPipelineBuilder& pipelineBuilder, |
| GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
| GrStencilAttachment* stencilAttachment = fResourceProvider->attachStencilAttachment(rt); |
| + if (!stencilAttachment) { |
| + return; |
| + } |
| GrBatch* batch = GrStencilPathBatch::Create(viewMatrix, |
| pipelineBuilder.isHWAntialias(), |