fix: disable remote layer APIs in MAS build (#20965)

* fix: add patch to disable remote layer APIs

* fix: use --disable-gpu-memory-buffer-compositor-resources for MAS build
This commit is contained in:
Cheng Zhao 2020-02-24 12:08:57 +09:00 committed by GitHub
parent 1502ecf9f7
commit 41931aa5fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 153 additions and 0 deletions

View file

@ -215,6 +215,21 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) {
<< " is not supported. See https://crbug.com/638180.";
#endif
#if defined(MAS_BUILD)
// In MAS build we are using --disable-remote-core-animation.
//
// According to ccameron:
// If you're running with --disable-remote-core-animation, you may want to
// also run with --disable-gpu-memory-buffer-compositor-resources as well.
// That flag makes it so we use regular GL textures instead of IOSurfaces
// for compositor resources. IOSurfaces are very heavyweight to
// create/destroy, but they can be displayed directly by CoreAnimation (and
// --disable-remote-core-animation makes it so we don't use this property,
// so they're just heavyweight with no upside).
command_line->AppendSwitch(
::switches::kDisableGpuMemoryBufferCompositorResources);
#endif
content_client_ = std::make_unique<ElectronContentClient>();
SetContentClient(content_client_.get());