Protect against unref/ref of stencil buffer.

Over the shoulder review from robertphillips@google.com



git-svn-id: http://skia.googlecode.com/svn/trunk@6476 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2012-11-19 14:36:31 +00:00
parent 56f233ab54
commit 8e2999fd24

View File

@ -95,6 +95,10 @@ void GrRenderTarget::overrideResolveRect(const GrIRect rect) {
}
void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) {
if (stencilBuffer == fStencilBuffer) {
return;
}
if (NULL != fStencilBuffer) {
fStencilBuffer->unref();