Introduce support for no hardware acceleration

Summary: Start flipper with `--no-launcher --disable-gpu` to disable hardware acceleration

Reviewed By: passy

Differential Revision: D25994355

fbshipit-source-id: e75bb209c8e3325135a114bec1f25889187d2728
This commit is contained in:
Michel Weststrate
2021-01-22 05:28:46 -08:00
committed by Facebook GitHub Bot
parent e67ed8030d
commit 727c99b729
2 changed files with 16 additions and 0 deletions

View File

@@ -82,6 +82,12 @@ const argv = yargs
default: false, default: false,
type: 'boolean', type: 'boolean',
}, },
'disable-gpu': {
describe:
'Disable hardware acceleration. Corresponds to FLIPPER_DISABLE_GPU=1.',
default: false,
type: 'boolean',
},
}) })
.version(VERSION) .version(VERSION)
.help() .help()
@@ -93,6 +99,11 @@ if (isFB && process.env.FLIPPER_FB === undefined) {
process.env.FLIPPER_FB = 'true'; process.env.FLIPPER_FB = 'true';
} }
if (argv['disable-gpu'] || process.env.FLIPPER_DISABLE_GPU === '1') {
console.warn('Hardware acceleration disabled');
app.disableHardwareAcceleration();
}
process.env.CONFIG = JSON.stringify(config); process.env.CONFIG = JSON.stringify(config);
// possible reference to main app window // possible reference to main app window

View File

@@ -29,6 +29,11 @@ We hope that flipper works well out of the box, but the software is a work in pr
* Delete Flipper from your applications folder and redownload [Flipper](https://www.facebook.com/fbflipper/public/mac). * Delete Flipper from your applications folder and redownload [Flipper](https://www.facebook.com/fbflipper/public/mac).
* If you're using `yarn start` to run from source, make sure all dependencies are installed correctly by running yarn install. * If you're using `yarn start` to run from source, make sure all dependencies are installed correctly by running yarn install.
### Flipper shows weird render artifacts
This is a long standing MacOS + Electron issue outside our control. In general restarting your computer fixes the problem.
For a quick, temporarily work around start Flipper with hardware acceleration disabled. Please note that this will consume a lot of CPU: `FLIPPER_DISABLE_GPU=1 open -a Flipper`.
### iOS Simulator missing from devices dropdown ### iOS Simulator missing from devices dropdown
* Check that `xcode-select -p` shows the same XCode version that you're using. If not, see xcode-select for how to select the correct version. * Check that `xcode-select -p` shows the same XCode version that you're using. If not, see xcode-select for how to select the correct version.