Backed out changeset 57d368003eb8
authorDão Gottwald <dao@mozilla.com>
Tue, 20 Mar 2012 13:13:24 +0100
changeset 93142 31d8f455bfa95ee0d962c9131bd1441abf17de25
parent 93138 57d368003eb8d6fd4e2ac35fe1e98174a560fbca
child 93143 43cc4d6d160abcaf9cb62a6025b9983ca705f298
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone14.0a1
backs out57d368003eb8d6fd4e2ac35fe1e98174a560fbca
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
Backed out changeset 57d368003eb8
gfx/gl/GLContext.h
gfx/gl/GLContextProviderCGL.mm
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/GLContextProviderGLX.cpp
gfx/gl/GLContextProviderImpl.h
gfx/gl/GLContextProviderNull.cpp
gfx/gl/GLContextProviderOSMesa.cpp
gfx/gl/GLContextProviderWGL.cpp
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -566,21 +566,16 @@ public:
             while (tip->mSharedContext)
                 tip = tip->mSharedContext;
             tip->SharedContextDestroyed(this);
             tip->ReportOutstandingNames();
         }
 #endif
     }
 
-    enum ContextFlags {
-        ContextFlagsNone = 0x0,
-        ContextFlagsGlobal = 0x1
-    };
-
     enum GLContextType {
         ContextTypeUnknown,
         ContextTypeWGL,
         ContextTypeCGL,
         ContextTypeGLX,
         ContextTypeEGL,
         ContextTypeOSMesa
     };
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -585,18 +585,17 @@ CreateOffscreenFBOContext(const ContextF
 
     nsRefPtr<GLContextCGL> glContext = new GLContextCGL(aFormat, shareContext, context, true);
 
     return glContext.forget();
 }
 
 already_AddRefed<GLContext>
 GLContextProviderCGL::CreateOffscreen(const gfxIntSize& aSize,
-                                      const ContextFormat& aFormat,
-                                      const ContextFlags flags)
+                                      const ContextFormat& aFormat)
 {
     ContextFormat actualFormat(aFormat);
 
     nsRefPtr<GLContextCGL> glContext;
     
     NS_ENSURE_TRUE(Preferences::GetRootBranch(), nsnull);
     const bool preferFBOs = Preferences::GetBool("cgl.prefer-fbo", true);
     if (!preferFBOs)
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -1893,18 +1893,17 @@ GLContextEGL::CreateEGLPixmapOffscreenCo
 }
 
 // Under EGL, if we're under X11, then we have to create a Pixmap
 // because Maemo's EGL implementation doesn't support pbuffers at all
 // for some reason.  On Android, pbuffers are supported fine, though
 // often without the ability to texture from them directly.
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateOffscreen(const gfxIntSize& aSize,
-                                      const ContextFormat& aFormat,
-                                      const ContextFlags aFlags)
+                                      const ContextFormat& aFormat)
 {
     if (!sEGLLibrary.EnsureInitialized()) {
         return nsnull;
     }
 
 #if defined(ANDROID) || defined(XP_WIN)
     bool usePBuffers = false; // Generally, prefer FBOs to PBuffers
 
@@ -1914,40 +1913,40 @@ GLContextProviderEGL::CreateOffscreen(co
     gfxIntSize pbufferSize = usePBuffers ? aSize : gfxIntSize(16, 16);
     nsRefPtr<GLContextEGL> glContext =
         GLContextEGL::CreateEGLPBufferOffscreenContext(pbufferSize, aFormat, !usePBuffers);
 
     if (!glContext)
         return nsnull;
 
     gfxIntSize fboSize = usePBuffers ? glContext->OffscreenActualSize() : aSize;
-    if (!(aFlags & ContextFlagsGlobal) && !glContext->ResizeOffscreenFBO(fboSize, !usePBuffers))
+    if (!glContext->ResizeOffscreenFBO(fboSize, !usePBuffers))
         return nsnull;
 
     return glContext.forget();
 #elif defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
     nsRefPtr<GLContextEGL> glContext =
         GLContextEGL::CreateBasicEGLPixmapOffscreenContext(aSize, aFormat);
 
     if (!glContext)
         return nsnull;
 
-    if (!(aFlags & ContextFlagsGlobal) && !glContext->ResizeOffscreenFBO(glContext->OffscreenActualSize(), true))
+    if (!glContext->ResizeOffscreenFBO(glContext->OffscreenActualSize(), true))
         return nsnull;
 
     return glContext.forget();
 #elif defined(MOZ_X11)
     nsRefPtr<GLContextEGL> glContext =
         GLContextEGL::CreateEGLPixmapOffscreenContext(aSize, aFormat, true);
 
     if (!glContext) {
         return nsnull;
     }
 
-    if (!(aFlags & ContextFlagsGlobal) && !gUseBackingSurface && !glContext->ResizeOffscreenFBO(glContext->OffscreenActualSize(), true)) {
+    if (!gUseBackingSurface && !glContext->ResizeOffscreenFBO(glContext->OffscreenActualSize(), true)) {
         // we weren't able to create the initial
         // offscreen FBO, so this is dead
         return nsnull;
     }
     return glContext.forget();
 #else
     return nsnull;
 #endif
@@ -1996,18 +1995,17 @@ GLContextProviderEGL::GetGlobalContext()
 {
     static bool triedToCreateContext = false;
     if (!triedToCreateContext && !gGlobalContext) {
         triedToCreateContext = true;
         // Don't assign directly to gGlobalContext here, because
         // CreateOffscreen can call us re-entrantly.
         nsRefPtr<GLContext> ctx =
             GLContextProviderEGL::CreateOffscreen(gfxIntSize(16, 16),
-                                                  ContextFormat(ContextFormat::BasicRGB24),
-                                                  GLContext::ContextFlagsGlobal);
+                                                  ContextFormat(ContextFormat::BasicRGB24));
         gGlobalContext = ctx;
         if (gGlobalContext)
             gGlobalContext->SetIsGlobalSharedContext(true);
     }
 
     return gGlobalContext;
 }
 
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -1287,18 +1287,17 @@ DONE_CREATING_PIXMAP:
                         xsurface);
     }
 
     return glContext.forget();
 }
 
 already_AddRefed<GLContext>
 GLContextProviderGLX::CreateOffscreen(const gfxIntSize& aSize,
-                                      const ContextFormat& aFormat,
-                                      const ContextFlags)
+                                      const ContextFormat& aFormat)
 {
     nsRefPtr<GLContextGLX> glContext =
         CreateOffscreenPixmapContext(aSize, aFormat, true);
 
     if (!glContext) {
         return nsnull;
     }
 
--- a/gfx/gl/GLContextProviderImpl.h
+++ b/gfx/gl/GLContextProviderImpl.h
@@ -40,17 +40,16 @@
 
 #ifndef GL_CONTEXT_PROVIDER_NAME
 #error GL_CONTEXT_PROVIDER_NAME not defined
 #endif
 
 class THEBES_API GL_CONTEXT_PROVIDER_NAME
 {
 public:
-    typedef GLContext::ContextFlags ContextFlags;
     /**
      * Create a context that renders to the surface of the widget that is
      * passed in.  The context is always created with an RGB pixel format,
      * with no alpha, depth or stencil.  If any of those features are needed,
      * either use a framebuffer, or use CreateOffscreen.
      *
      * This context will attempt to share resources with all other window
      * contexts.  As such, it's critical that resources allocated that are not
@@ -86,18 +85,17 @@ public:
      *
      * @param aSize The initial size of this offscreen context.
      * @param aFormat The ContextFormat for this offscreen context.
      *
      * @return Context to use for offscreen rendering
      */
     static already_AddRefed<GLContext>
     CreateOffscreen(const gfxIntSize& aSize,
-                    const ContextFormat& aFormat = ContextFormat::BasicRGBA32Format,
-                    const ContextFlags aFlags = GLContext::ContextFlagsNone);
+                    const ContextFormat& aFormat = ContextFormat::BasicRGBA32Format);
 
     /**
      * Try to create a GL context from native surface for arbitrary gfxASurface
      * If surface not compatible this will return NULL
      *
      * @param aSurface surface to create a context for
      *
      * @return Context to use for this surface
--- a/gfx/gl/GLContextProviderNull.cpp
+++ b/gfx/gl/GLContextProviderNull.cpp
@@ -41,18 +41,17 @@ namespace gl {
 already_AddRefed<GLContext>
 GLContextProviderNull::CreateForWindow(nsIWidget*)
 {
     return nsnull;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderNull::CreateOffscreen(const gfxIntSize&,
-                                       const ContextFormat&,
-                                       const ContextFlags)
+                                       const ContextFormat&)
 {
     return nsnull;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderNull::CreateForNativePixmapSurface(gfxASurface *)
 {
     return nsnull;
--- a/gfx/gl/GLContextProviderOSMesa.cpp
+++ b/gfx/gl/GLContextProviderOSMesa.cpp
@@ -254,18 +254,17 @@ private:
 already_AddRefed<GLContext>
 GLContextProviderOSMesa::CreateForWindow(nsIWidget *aWidget)
 {
     return nsnull;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderOSMesa::CreateOffscreen(const gfxIntSize& aSize,
-                                         const ContextFormat& aFormat,
-                                         const ContextFlags)
+                                         const ContextFormat& aFormat)
 {
     if (!sOSMesaLibrary.EnsureInitialized()) {
         return nsnull;
     }
 
     ContextFormat actualFormat(aFormat);
     actualFormat.samples = 0;
 
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -746,18 +746,17 @@ CreateWindowOffscreenContext(const Conte
     nsRefPtr<GLContextWGL> glContext = new GLContextWGL(aFormat, shareContext,
                                                         dc, context, win, true);
 
     return glContext.forget();
 }
 
 already_AddRefed<GLContext>
 GLContextProviderWGL::CreateOffscreen(const gfxIntSize& aSize,
-                                      const ContextFormat& aFormat,
-                                      const ContextFlags)
+                                      const ContextFormat& aFormat)
 {
     if (!sWGLLibrary.EnsureInitialized()) {
         return nsnull;
     }
 
     nsRefPtr<GLContextWGL> glContext;
 
     // Always try to create a pbuffer context first, because we