Index: ui/gl/gl_surface_glx.cc |
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc |
index 8428cfcf1ae940d4c68060a93c2d8c4a83850ac7..b8f45a535ef8da05ab319b4c762507cdc346951d 100644 |
--- a/ui/gl/gl_surface_glx.cc |
+++ b/ui/gl/gl_surface_glx.cc |
@@ -36,6 +36,7 @@ class ScopedPtrXFree { |
Display* g_display; |
const char* g_glx_extensions = NULL; |
bool g_glx_create_context_robustness_supported = false; |
+bool g_glx_oml_sync_control_supported = false; |
} // namespace |
@@ -67,6 +68,9 @@ bool GLSurfaceGLX::InitializeOneOff() { |
g_glx_create_context_robustness_supported = |
HasGLXExtension("GLX_ARB_create_context_robustness"); |
+ g_glx_oml_sync_control_supported = |
+ HasGLXExtension("GLX_OML_sync_control"); |
+ |
initialized = true; |
return true; |
} |
@@ -86,6 +90,11 @@ bool GLSurfaceGLX::IsCreateContextRobustnessSupported() { |
return g_glx_create_context_robustness_supported; |
} |
+// static |
+bool GLSurfaceGLX::IsOMLSyncControlSupported() { |
+ return g_glx_oml_sync_control_supported; |
+} |
+ |
void* GLSurfaceGLX::GetDisplay() { |
return g_display; |
} |
@@ -216,6 +225,17 @@ bool NativeViewGLSurfaceGLX::PostSubBuffer( |
return true; |
} |
+bool NativeViewGLSurfaceGLX::GetSyncValues(int64_t* systemTime, |
+ int64_t* mediaStreamCounter, |
+ int64_t* swapBufferCounter) { |
+ if (g_glx_oml_sync_control_supported) { |
+ return glXGetSyncValuesOML(g_display, window_, systemTime, |
+ mediaStreamCounter, swapBufferCounter); |
+ } |
+ |
+ return false; |
+} |
+ |
NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX() |
: window_(0), |
config_(NULL) { |