Index: src/gpu/GrGpu.cpp |
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
index 45a58afb4aadc327677162c338cd51c260908bc3..c4b155a2d46598e9d7c05f3eebf546a59080ef25 100644 |
--- a/src/gpu/GrGpu.cpp |
+++ b/src/gpu/GrGpu.cpp |
@@ -98,6 +98,15 @@ bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { |
return false; |
} |
if (this->createStencilBufferForRenderTarget(rt, width, height)) { |
+ // Right now we're clearing the stencil buffer here after it is |
+ // attached to an RT for the first time. When we start matching |
+ // stencil buffers with smaller color targets this will no longer |
+ // be correct because it won't be guaranteed to clear the entire |
+ // sb. |
+ // We used to clear down in the GL subclass using a special purpose |
+ // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported |
+ // FBO status. |
+ this->clearStencil(rt); |
GrStencilBuffer* sb = rt->renderTargetPriv().getStencilBuffer(); |
sb->resourcePriv().setUniqueKey(sbKey); |
return true; |