Skip to content

Commit

Permalink
Add lowLatency flag to WebGLContextAttributes.
Browse files Browse the repository at this point in the history
Developers of stylus-based drawing applications (e.g. Google Keep)
have found this hint to be critical in order to be competitive with
native applications. It has been prototyped in Chromium and yields
significant latency improvements there.

This is the WebGL analogue of whatwg/html#4234
and partially addresses whatwg/html#4087 .
  • Loading branch information
kenrussell committed Dec 18, 2018
1 parent b59c749 commit 0dda365
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ <h3><a name="WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a></h3>
GLboolean preserveDrawingBuffer = false;
WebGLPowerPreference powerPreference = "default";
GLboolean failIfMajorPerformanceCaveat = false;
GLboolean lowLatency = false;
};</pre>

<h4>Context creation parameters</h4>
Expand Down Expand Up @@ -877,6 +878,21 @@ <h4>Context creation parameters</h4>
set to <code>false</code>, with the knowledge that a reduced-fidelity rendering mode
should be used to improve performance.
</dd>
<dt> <span class=prop-value>lowLatency</span></dt>
<dd>
<p>
If the value is true, the user agent will attempt to optimize the rendering of the
canvas to reduce latency, including potentially rendering from the front buffer.
This might desynchronize the canvas's display from the rest of the page and induce
tearing on some displays.
</p>
<div class="note">
The <code>lowLatency</code> flag is useful and necessary when implementing certain
kinds of applications, such as drawing applications, where the delay between input
and rasterization is critical. However, applications should not arbitrarily set
the <code>lowLatency</code> flag to true; it should be used only when needed.
</div>
</dd>
</dl>
<div class="example">
Here is an ECMAScript example which passes a WebGLContextAttributes argument
Expand Down
1 change: 1 addition & 0 deletions specs/latest/1.0/webgl.idl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dictionary WebGLContextAttributes {
GLboolean preserveDrawingBuffer = false;
WebGLPowerPreference powerPreference = "default";
GLboolean failIfMajorPerformanceCaveat = false;
GLboolean lowLatency = false;
};

[Exposed=(Window,Worker)]
Expand Down

0 comments on commit 0dda365

Please sign in to comment.