bug 901084 - remove deprecated GLContext extension group queries. - r=bjacob
authorGuillaume Abadie <gabadie@mozilla.com>
Fri, 02 Aug 2013 21:13:46 -0400
changeset 141236 353c951a48d6b44619b223c771e9bd998564ff82
parent 141235 2fe371042c60ada23141447a10e4b180401d9e42
child 141237 ada4c3b6223326dce9bb7eca32ef0a93ebb32b81
push id32028
push usergabadie@mozilla.com
push dateSat, 03 Aug 2013 01:14:04 +0000
treeherdermozilla-inbound@353c951a48d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs901084
milestone25.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 901084 - remove deprecated GLContext extension group queries. - r=bjacob
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/GLScreenBuffer.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -489,17 +489,16 @@ GLContext::InitWithPrefix(const char *pr
 
                 MarkExtensionGroupUnsupported(XXX_framebuffer_blit);
                 mSymbols.fBlitFramebuffer = nullptr;
             }
         }
 
         if (IsExtensionSupported(XXX_framebuffer_multisample))
         {
-            MOZ_ASSERT(SupportsSplitFramebuffer());
             SymLoadStruct auxSymbols[] = {
                 {
                     (PRFuncPtr*) &mSymbols.fRenderbufferStorageMultisample,
                     {
                         "RenderbufferStorageMultisample",
                         "RenderbufferStorageMultisampleEXT",
                         "RenderbufferStorageMultisampleANGLE",
                         nullptr
@@ -693,17 +692,17 @@ GLContext::InitWithPrefix(const char *pr
             mMaxCubeMapTextureSize = std::min(mMaxCubeMapTextureSize, 2048);
             mNeedsTextureSizeChecks = true;
         }
 #endif
 
         mMaxTextureImageSize = mMaxTextureSize;
 
         mMaxSamples = 0;
-        if (SupportsFramebufferMultisample()) {
+        if (IsExtensionSupported(XXX_framebuffer_multisample)) {
             fGetIntegerv(LOCAL_GL_MAX_SAMPLES, (GLint*)&mMaxSamples);
         }
 
         // We're ready for final setup.
         fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
 
         if (mCaps.any)
             DetermineCaps();
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -498,33 +498,16 @@ private:
      *
      * Returns false if marking this extension group as unsupported contradicts
      * the OpenGL version and profile. Returns true otherwise.
      */
     bool MarkExtensionGroupUnsupported(GLExtensionGroup extensionGroup);
 
 
 // -----------------------------------------------------------------------------
-// Deprecated extension group queries (use XXX_* instead)
-public:
-
-    bool SupportsFramebufferMultisample() const {
-        return IsExtensionSupported(XXX_framebuffer_multisample);
-    }
-
-    bool HasExt_FramebufferBlit() const {
-        return IsExtensionSupported(XXX_framebuffer_blit);
-    }
-
-    bool SupportsSplitFramebuffer() const {
-        return IsExtensionSupported(XXX_framebuffer_blit);
-    }
-
-
-// -----------------------------------------------------------------------------
 // Robustness handling
 public:
 
     bool HasRobustness() {
         return mHasRobustness;
     }
 
     /**
@@ -2563,18 +2546,19 @@ public:
         GetUIntegerv(LOCAL_GL_DRAW_FRAMEBUFFER_BINDING_EXT, &ret);
         return ret;
     }
 
     GLuint GetReadFB() {
         if (mScreen)
             return mScreen->GetReadFB();
 
-        GLenum bindEnum = SupportsSplitFramebuffer() ? LOCAL_GL_READ_FRAMEBUFFER_BINDING_EXT
-                                                     : LOCAL_GL_FRAMEBUFFER_BINDING;
+        GLenum bindEnum = IsExtensionSupported(XXX_framebuffer_blit)
+                            ? LOCAL_GL_READ_FRAMEBUFFER_BINDING_EXT
+                            : LOCAL_GL_FRAMEBUFFER_BINDING;
 
         GLuint ret = 0;
         GetUIntegerv(bindEnum, &ret);
         return ret;
     }
 
     GLuint GetFB() {
         if (mScreen) {
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -24,17 +24,17 @@ namespace mozilla {
 namespace gl {
 
 GLScreenBuffer*
 GLScreenBuffer::Create(GLContext* gl,
                      const gfxIntSize& size,
                      const SurfaceCaps& caps)
 {
     if (caps.antialias &&
-        !gl->SupportsFramebufferMultisample())
+        !gl->IsExtensionSupported(GLContext::XXX_framebuffer_multisample))
     {
         return nullptr;
     }
 
     SurfaceFactory_GL* factory = nullptr;
 
 #ifdef MOZ_WIDGET_GONK
     /* On B2G, we want a Gralloc factory, and we want one right at the start */
@@ -74,37 +74,37 @@ GLScreenBuffer::~GLScreenBuffer()
 
 
 void
 GLScreenBuffer::BindAsFramebuffer(GLContext* const gl, GLenum target) const
 {
     GLuint drawFB = DrawFB();
     GLuint readFB = ReadFB();
 
-    if (!gl->HasExt_FramebufferBlit()) {
+    if (!gl->IsExtensionSupported(GLContext::XXX_framebuffer_blit)) {
         MOZ_ASSERT(drawFB == readFB);
         gl->raw_fBindFramebuffer(target, readFB);
         return;
     }
 
     switch (target) {
     case LOCAL_GL_FRAMEBUFFER:
         gl->raw_fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER_EXT, drawFB);
         gl->raw_fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER_EXT, readFB);
         break;
 
     case LOCAL_GL_DRAW_FRAMEBUFFER_EXT:
-        if (!gl->HasExt_FramebufferBlit())
+        if (!gl->IsExtensionSupported(GLContext::XXX_framebuffer_blit))
             NS_WARNING("DRAW_FRAMEBUFFER requested but unavailable.");
 
         gl->raw_fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER_EXT, drawFB);
         break;
 
     case LOCAL_GL_READ_FRAMEBUFFER_EXT:
-        if (!gl->HasExt_FramebufferBlit())
+        if (!gl->IsExtensionSupported(GLContext::XXX_framebuffer_blit))
             NS_WARNING("READ_FRAMEBUFFER requested but unavailable.");
 
         gl->raw_fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER_EXT, readFB);
         break;
 
     default:
         MOZ_CRASH("Bad `target` for BindFramebuffer.");
     }
@@ -119,31 +119,31 @@ GLScreenBuffer::BindFB(GLuint fb)
     mUserDrawFB = fb;
     mUserReadFB = fb;
     mInternalDrawFB = (fb == 0) ? drawFB : fb;
     mInternalReadFB = (fb == 0) ? readFB : fb;
 
     if (mInternalDrawFB == mInternalReadFB) {
         mGL->raw_fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mInternalDrawFB);
     } else {
-        MOZ_ASSERT(mGL->SupportsSplitFramebuffer());
+        MOZ_ASSERT(mGL->IsExtensionSupported(GLContext::XXX_framebuffer_blit));
         mGL->raw_fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER_EXT, mInternalDrawFB);
         mGL->raw_fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER_EXT, mInternalReadFB);
     }
 
 #ifdef DEBUG
     mInInternalMode_DrawFB = false;
     mInInternalMode_ReadFB = false;
 #endif
 }
 
 void
 GLScreenBuffer::BindDrawFB(GLuint fb)
 {
-    if (!mGL->SupportsSplitFramebuffer()) {
+    if (!mGL->IsExtensionSupported(GLContext::XXX_framebuffer_blit)) {
         NS_WARNING("DRAW_FRAMEBUFFER requested, but unsupported.");
 
         mGL->raw_fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER_EXT, fb);
     } else {
         GLuint drawFB = DrawFB();
         mUserDrawFB = fb;
         mInternalDrawFB = (fb == 0) ? drawFB : fb;
 
@@ -153,17 +153,17 @@ GLScreenBuffer::BindDrawFB(GLuint fb)
 #ifdef DEBUG
     mInInternalMode_DrawFB = false;
 #endif
 }
 
 void
 GLScreenBuffer::BindReadFB(GLuint fb)
 {
-    if (!mGL->SupportsSplitFramebuffer()) {
+    if (!mGL->IsExtensionSupported(GLContext::XXX_framebuffer_blit)) {
         NS_WARNING("READ_FRAMEBUFFER requested, but unsupported.");
 
         mGL->raw_fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER_EXT, fb);
     } else {
         GLuint readFB = ReadFB();
         mUserReadFB = fb;
         mInternalReadFB = (fb == 0) ? readFB : fb;
 
@@ -228,17 +228,17 @@ GLScreenBuffer::GetReadFB() const
 {
 #ifdef DEBUG
     MOZ_ASSERT(mGL->IsCurrent());
     MOZ_ASSERT(!mInInternalMode_ReadFB);
 
     // We use raw_ here because this is debug code and we need to see what
     // the driver thinks.
     GLuint actual = 0;
-    if (mGL->SupportsSplitFramebuffer())
+    if (mGL->IsExtensionSupported(GLContext::XXX_framebuffer_blit))
         mGL->raw_fGetIntegerv(LOCAL_GL_READ_FRAMEBUFFER_BINDING_EXT, (GLint*)&actual);
     else
         mGL->raw_fGetIntegerv(LOCAL_GL_FRAMEBUFFER_BINDING, (GLint*)&actual);
 
     GLuint predicted = mInternalReadFB;
     if (predicted != actual) {
         printf_stderr("Misprediction: Bound read FB predicted: %d. Was: %d.\n",
                       predicted, actual);