Bug 1284934 - Use gfxPrefs to check ASAP mode in GLContextProviderGLX. r=jgilbert draft
authorAndrew Comminos <andrew@comminos.com>
Wed, 06 Jul 2016 13:18:45 -0400
changeset 386668 cbc280469d3dae86bedde6aae411e0b0e4c54cf1
parent 386555 aac8ff1024c553d9c92b85b8b6ba90f65de2ed08
child 525168 f657591b967c518b6cd641c5c28948e1f7df4198
push id22765
push userbmo:andrew@comminos.com
push dateTue, 12 Jul 2016 14:04:37 +0000
reviewersjgilbert
bugs1284934
milestone50.0a1
Bug 1284934 - Use gfxPrefs to check ASAP mode in GLContextProviderGLX. r=jgilbert MozReview-Commit-ID: 8F2hP1gt65V
gfx/gl/GLContextProviderGLX.cpp
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -942,18 +942,18 @@ GLContextGLX::MakeCurrentImpl(bool aForc
     if (aForce || mGLX->xGetCurrentContext() != mContext) {
         succeeded = mGLX->xMakeCurrent(mDisplay, mDrawable, mContext);
         NS_ASSERTION(succeeded, "Failed to make GL context current!");
 
         if (!IsOffscreen() && mGLX->SupportsSwapControl()) {
             // Many GLX implementations default to blocking until the next
             // VBlank when calling glXSwapBuffers. We want to run unthrottled
             // in ASAP mode. See bug 1280744.
-            int interval = gfxPlatform::IsInLayoutAsapMode() ? 0 : 1;
-            mGLX->xSwapInterval(mDisplay, mDrawable, interval);
+            const bool isASAP = (gfxPrefs::LayoutFrameRate() == 0);
+            mGLX->xSwapInterval(mDisplay, mDrawable, isASAP ? 0 : 1);
         }
     }
 
     return succeeded;
 }
 
 bool
 GLContextGLX::IsCurrent() {