Commit 97973366 authored by danakj's avatar danakj Committed by Commit Bot

viz: Spawn renderer with gpu disabled when it's turned off already.

When the browser process sees that gpu compositing is off, it spawns
the renderer with --disable-gpu-compositing so that it does not try
to set up gpu compositing, then fall back to software, making wasted
work.

With viz this branch was being skipped since the ImageTransportFactory
was not doing anything useful yet. Now that it is, we can query it the
same way as we do in non-viz, since it watches the authoritative
compositing mode, and checks the command line on startup itself.

R=kylechar@chromium.org, piman@chromium.org

Bug: 730660
Change-Id: Ibb4a4879f0fe78fa801144f4e7af6635722529f0
Reviewed-on: https://chromium-review.googlesource.com/794910
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520183}
parent 10081a8c
......@@ -2740,15 +2740,15 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
renderer_cmd->AppendSwitch(switches::kDisableDatabases);
}
#if !defined(OS_ANDROID)
#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
// If gpu compositing is not being used, tell the renderer at startup. This
// is inherently racey, as it may change while the renderer is being launched,
// but the renderer will hear about the correct state eventually. This
// optimizes the common case to avoid wasted work.
// Note: There is no ImageTransportFactory with Mash or Viz.
// TODO(danakj): Get this info somewhere for viz mode.
if (!IsUsingMus() && !browser_cmd.HasSwitch(switches::kEnableViz) &&
ImageTransportFactory::GetInstance()->IsGpuCompositingDisabled())
// Note: There is no ImageTransportFactory with Mus, but there is also no
// software compositing on ChromeOS where Mus is used, so no need to check
// this state and forward it.
if (ImageTransportFactory::GetInstance()->IsGpuCompositingDisabled())
renderer_cmd->AppendSwitch(switches::kDisableGpuCompositing);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment