Bug 1143979 - Use RAII local instead of useless temporary. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2015-03-16 19:38:06 -07:00
parent 284019a956
commit 5e28351c78
2 changed files with 6 additions and 4 deletions

View File

@ -179,6 +179,8 @@ void
WebGLRenderbuffer::RenderbufferStorage(GLsizei samples, GLenum internalFormat, WebGLRenderbuffer::RenderbufferStorage(GLsizei samples, GLenum internalFormat,
GLsizei width, GLsizei height) const GLsizei width, GLsizei height) const
{ {
MOZ_ASSERT(mContext->mBoundRenderbuffer == this);
gl::GLContext* gl = mContext->gl; gl::GLContext* gl = mContext->gl;
MOZ_ASSERT(samples >= 0 && samples <= 256); // Sanity check. MOZ_ASSERT(samples >= 0 && samples <= 256); // Sanity check.

View File

@ -599,10 +599,10 @@ ClearWithTempFB(WebGLContext* webgl, GLuint tex,
gl::ScopedRenderbuffer rb(gl); gl::ScopedRenderbuffer rb(gl);
{ {
gl::ScopedBindRenderbuffer(gl, rb.RB()); // Only GLES guarantees RGBA4.
gl->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, GLenum format = gl->IsGLES() ? LOCAL_GL_RGBA4 : LOCAL_GL_RGBA8;
LOCAL_GL_RGBA4, gl::ScopedBindRenderbuffer rbBinding(gl, rb.RB());
width, height); gl->fRenderbufferStorage(LOCAL_GL_RENDERBUFFER, format, width, height);
} }
gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0, gl->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0,