aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 64ee29bde5..ab24c5447f 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -84,10 +84,8 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc,
bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
SkASSERT(NULL == rt->getStencilBuffer());
- GrStencilBuffer* sb =
- this->getContext()->findStencilBuffer(rt->width(),
- rt->height(),
- rt->numSamples());
+ SkAutoTUnref<GrStencilBuffer> sb(
+ this->getContext()->findAndRefStencilBuffer(rt->width(), rt->height(), rt->numSamples()));
if (sb) {
rt->setStencilBuffer(sb);
bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
@@ -96,8 +94,7 @@ bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
}
return attached;
}
- if (this->createStencilBufferForRenderTarget(rt,
- rt->width(), rt->height())) {
+ if (this->createStencilBufferForRenderTarget(rt, rt->width(), rt->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