Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: ui/gl/gl_surface_glx.cc

Issue 2277883003: gl: Disable SGI_video_sync by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« ui/gfx/vsync_provider.cc ('K') | « ui/gfx/vsync_provider.cc ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698