Skip to content

Commit 7078298

Browse files
committed
Check whether to enable threaded compositing
Part of Fix nwjs#1340
1 parent 107f3ff commit 7078298

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/shell_content_browser_client.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
#include "base/values.h"
3131
#include "chrome/common/child_process_logging.h"
3232
#include "content/browser/child_process_security_policy_impl.h"
33-
#include "content/public/browser/browser_url_handler.h"
3433
#include "content/nw/src/browser/printing/printing_message_filter.h"
34+
#include "content/public/browser/browser_url_handler.h"
35+
#include "content/public/browser/compositor_util.h"
3536
#include "content/public/browser/render_process_host.h"
3637
#include "content/public/browser/render_view_host.h"
3738
#include "content/public/browser/resource_dispatcher_host.h"
@@ -159,8 +160,13 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
159160
}
160161

161162
#endif // OS_MACOSX
163+
162164
if (command_line->GetSwitchValueASCII("type") != "renderer")
163165
return;
166+
167+
if (content::IsThreadedCompositingEnabled())
168+
command_line->AppendSwitch(switches::kEnableThreadedCompositing);
169+
164170
if (child_process_id > 0) {
165171
content::RenderWidgetHost::List widgets =
166172
content::RenderWidgetHost::GetRenderWidgetHosts();

0 commit comments

Comments
 (0)