Index: src/gpu/GrRenderTarget.cpp |
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp |
index 5630d58297ac2419e8134fd443b472683697d478..1cbd5f5e840d5f34d3d973cb7468ae421abb5877 100644 |
--- a/src/gpu/GrRenderTarget.cpp |
+++ b/src/gpu/GrRenderTarget.cpp |
@@ -95,28 +95,7 @@ void GrRenderTarget::overrideResolveRect(const GrIRect rect) { |
} |
void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) { |
- if (stencilBuffer == fStencilBuffer) { |
- return; |
- } |
- |
- if (NULL != fStencilBuffer) { |
- fStencilBuffer->unref(); |
- |
- GrContext* context = this->getContext(); |
- if (NULL != context) { |
- context->purgeCache(); |
- } |
- |
- if (NULL != context) { |
- context->purgeCache(); |
- } |
- } |
- |
- fStencilBuffer = stencilBuffer; |
- |
- if (NULL != fStencilBuffer) { |
- fStencilBuffer->ref(); |
- } |
+ SkRefCnt_SafeAssign(fStencilBuffer, stencilBuffer); |
} |
void GrRenderTarget::onRelease() { |