Protect against unref/ref of stencil buffer.
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 19 Nov 2012 14:36:31 +0000 (14:36 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 19 Nov 2012 14:36:31 +0000 (14:36 +0000)
Over the shoulder review from robertphillips@google.com

git-svn-id: http://skia.googlecode.com/svn/trunk@6476 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrRenderTarget.cpp

index 0d36fd0..5630d58 100644 (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();