Index: ui/gl/gl_surface_glx.cc |
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc |
index 47d32319543a9c50e8129915fb4e92cad268623e..1ae6678bc7c50aec287e3c0430ba31f8a87da4c2 100644 |
--- a/ui/gl/gl_surface_glx.cc |
+++ b/ui/gl/gl_surface_glx.cc |
@@ -9,6 +9,7 @@ extern "C" { |
} |
#include <memory> |
+#include "base/command_line.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/macros.h" |
@@ -500,10 +501,24 @@ bool NativeViewGLSurfaceGLX::Initialize(GLSurface::Format format) { |
DCHECK(config_); |
glx_window_ = glXCreateWindow(g_display, config_, window_, NULL); |
- if (g_glx_oml_sync_control_supported) |
+ if (g_glx_oml_sync_control_supported) { |
vsync_provider_.reset(new OMLSyncControlVSyncProvider(glx_window_)); |
- else if (g_glx_sgi_video_sync_supported) |
+ } else if (g_glx_sgi_video_sync_supported && |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableSgiVideoSync)) { |
vsync_provider_.reset(new SGIVideoSyncVSyncProvider(config_, glx_window_)); |
+ } else { |
+ // Assume a refresh rate of 59.9 Hz, which will cause us to skip |
+ // 1 frame every 10 seconds on a 60Hz monitor, but will prevent us |
+ // from blocking the GPU service due to back pressure. This would still |
+ // encounter backpressure on a <60Hz monitor, but hopefully that is |
+ // not common. |
piman
2016/08/24 21:04:29
The investigation for bug https://bugs.chromium.or
danakj
2016/08/24 22:20:50
Why not just grab the actual refresh rate here? We
|
+ const base::TimeTicks kDefaultTimebase; |
+ const base::TimeDelta kDefaultInterval = |
+ base::TimeDelta::FromSeconds(1) / 59.9; |
+ vsync_provider_.reset( |
+ new gfx::VSyncProviderStub(kDefaultTimebase, kDefaultInterval)); |
+ } |
return true; |
} |