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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 2854953006: Move disable_display_vsync out of RendererSettings (Closed)
Patch Set: Fix LayoutTestSupport Created 3 years, 8 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: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 23ba5e3cf3db70556acbc41e4e93403ec67fb6da..96e551b6c8402ccedcd82cf70ec810efff9b1e43 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -199,6 +199,18 @@ GpuProcessTransportFactory::GpuProcessTransportFactory()
frame_sink_manager_host_ = base::MakeUnique<FrameSinkManagerHost>();
frame_sink_manager_host_->ConnectToFrameSinkManager();
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableGpuVsync)) {
+ std::string display_vsyn_string =
danakj 2017/05/04 15:36:36 vsync
Alex Z. 2017/05/04 18:41:56 Done.
+ command_line->GetSwitchValueASCII(switches::kDisableGpuVsync);
+ // See comments in gl_switches about this flag. The browser compositor
+ // is only unthrottled when "gpu" or no switch value is passed, as it
+ // is driven directly by the display compositor.
+ if (display_vsyn_string != "beginframe") {
+ disable_display_vsync_ = true;
+ }
+ }
+
task_graph_runner_->Start("CompositorTileWorker1",
base::SimpleThread::Options());
#if defined(OS_WIN)
@@ -551,7 +563,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
std::unique_ptr<GpuVSyncBeginFrameSource> gpu_vsync_begin_frame_source;
if (!begin_frame_source) {
- if (!compositor->GetRendererSettings().disable_display_vsync) {
+ if (!disable_display_vsync_) {
if (gpu_vsync_control && IsGpuVSyncSignalSupported()) {
gpu_vsync_begin_frame_source =
base::MakeUnique<GpuVSyncBeginFrameSource>(gpu_vsync_control);

Powered by Google App Engine
This is Rietveld 408576698