错误代码:
error:angle_platform_impl.cc[44] renderegl_utils.cpp:188 (ClearErrors): Preexisring GL error
0x00000500 as of ../../third_party/angle/src/libangle/renderer/gl/textureGl.cpp, setImageHelper
:256. error:gpu_memory_buffer_support_x11.cc(44) dri3 extension not supported.
electron的硬件加速功能,在win7或者Linux系统上,容易出现黑屏或者卡死。
解决办法:
app.disableHardwareAcceleration()
禁用当前应用程序的硬件加速。
这个方法只能在应用程序准备就绪(ready)之前调用。
如果你使用的是
electron-egg框架https://github.com/wallace5303/electron-egg
那么,在main.js文件的ready()方法中添加
伪代码:
const isWin7 = os.release().startsWith('6.1');
const isLinux = true;
if (isWin7 || isLinux) {
app.disableHardwareAcceleration();
}