Bug 765989 - Add fail on warnings to some gfx directories r=benwa
authorDavid Zbarsky <dzbarsky@gmail.com>
Tue, 19 Jun 2012 21:12:30 -0700
changeset 97092 c0ee88e6ac051c2f2842c2121bbffdeb17af3c7c
parent 97091 e022416669a12a8a174c94add331d79a104ea17d
child 97093 19ae28cad1daedafa86094d9dfd4424edd237909
push id10866
push userdzbarsky@gmail.com
push dateWed, 20 Jun 2012 04:12:37 +0000
treeherdermozilla-inbound@c0ee88e6ac05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenwa
bugs765989
milestone16.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 765989 - Add fail on warnings to some gfx directories r=benwa
gfx/gl/GLContext.cpp
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/Makefile.in
gfx/src/Makefile.in
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2366,17 +2366,17 @@ static GLint GetAddressAlignment(ptrdiff
 void
 GLContext::TexImage2D(GLenum target, GLint level, GLint internalformat,
                       GLsizei width, GLsizei height, GLsizei stride,
                       GLint pixelsize, GLint border, GLenum format,
                       GLenum type, const GLvoid *pixels)
 {
     if (mIsGLES2) {
 
-        NS_ASSERTION(format == internalformat,
+        NS_ASSERTION(format == (GLenum)internalformat,
                     "format and internalformat not the same for glTexImage2D on GLES2");
 
         if (!CanUploadNonPowerOfTwo()
             && (stride != width * pixelsize
             || !IsPowerOfTwo(width)
             || !IsPowerOfTwo(height))) {
 
             // Pad out texture width and height to the next power of two
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -139,18 +139,21 @@ static GLLibraryEGL sEGLLibrary;
     (_array).AppendElement(_k);                 \
     (_array).AppendElement(_v);                 \
 } while (0)
 
 #define ADD_ATTR_1(_array, _k) do {             \
     (_array).AppendElement(_k);                 \
 } while (0)
 
+#ifndef MOZ_JAVA_COMPOSITOR
 static EGLSurface
 CreateSurfaceForWindow(nsIWidget *aWidget, EGLConfig config);
+#endif
+
 static bool
 CreateConfig(EGLConfig* aConfig);
 #ifdef MOZ_X11
 
 #ifdef MOZ_EGL_XRENDER_COMPOSITE
 static EGLSurface
 CreateBasicEGLSurfaceForXSurface(gfxASurface* aSurface, EGLConfig* aConfig);
 #endif
@@ -807,20 +810,20 @@ public:
                     const nsIntSize& aSize,
                     GLenum aWrapMode,
                     ContentType aContentType,
                     GLContext* aContext,
                     TextureImage::Flags aFlags = TextureImage::NoFlags)
         : TextureImage(aSize, aWrapMode, aContentType, aFlags)
         , mGLContext(aContext)
         , mUpdateFormat(gfxASurface::ImageFormatUnknown)
+        , mEGLImage(nsnull)
+        , mTexture(aTexture)
         , mSurface(nsnull)
         , mConfig(nsnull)
-        , mTexture(aTexture)
-        , mEGLImage(nsnull)
         , mTextureState(Created)
         , mBound(false)
         , mIsLocked(false)
     {
         mUpdateFormat = gfxPlatform::GetPlatform()->OptimalFormatForContent(GetContentType());
 
         if (gUseBackingSurface) {
 #ifdef MOZ_WIDGET_GONK
@@ -1563,24 +1566,22 @@ CreateConfig(EGLConfig* aConfig)
         }
 #endif
         return false;
     } else {
         return true;
     }
 }
 
+// When MOZ_JAVA_COMPOSITOR is defined,
+// use mozilla::AndroidBridge::Bridge()->ProvideEGLSurface() instead.
+#ifndef MOZ_JAVA_COMPOSITOR
 static EGLSurface
 CreateSurfaceForWindow(nsIWidget *aWidget, EGLConfig config)
 {
-#ifdef MOZ_JAVA_COMPOSITOR
-    // Use mozilla::AndroidBridge::Bridge()->ProvideEGLSurface() instead.
-    NS_RUNTIMEABORT("CreateSurfaceForWindow should not be called on Native Fennec.");
-#endif
-
     EGLSurface surface;
 
 #ifdef DEBUG
     sEGLLibrary.DumpEGLConfig(config);
 #endif
 
 #if defined(MOZ_WIDGET_ANDROID)
 
@@ -1605,16 +1606,17 @@ CreateSurfaceForWindow(nsIWidget *aWidge
     gScreenBounds.x = 0;
     gScreenBounds.y = 0;
     sEGLLibrary.fQuerySurface(EGL_DISPLAY(), surface, LOCAL_EGL_WIDTH, &gScreenBounds.width);
     sEGLLibrary.fQuerySurface(EGL_DISPLAY(), surface, LOCAL_EGL_HEIGHT, &gScreenBounds.height);
 #endif
 
     return surface;
 }
+#endif
 
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateForWindow(nsIWidget *aWidget)
 {
     EGLConfig config;
 
     if (!sEGLLibrary.EnsureInitialized()) {
         return nsnull;
--- a/gfx/gl/Makefile.in
+++ b/gfx/gl/Makefile.in
@@ -8,16 +8,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= gl
 LIBRARY_NAME	= gl
 LIBXUL_LIBRARY	= 1
 EXPORT_LIBRARY	= 1
+FAIL_ON_WARNINGS = 1
 
 EXPORTS	= \
 	GLDefs.h \
 	GLContext.h \
 	GLContextSymbols.h \
 	GLContextProvider.h \
 	GLContextProviderImpl.h \
 	GLLibraryLoader.h \
--- a/gfx/src/Makefile.in
+++ b/gfx/src/Makefile.in
@@ -12,16 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE         = gfx
 MODULE_NAME    = nsGfxModule
 LIBRARY_NAME   = gkgfx
 EXPORT_LIBRARY = 1
 GRE_MODULE     = 1
 LIBXUL_LIBRARY = 1
 IS_COMPONENT   = 1
+FAIL_ON_WARNINGS = 1
 
 XPIDLSRCS = \
 	nsIFontEnumerator.idl \
 	nsIScriptableRegion.idl \
 	$(NULL)
 
 EXPORTS	= \
 	gfxCore.h \