Fix lint warnings in documentations
This commit is contained in:
parent
d8a030fa9b
commit
ba9aa13bd8
2 changed files with 18 additions and 17 deletions
|
@ -480,7 +480,7 @@ Emitted when a new frame is generated. Only the dirty area is passed in the
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const {BrowserWindow} = require('electron');
|
const {BrowserWindow} = require('electron')
|
||||||
|
|
||||||
let win = new BrowserWindow({
|
let win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
|
@ -488,12 +488,12 @@ let win = new BrowserWindow({
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
offscreen: true
|
offscreen: true
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
win.loadURL('http://github.com');
|
win.loadURL('http://github.com')
|
||||||
|
|
||||||
win.webContents.on('paint', (event, dirty, data) => {
|
win.webContents.on('paint', (event, dirty, data) => {
|
||||||
updateBitmap(dirty, data);
|
// updateBitmap(dirty, data)
|
||||||
});
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
|
@ -26,20 +26,21 @@ mode that WebGL and 3D CSS animations are supported.
|
||||||
This mode uses a software output device for rendering in the CPU, so the frame
|
This mode uses a software output device for rendering in the CPU, so the frame
|
||||||
generation is much faster, thus this mode is preferred over the GPU accelerated
|
generation is much faster, thus this mode is preferred over the GPU accelerated
|
||||||
one. To enable this mode GPU acceleration has to be disabled like this:
|
one. To enable this mode GPU acceleration has to be disabled like this:
|
||||||
``` javascript
|
|
||||||
const {app} = require('electron');
|
|
||||||
|
|
||||||
app.commandLine.appendSwitch('disable-gpu');
|
``` javascript
|
||||||
app.commandLine.appendSwitch('disable-gpu-compositing');
|
const {app} = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('disable-gpu')
|
||||||
|
app.commandLine.appendSwitch('disable-gpu-compositing')
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
const {app, BrowserWindow} = require('electron');
|
const {app, BrowserWindow} = require('electron')
|
||||||
|
|
||||||
app.commandLine.appendSwitch('disable-gpu');
|
app.commandLine.appendSwitch('disable-gpu')
|
||||||
app.commandLine.appendSwitch('disable-gpu-compositing');
|
app.commandLine.appendSwitch('disable-gpu-compositing')
|
||||||
|
|
||||||
let win = new BrowserWindow({
|
let win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
|
@ -47,12 +48,12 @@ let win = new BrowserWindow({
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
offscreen: true
|
offscreen: true
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
win.loadURL('http://github.com');
|
win.loadURL('http://github.com')
|
||||||
|
|
||||||
win.webContents.setFrameRate(30);
|
win.webContents.setFrameRate(30)
|
||||||
|
|
||||||
win.webContents.on('paint', (event, dirty, data) => {
|
win.webContents.on('paint', (event, dirty, data) => {
|
||||||
updateBitmap(dirty, data);
|
// updateBitmap(dirty, data)
|
||||||
});
|
})
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue