Skip to content

Commit

Permalink
Revert "Remove kEnableSurfaceSynchronization switch."
Browse files Browse the repository at this point in the history
This reverts commit 6d87f94.

Reason for revert: broke external frame control for headless.

Original change's description:
> Remove kEnableSurfaceSynchronization switch.
> 
> The switch is left over from before there was a base::Feature. All
> platforms except Android WebView have it enabled by default already so
> the remaining places the switch gets added aren't necessary.
> 
> Bug: 938947
> Change-Id: I9b375453fb6dc71f204d848d93fedb9da976103e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585478
> Commit-Queue: kylechar <kylechar@chromium.org>
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Reviewed-by: Eric Seckler <eseckler@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#655235}

TBR=kylechar@chromium.org,piman@chromium.org,eseckler@chromium.org

Change-Id: I7664a077239641bbad2a555c0ad88d72cb77974b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 938947
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1590999
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#655511}
  • Loading branch information
caseq authored and Commit Bot committed May 1, 2019
1 parent 2ee01db commit 82b5f7d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
4 changes: 3 additions & 1 deletion components/viz/common/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ const base::Feature kRecordSkPicture{"RecordSkPicture",
base::FEATURE_DISABLED_BY_DEFAULT};

bool IsSurfaceSynchronizationEnabled() {
auto* command_line = base::CommandLine::ForCurrentProcess();
return IsVizDisplayCompositorEnabled() ||
base::FeatureList::IsEnabled(kEnableSurfaceSynchronization);
base::FeatureList::IsEnabled(kEnableSurfaceSynchronization) ||
command_line->HasSwitch(switches::kEnableSurfaceSynchronization);
}

bool IsVizDisplayCompositorEnabled() {
Expand Down
13 changes: 9 additions & 4 deletions components/viz/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ namespace switches {
const char kDeadlineToSynchronizeSurfaces[] =
"deadline-to-synchronize-surfaces";

// Disables begin frame limiting in both cc scheduler and display scheduler.
// Also implies --disable-gpu-vsync (see //ui/gl/gl_switches.h).
const char kDisableFrameRateLimit[] = "disable-frame-rate-limit";

// Enable compositing individual elements via hardware overlays when
// permitted by device.
// Setting the flag to "single-fullscreen" will try to promote a single
// fullscreen overlay and use it as main framebuffer where possible.
const char kEnableHardwareOverlays[] = "enable-hardware-overlays";

// Enables multi-client Surface synchronization. In practice, this indicates
// that LayerTreeHost expects to be given a valid viz::LocalSurfaceId provided
// by the parent compositor.
const char kEnableSurfaceSynchronization[] = "enable-surface-synchronization";

// Enables inspecting Viz Display Compositor objects. Default port is 9229.
// For local inspection use chrome://inspect#other
const char kEnableVizDevTools[] = "enable-viz-devtools";
Expand All @@ -41,6 +42,10 @@ const char kRunAllCompositorStagesBeforeDraw[] =
// hit-test data coming from surface layer.
const char kUseVizHitTestSurfaceLayer[] = "use-viz-hit-test-surface-layer";

// Disables begin frame limiting in both cc scheduler and display scheduler.
// Also implies --disable-gpu-vsync (see //ui/gl/gl_switches.h).
const char kDisableFrameRateLimit[] = "disable-frame-rate-limit";

base::Optional<uint32_t> GetDeadlineToSynchronizeSurfaces() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kRunAllCompositorStagesBeforeDraw)) {
Expand Down
3 changes: 2 additions & 1 deletion components/viz/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ namespace switches {

// Keep list in alphabetical order.
VIZ_COMMON_EXPORT extern const char kDeadlineToSynchronizeSurfaces[];
VIZ_COMMON_EXPORT extern const char kDisableFrameRateLimit[];
VIZ_COMMON_EXPORT extern const char kEnableHardwareOverlays[];
VIZ_COMMON_EXPORT extern const char kEnableSurfaceSynchronization[];
VIZ_COMMON_EXPORT extern const char kEnableVizDevTools[];
VIZ_COMMON_EXPORT extern const char kEnableVizHitTestDebug[];
VIZ_COMMON_EXPORT extern const char kRunAllCompositorStagesBeforeDraw[];
VIZ_COMMON_EXPORT extern const char kUseVizHitTestSurfaceLayer[];
VIZ_COMMON_EXPORT extern const char kDisableFrameRateLimit[];

VIZ_COMMON_EXPORT base::Optional<uint32_t> GetDeadlineToSynchronizeSurfaces();

Expand Down
7 changes: 7 additions & 0 deletions content/browser/browser_main_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,13 @@ int BrowserMainLoop::BrowserThreadsStarted() {
// so this cannot happen any earlier than now.
InitializeMojo();

#if BUILDFLAG(ENABLE_MUS)
if (features::IsUsingWindowService()) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableSurfaceSynchronization);
}
#endif

HistogramSynchronizer::GetInstance();

// cc assumes a single client name for metrics in a process, which is
Expand Down
1 change: 1 addition & 0 deletions content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3064,6 +3064,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
cc::switches::kSlowDownRasterScaleFactor,
cc::switches::kBrowserControlsHideThreshold,
cc::switches::kBrowserControlsShowThreshold,
switches::kEnableSurfaceSynchronization,
switches::kRunAllCompositorStagesBeforeDraw,
switches::kUseVizHitTestSurfaceLayer,

Expand Down
1 change: 1 addition & 0 deletions headless/app/headless_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ int HeadlessShellMain(int argc, const char** argv) {
// Compositor flags
command_line.AppendSwitch(::switches::kRunAllCompositorStagesBeforeDraw);
command_line.AppendSwitch(::switches::kDisableNewContentRenderingTimeout);
command_line.AppendSwitch(::switches::kEnableSurfaceSynchronization);
// Ensure that image animations don't resync their animation timestamps when
// looping back around.
command_line.AppendSwitch(::switches::kDisableImageAnimationResync);
Expand Down

0 comments on commit 82b5f7d

Please sign in to comment.