aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-09 15:30:41 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-09 15:30:41 +0000
commita44f7003e5f9d1353bc9274268fb5302e69fc94a (patch)
tree472bd5a0a4fab051f9ee2f9c812192d6694d4343 /gpu
parent47ae725dbd03cecba737d6445a7faa3241135728 (diff)
Fix some ref leaks
Review URL: http://codereview.appspot.com/4837068/ git-svn-id: http://skia.googlecode.com/svn/trunk@2082 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu')
-rw-r--r--gpu/src/GrGpuGL.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 620a89597e..692df0eef7 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -598,7 +598,7 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType;
GrGLRenderTarget::Desc rtDesc;
- GrGLStencilBuffer* sb = NULL;
+ SkAutoTUnref<GrGLStencilBuffer> sb;
if (isRenderTarget) {
rtDesc.fRTFBOID = desc.fPlatformRenderTarget;
@@ -638,8 +638,8 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
format.fPacked = false;
format.fStencilBits = desc.fStencilBits;
format.fTotalBits = desc.fStencilBits;
- sb = new GrGLStencilBuffer(this, 0, desc.fWidth,
- desc.fHeight, rtDesc.fSampleCnt, format);
+ sb.reset(new GrGLStencilBuffer(this, 0, desc.fWidth, desc.fHeight,
+ rtDesc.fSampleCnt, format));
}
rtDesc.fOwnIDs = false;
}
@@ -667,7 +667,7 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
params.invalidate(); // rather than do glGets.
if (isRenderTarget) {
GrTexture* tex = new GrGLTexture(this, texDesc, rtDesc, params);
- tex->asRenderTarget()->setStencilBuffer(sb);
+ tex->asRenderTarget()->setStencilBuffer(sb.get());
return tex;
} else {
return new GrGLTexture(this, texDesc, params);
@@ -680,7 +680,7 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
viewport.fHeight = desc.fHeight;
GrGLRenderTarget* rt = new GrGLRenderTarget(this, rtDesc, viewport);
- rt->setStencilBuffer(sb);
+ rt->setStencilBuffer(sb.get());
return rt;
}
}
@@ -839,7 +839,7 @@ GrRenderTarget* GrGpuGL::onCreateRenderTargetFrom3DApiState() {
int stencilBits = get_fbo_stencil_bits(arbFBO);
GR_GL_GetIntegerv(GR_GL_SAMPLES, &rtDesc.fSampleCnt);
- GrGLStencilBuffer* sb = NULL;
+ SkAutoTUnref<GrGLStencilBuffer> sb;
if (stencilBits) {
GrGLStencilBuffer::Format format;
// we could query this but we don't really need it
@@ -847,9 +847,9 @@ GrRenderTarget* GrGpuGL::onCreateRenderTargetFrom3DApiState() {
format.fPacked = false;
format.fStencilBits = stencilBits;
format.fTotalBits = stencilBits;
- sb = new GrGLStencilBuffer(this, 0, viewport.fWidth,
- viewport.fHeight, rtDesc.fSampleCnt,
- format);
+ sb.reset(new GrGLStencilBuffer(this, 0, viewport.fWidth,
+ viewport.fHeight, rtDesc.fSampleCnt,
+ format));
}
GrGLenum fmat = get_fbo_color_format();
@@ -865,7 +865,7 @@ GrRenderTarget* GrGpuGL::onCreateRenderTargetFrom3DApiState() {
rtDesc.fOwnIDs = false;
GrGLRenderTarget* target = new GrGLRenderTarget(this, rtDesc, viewport);
- target->setStencilBuffer(sb);
+ target->setStencilBuffer(sb.get());
return target;
}