离屏渲染
再次渲染时候,可以从位图缓存中获取数据,只更新脏区
const {app, BrowserWindow} = require('electron') app.disableHardwareAcceleration() let win app.once('ready', () => { win = new BrowserWindow({ webPreferences: { offscreen: true } }) win.loadURL('http://github.com') win.webContents.on('paint', (event, dirty, image) => { // updateBitmap(dirty, image.getBitmap()) }) win.webContents.setFrameRate(30) })