cc: Add command line for frame production throttle.

This CL decouples "disable gpu vsync" and "throttle frame production".

1. Add options of display-gpu-vsync
--disable-gpu-vsync=gpu :  Sets |disable_display_vsync| true.
--disable-gpu-vsync=beginframe : Sets |throttle_frame_production| false.
--disable-gpu-vsync : Same as using both flags above.

2. Rename |disable_gpu_vsync| variable to |disable_display_vsync|.

BUG=492732
[email protected], [email protected], [email protected], [email protected]
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1177383005

Cr-Commit-Position: refs/heads/master@{#338800}
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index d864a02..edc4622 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -93,8 +93,18 @@
       context_factory_->DoesCreateTestContexts() ? kTestRefreshRate
                                                  : kDefaultRefreshRate;
   settings.main_frame_before_activation_enabled = false;
-  settings.renderer_settings.disable_gpu_vsync =
-      command_line->HasSwitch(switches::kDisableGpuVsync);
+  if (command_line->HasSwitch(switches::kDisableGpuVsync)) {
+    std::string display_vsync_string =
+        command_line->GetSwitchValueASCII(switches::kDisableGpuVsync);
+    if (display_vsync_string == "gpu") {
+      settings.renderer_settings.disable_display_vsync = true;
+    } else if (display_vsync_string == "beginframe") {
+      settings.wait_for_beginframe_interval = false;
+    } else {
+      settings.renderer_settings.disable_display_vsync = true;
+      settings.wait_for_beginframe_interval = false;
+    }
+  }
   settings.renderer_settings.partial_swap_enabled =
       !command_line->HasSwitch(cc::switches::kUIDisablePartialSwap);
 #if defined(OS_WIN)