Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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/
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSSupportsAutomaticGraphicsSwitching</key> | ||
<true/> | ||
<key>CFBundleDisplayName</key> | ||
<string>Servo</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleName</key> | ||
<string>Servo</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2016 The Servo Authors</string> | ||
<key>CFBundleVersion</key> | ||
<string>0.0.1</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>org.servo.servo</string> | ||
</dict> | ||
</plist> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters