Revert "Bug 1197954 - Add support for GLX_SGI_video_sync to GLContextProviderGLX. r=jgilbert"
authorAndrew Comminos <acomminos@mozilla.com>
Thu, 03 Mar 2016 21:39:19 -0800
changeset 323097 7c6642a759eebe9ae74c9cef9f67e55d9477b994
parent 323096 72356b90a5a5e0dbfb179024c6bc0a3359ff7f70
child 323098 33d36bf6ca0c9d9c22cadf6d8223fa6e1418b62c
child 323101 2022afa9aef252c1140990422be98f7c3c9bdd8f
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1197954
milestone47.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
Revert "Bug 1197954 - Add support for GLX_SGI_video_sync to GLContextProviderGLX. r=jgilbert" This reverts commit c26871ee3cac8b736e9b868cd7738900f0d40a81.
gfx/gl/GLContextProviderGLX.cpp
gfx/gl/GLXLibrary.h
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -164,22 +164,16 @@ GLXLibrary::EnsureInitialized()
         { nullptr, { nullptr } }
     };
 
     GLLibraryLoader::SymLoadStruct symbols_createcontext[] = {
         { (PRFuncPtr*) &xCreateContextAttribsInternal, { "glXCreateContextAttribsARB", nullptr } },
         { nullptr, { nullptr } }
     };
 
-    GLLibraryLoader::SymLoadStruct symbols_videosync[] = {
-      { (PRFuncPtr*) &xGetVideoSyncInternal, { "glXGetVideoSyncSGI", nullptr } },
-      { (PRFuncPtr*) &xWaitVideoSyncInternal, { "glXWaitVideoSyncSGI", nullptr } },
-      { nullptr, { nullptr } }
-    };
-
     if (!GLLibraryLoader::LoadSymbols(mOGLLibrary, &symbols[0])) {
         NS_WARNING("Couldn't find required entry point in OpenGL shared library");
         return false;
     }
 
     Display *display = DefaultXDisplay();
     int screen = DefaultScreen(display);
 
@@ -247,23 +241,16 @@ GLXLibrary::EnsureInitialized()
         mHasCreateContextAttribs = true;
     }
 
     if (HasExtension(extensionsStr, "GLX_ARB_create_context_robustness"))
     {
         mHasRobustness = true;
     }
 
-    if (HasExtension(extensionsStr, "GLX_SGI_video_sync") &&
-        GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_videosync,
-                                     (GLLibraryLoader::PlatformLookupFunction)&xGetProcAddress))
-    {
-        mHasVideoSync = true;
-    }
-
     mIsATI = serverVendor && DoesStringMatch(serverVendor, "ATI");
     mIsNVIDIA = serverVendor && DoesStringMatch(serverVendor, "NVIDIA Corporation");
     mClientIsMesa = clientVendor && DoesStringMatch(clientVendor, "Mesa");
 
     mInitialized = true;
 
     return true;
 }
@@ -277,26 +264,16 @@ GLXLibrary::SupportsTextureFromPixmap(gf
 
     if (aSurface->GetType() != gfxSurfaceType::Xlib || !mUseTextureFromPixmap) {
         return false;
     }
 
     return true;
 }
 
-bool
-GLXLibrary::SupportsVideoSync()
-{
-    if (!EnsureInitialized()) {
-        return false;
-    }
-
-    return mHasVideoSync;
-}
-
 GLXPixmap
 GLXLibrary::CreatePixmap(gfxASurface* aSurface)
 {
     if (!SupportsTextureFromPixmap(aSurface)) {
         return None;
     }
 
     gfxXlibSurface *xs = static_cast<gfxXlibSurface*>(aSurface);
@@ -755,34 +732,16 @@ GLXLibrary::xCreateContextAttribs(Displa
                                                       config,
                                                       share_list,
                                                       direct,
                                                       attrib_list);
     AFTER_GLX_CALL;
     return result;
 }
 
-int
-GLXLibrary::xGetVideoSync(unsigned int* count)
-{
-    BEFORE_GLX_CALL;
-    int result = xGetVideoSyncInternal(count);
-    AFTER_GLX_CALL;
-    return result;
-}
-
-int
-GLXLibrary::xWaitVideoSync(int divisor, int remainder, unsigned int* count)
-{
-    BEFORE_GLX_CALL;
-    int result = xWaitVideoSyncInternal(divisor, remainder, count);
-    AFTER_GLX_CALL;
-    return result;
-}
-
 already_AddRefed<GLContextGLX>
 GLContextGLX::CreateGLContext(
                   const SurfaceCaps& caps,
                   GLContextGLX* shareContext,
                   bool isOffscreen,
                   Display* display,
                   GLXDrawable drawable,
                   GLXFBConfig cfg,
--- a/gfx/gl/GLXLibrary.h
+++ b/gfx/gl/GLXLibrary.h
@@ -49,22 +49,19 @@ public:
     , xCreateGLXPixmapWithConfigInternal(nullptr)
     , xDestroyPixmapInternal(nullptr)
     , xQueryVersionInternal(nullptr)
     , xBindTexImageInternal(nullptr)
     , xReleaseTexImageInternal(nullptr)
     , xWaitGLInternal(nullptr)
     , xWaitXInternal(nullptr)
     , xCreateContextAttribsInternal(nullptr)
-    , xGetVideoSyncInternal(nullptr)
-    , xWaitVideoSyncInternal(nullptr)
     , mInitialized(false), mTriedInitializing(false)
     , mUseTextureFromPixmap(false), mDebug(false)
     , mHasRobustness(false), mHasCreateContextAttribs(false)
-    , mHasVideoSync(false)
     , mIsATI(false), mIsNVIDIA(false)
     , mClientIsMesa(false), mGLXMajorVersion(0)
     , mGLXMinorVersion(0)
     , mOGLLibrary(nullptr)
     {}
 
     void xDestroyContext(Display* display, GLXContext context);
     Bool xMakeCurrent(Display* display, 
@@ -118,32 +115,28 @@ public:
     void xWaitX();
 
     GLXContext xCreateContextAttribs(Display* display, 
                                      GLXFBConfig config, 
                                      GLXContext share_list, 
                                      Bool direct,
                                      const int* attrib_list);
 
-    int xGetVideoSync(unsigned int* count);
-    int xWaitVideoSync(int divisor, int remainder, unsigned int* count);
-
     bool EnsureInitialized();
 
     GLXPixmap CreatePixmap(gfxASurface* aSurface);
     void DestroyPixmap(Display* aDisplay, GLXPixmap aPixmap);
     void BindTexImage(Display* aDisplay, GLXPixmap aPixmap);
     void ReleaseTexImage(Display* aDisplay, GLXPixmap aPixmap);
     void UpdateTexImage(Display* aDisplay, GLXPixmap aPixmap);
 
     bool UseTextureFromPixmap() { return mUseTextureFromPixmap; }
     bool HasRobustness() { return mHasRobustness; }
     bool HasCreateContextAttribs() { return mHasCreateContextAttribs; }
     bool SupportsTextureFromPixmap(gfxASurface* aSurface);
-    bool SupportsVideoSync();
     bool IsATI() { return mIsATI; }
     bool GLXVersionCheck(int aMajor, int aMinor);
 
 private:
     
     typedef void (GLAPIENTRY * PFNGLXDESTROYCONTEXTPROC) (Display*,
                                                           GLXContext);
     PFNGLXDESTROYCONTEXTPROC xDestroyContextInternal;
@@ -227,34 +220,27 @@ private:
 
     typedef GLXContext (GLAPIENTRY * PFNGLXCREATECONTEXTATTRIBS) (Display *,
                                                                   GLXFBConfig,
                                                                   GLXContext,
                                                                   Bool,
                                                                   const int *);
     PFNGLXCREATECONTEXTATTRIBS xCreateContextAttribsInternal;
 
-    typedef int (GLAPIENTRY *PFNGLXGETVIDEOSYNCSGI) (unsigned int *count);
-    PFNGLXGETVIDEOSYNCSGI xGetVideoSyncInternal;
-
-    typedef int (GLAPIENTRY *PFNGLXWAITVIDEOSYNCSGI) (int divisor, int remainder, unsigned int *count);
-    PFNGLXWAITVIDEOSYNCSGI xWaitVideoSyncInternal;
-
 #ifdef DEBUG
     void BeforeGLXCall();
     void AfterGLXCall();
 #endif
 
     bool mInitialized;
     bool mTriedInitializing;
     bool mUseTextureFromPixmap;
     bool mDebug;
     bool mHasRobustness;
     bool mHasCreateContextAttribs;
-    bool mHasVideoSync;
     bool mIsATI;
     bool mIsNVIDIA;
     bool mClientIsMesa;
     int mGLXMajorVersion;
     int mGLXMinorVersion;
     PRLibrary *mOGLLibrary;
 };