diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2016-06-06 19:17:09 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2016-06-08 12:29:44 -0700 |
commit | 0d963f5bf820f4ee604c2ee059d19e031237a4de (patch) | |
tree | a056c5eb2d70d2d153bf4d560d46602374448731 /components/servo/platform/macos/mod.rs | |
parent | a259bb38b10e528c0eb4e9900127bc22a9298784 (diff) | |
download | servo-0d963f5bf820f4ee604c2ee059d19e031237a4de.tar.gz servo-0d963f5bf820f4ee604c2ee059d19e031237a4de.zip |
servo: Add an `Info.plist` on the Mac and opt into integrated graphics.
Discrete GPUs cause power use problems and tend to perform badly with
WebRender.
See:
* https://developer.apple.com/library/mac/qa/qa1734/_index.html
* https://reverse.put.as/2013/05/28/gimmedebugah-how-to-embedded-a-info-plist-into-arbitrary-binaries/
Diffstat (limited to 'components/servo/platform/macos/mod.rs')
-rw-r--r-- | components/servo/platform/macos/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/components/servo/platform/macos/mod.rs b/components/servo/platform/macos/mod.rs new file mode 100644 index 00000000000..b980b83f5fb --- /dev/null +++ b/components/servo/platform/macos/mod.rs @@ -0,0 +1,19 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use std::ptr; + +pub fn deinit() { + // An unfortunate hack to make sure the linker's dead code stripping doesn't strip our + // `Info.plist`. + unsafe { + ptr::read_volatile(&INFO_PLIST[0]); + } +} + +#[cfg(target_os = "macos")] +#[link_section = "__TEXT,__info_plist"] +#[no_mangle] +pub static INFO_PLIST: [u8; 619] = *include_bytes!("Info.plist"); + |