Index: src/gpu/GrRenderTarget.cpp |
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp |
index c16738e795d8d1698609b5d9c64f2a0a323780f1..4bb01432cec6f0937f4bf9d1f9659917c1f6e832 100644 |
--- a/src/gpu/GrRenderTarget.cpp |
+++ b/src/gpu/GrRenderTarget.cpp |
@@ -69,6 +69,11 @@ void GrRenderTarget::onAbandon() { |
/////////////////////////////////////////////////////////////////////////////// |
bool GrRenderTargetPriv::attachStencilAttachment(GrStencilAttachment* stencil) { |
+ if (!stencil && !fRenderTarget->fStencilAttachment) { |
+ // No need to do any work since we currently don't have a stencil attachment and |
+ // we're not acctually adding one. |
+ return true; |
+ } |
fRenderTarget->fStencilAttachment = stencil; |
if (!fRenderTarget->completeStencilAttachment()) { |
SkSafeSetNull(fRenderTarget->fStencilAttachment); |