Bug 830881 - Wrap debug functions in MOZ_ENABLE_GL_TRACKING define. r=vlad
authorDan Glastonbury <dglastonbury@mozilla.com>
Fri, 29 Nov 2013 14:16:40 +1000
changeset 173916 2ec2143596f5dffde851e178848ce583cdc75b73
parent 173915 755b42fa10eb6194ac5625bf19bbc92d65089365
child 173917 38c543386e0aa2380104b095345cd5c971095e3e
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs830881
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 830881 - Wrap debug functions in MOZ_ENABLE_GL_TRACKING define. r=vlad
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2805,18 +2805,17 @@ GLContext::TexSubImage2DWithoutUnpackSub
                     height,
                     format,
                     type,
                     newPixels);
     delete [] newPixels;
     fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 4);
 }
 
-#ifdef DEBUG
-
+#ifdef MOZ_ENABLE_GL_TRACKING
 void
 GLContext::CreatedProgram(GLContext *aOrigin, GLuint aName)
 {
     mTrackedPrograms.AppendElement(NamedResource(aOrigin, aName));
 }
 
 void
 GLContext::CreatedShader(GLContext *aOrigin, GLuint aName)
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -37,16 +37,20 @@
 #include "GLContextTypes.h"
 #include "GLTextureImage.h"
 #include "SurfaceTypes.h"
 #include "GLScreenBuffer.h"
 #include "GLContextSymbols.h"
 #include "mozilla/GenericRefCounted.h"
 #include "mozilla/Scoped.h"
 
+#ifdef DEBUG
+#define MOZ_ENABLE_GL_TRACKING 1
+#endif
+
 class nsIntRegion;
 class nsIRunnable;
 class nsIThread;
 
 namespace android {
     class GraphicBuffer;
 }
 
@@ -578,17 +582,17 @@ private:
 
 // -----------------------------------------------------------------------------
 // MOZ_GL_DEBUG implementation
 private:
 
 #undef BEFORE_GL_CALL
 #undef AFTER_GL_CALL
 
-#ifdef DEBUG
+#ifdef MOZ_ENABLE_GL_TRACKING
 
 #ifndef MOZ_FUNCTION_NAME
 # ifdef __GNUC__
 #  define MOZ_FUNCTION_NAME __PRETTY_FUNCTION__
 # elif defined(_MSC_VER)
 #  define MOZ_FUNCTION_NAME __FUNCTION__
 # else
 #  define MOZ_FUNCTION_NAME __func__  // defined in C99, supported in various C++ compilers. Just raw function name.
@@ -2375,24 +2379,24 @@ protected:
     typedef gfx::SharedSurfaceType SharedSurfaceType;
     typedef gfxImageFormat ImageFormat;
     typedef gfx::SurfaceFormat SurfaceFormat;
 
 public:
 
     virtual bool MakeCurrentImpl(bool aForce = false) = 0;
 
-#ifdef DEBUG
+#ifdef MOZ_ENABLE_GL_TRACKING
     static void StaticInit() {
         PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
     }
 #endif
 
     bool MakeCurrent(bool aForce = false) {
-#ifdef DEBUG
+#ifdef MOZ_ENABLE_GL_TRACKING
     PR_SetThreadPrivate(sCurrentGLContextTLS, this);
 
     // XXX this assertion is disabled because it's triggering on Mac;
     // we need to figure out why and reenable it.
 #if 0
         // IsOwningThreadCurrent is a bit of a misnomer;
         // the "owning thread" is the creation thread,
         // and the only thread that can own this.  We don't
@@ -3237,17 +3241,17 @@ public:
             raw_fViewport(ViewportRect().x, ViewportRect().y,
                           ViewportRect().width, ViewportRect().height);
         }
     }
 
 
 #undef ASSERT_SYMBOL_PRESENT
 
-#ifdef DEBUG
+#ifdef MOZ_ENABLE_GL_TRACKING
     void CreatedProgram(GLContext *aOrigin, GLuint aName);
     void CreatedShader(GLContext *aOrigin, GLuint aName);
     void CreatedBuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void CreatedQueries(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void CreatedTextures(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void CreatedFramebuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void CreatedRenderbuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
     void DeletedProgram(GLContext *aOrigin, GLuint aName);