Only enable kEnableBeginFrameScheduling for offscreen

It has effects on performance and only gets turned on after Chrome 54.
This commit is contained in:
Cheng Zhao 2016-08-03 10:40:12 +09:00
Родитель 63c34f3dcf
Коммит aefd99ec7f
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -187,7 +187,11 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
command_line->AppendSwitch("hidden-page");
}
command_line->AppendSwitch(cc::switches::kEnableBeginFrameScheduling);
// Use frame scheduling for offscreen renderers.
// TODO(zcbenz): Remove this after Chrome 54, on which it becomes default.
bool offscreen;
if (web_preferences.Get("offscreen", &offscreen) && offscreen)
command_line->AppendSwitch(cc::switches::kEnableBeginFrameScheduling);
}
// static