Bug 665622 - Fix unused variable warnings in GLContext.cpp & GLContextProviderEGL.cpp; r=joedrew
authorEd Morley <bmo@edmorley.co.uk>
Thu, 23 Jun 2011 19:01:17 -0700
changeset 71925 093d1650e7a77030979d759fe941df837868300f
parent 71924 8e180685b9f321b3334cec0008fb7800ecac653d
child 71926 dac5cae65da3bda932a3c78b9b40cf00364d10c1
push id209
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:42:16 +0000
treeherdermozilla-aurora@cc6e30cce8af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoedrew
bugs665622
milestone7.0a1
Bug 665622 - Fix unused variable warnings in GLContext.cpp & GLContextProviderEGL.cpp; r=joedrew
gfx/thebes/GLContext.cpp
gfx/thebes/GLContextProviderEGL.cpp
--- a/gfx/thebes/GLContext.cpp
+++ b/gfx/thebes/GLContext.cpp
@@ -48,16 +48,18 @@
 #include "nsThreadUtils.h"
 
 #include "gfxPlatform.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
 
 #include "gfxCrashReporterUtils.h"
 
+#include "mozilla/Util.h" // for DebugOnly
+
 namespace mozilla {
 namespace gl {
 
 #ifdef DEBUG
 // see comment near declaration in GLContext.h. Should be thread-local.
 GLContext* GLContext::sCurrentGLContext = nsnull;
 #endif
 
@@ -1772,17 +1774,17 @@ GLContext::SetBlitFramebufferForDestText
     fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mBlitFramebuffer);
     fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
                           LOCAL_GL_COLOR_ATTACHMENT0,
                           LOCAL_GL_TEXTURE_2D,
                           aTexture,
                           0);
 
     if (aTexture) {
-        GLenum status = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
+        DebugOnly<GLenum> status = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
 
         // Note: if you are hitting this assertion, it is likely that
         // your texture is not texture complete -- that is, you
         // allocated a texture name, but didn't actually define its
         // size via a call to TexImage2D.
         NS_ASSERTION(status == LOCAL_GL_FRAMEBUFFER_COMPLETE, "Framebuffer not complete!");
     }
 }
--- a/gfx/thebes/GLContextProviderEGL.cpp
+++ b/gfx/thebes/GLContextProviderEGL.cpp
@@ -1762,17 +1762,16 @@ GetVendor()
     }
 
     return reinterpret_cast<const char*>(sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_VENDOR));
 }
 
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateForWindow(nsIWidget *aWidget)
 {
-    EGLContext context;
     EGLConfig config;
 
     if (!sEGLLibrary.EnsureInitialized()) {
         return nsnull;
     }
 
     config = CreateConfig();
 
@@ -2159,24 +2158,23 @@ ContentTypeToGLFormat(gfxASurface::gfxCo
             break;
     }
     return ContextFormat::BasicRGBA32;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateForNativePixmapSurface(gfxASurface* aSurface)
 {
-    EGLSurface surface = nsnull;
-    EGLContext context = nsnull;
-    EGLConfig config = nsnull;
-
     if (!sEGLLibrary.EnsureInitialized())
         return nsnull;
 
 #ifdef MOZ_X11
+    EGLSurface surface = nsnull;
+    EGLConfig config = nsnull;
+
     if (aSurface->GetType() != gfxASurface::SurfaceTypeXlib) {
         // Not implemented
         return nsnull;
     }
 
     surface = CreateEGLSurfaceForXSurface(aSurface, &config);
     if (!config) {
         return nsnull;
@@ -2188,19 +2186,16 @@ GLContextProviderEGL::CreateForNativePix
     nsRefPtr<GLContextEGL> glContext =
         GLContextEGL::CreateGLContext(DepthToGLFormat(xsurface->XRenderFormat()->depth),
                                       surface, config, shareContext, PR_FALSE);
 
     glContext->HoldSurface(aSurface);
 
     return glContext.forget().get();
 #else
-    (void)surface;
-    (void)context;
-
     // Not implemented
     return nsnull;
 #endif
 }
 
 static nsRefPtr<GLContext> gGlobalContext;
 
 GLContext *