2020-03-20 20:28:31 +00:00
|
|
|
const { app, BrowserWindow } = require('electron');
|
2018-10-02 01:34:52 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
app.commandLine.appendSwitch('--disable-software-rasterizer');
|
2018-10-02 01:34:52 +00:00
|
|
|
|
2020-02-03 22:43:22 +00:00
|
|
|
app.whenReady().then(() => {
|
2020-03-20 20:28:31 +00:00
|
|
|
const infoType = process.argv.pop();
|
2020-06-25 17:55:17 +00:00
|
|
|
const w = new BrowserWindow({ show: false, webPreferences: { contextIsolation: true } });
|
2020-03-03 21:35:05 +00:00
|
|
|
w.webContents.once('did-finish-load', () => {
|
|
|
|
app.getGPUInfo(infoType).then(
|
|
|
|
(gpuInfo) => {
|
2020-03-20 20:28:31 +00:00
|
|
|
console.log(JSON.stringify(gpuInfo));
|
2020-06-17 17:08:10 +00:00
|
|
|
setImmediate(() => app.exit(0));
|
2020-03-03 21:35:05 +00:00
|
|
|
},
|
|
|
|
(error) => {
|
2020-03-20 20:28:31 +00:00
|
|
|
console.error(error);
|
2020-06-17 17:08:10 +00:00
|
|
|
setImmediate(() => app.exit(1));
|
2020-03-03 21:35:05 +00:00
|
|
|
}
|
2020-03-20 20:28:31 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
w.loadURL('data:text/html;<canvas></canvas>');
|
|
|
|
});
|