From: Cheng Zhao Date: Fri, 18 Sep 2015 09:53:19 +0000 (+0800) Subject: docs: webContents.beginFrameSubscription X-Git-Tag: v0.33.1~11^2~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=1e918480b44b9cf9b65434ccfd4899dfb199f177;p=electron.git docs: webContents.beginFrameSubscription --- diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 2868209a..f1705c29 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -772,13 +772,3 @@ Sets whether the window should be visible on all workspaces. Returns whether the window is visible on all workspaces. **Note:** This API always returns false on Windows. - -### BrowserWindow.beginFrameSubscription() - -Enables offscreen rendering, after this call `frame-rendered` events will be -fired when the window receives a new frame from the renderer. - -### BrowserWindow.endFrameSubscription() - -Enables offscreen rendering, after this call `frame-rendered` events will -no longer be fired if offscreen rendering was enabled before. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 1a904375..e8f72cd2 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -551,3 +551,17 @@ For the `mouseWheel` event, the `event` object also have following properties: * `accelerationRatioY` Integer * `hasPreciseScrollingDeltas` Boolean * `canScroll` Boolean + +### `webContents.beginFrameSubscription(callback)` + +* `callback` Function + +Begin subscribing for presentation events and captured frames, the `callback` +will be called with `callback(frameBuffer)` when there is a presentation event. + +The `frameBuffer` is a `Buffer` that contains raw pixel data, in the format of +32bit ARGB. + +### `webContents.endFrameSubscription()` + +End subscribing for frame presentation events.