diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-19 14:36:31 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-19 14:36:31 +0000 |
commit | 8e2999fd24120251678ff3aefd28e00f0b4dc417 (patch) | |
tree | ce21b7b83e50d42a26e506281d190ed01a2c3c82 | |
parent | 56f233ab54d228f3ce05d0f7e15996424f9d5dd2 (diff) |
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
-rw-r--r-- | src/gpu/GrRenderTarget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp index 0d36fd0319..5630d58297 100644 --- a/src/gpu/GrRenderTarget.cpp +++ b/src/gpu/GrRenderTarget.cpp @@ -95,6 +95,10 @@ void GrRenderTarget::overrideResolveRect(const GrIRect rect) { } void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) { + if (stencilBuffer == fStencilBuffer) { + return; + } + if (NULL != fStencilBuffer) { fStencilBuffer->unref(); |