emscripten-core/emscripten

Support `desynchronized` canvas context attribute

已关闭

#8,406 创建于 2019年4月5日

 (5 条评论) (5 个反应) (0 位负责人)C++ (3,519 个派生)batch import
good first bughelp wanted

仓库指标

星标
 (27,361 个星标)
PR 合并指标
 (平均合并 19天 10小时) (30 天内合并 147 个 PR)

描述

Chrome has recently added a desynchronized canvas context attribute that disables double buffering for canvases to achieve lower latency. It will be available by default on Chrome 75 (currently on Canary), it's possible to make it available in Chrome 73 by enabling chrome://flags/#enable-experimental-web-platform-features.

We should add desynchronized to EmscriptenWebGLContextAttributes, and if true, set both desynchronized and lowLatency properties to true in the getContext call that creates the context. lowLatency is the old name for this feature, used up until Chrome 74.

If needed for debugging and writing unit tests, ctx.getContextAttributes() can be called on the created context to check if the flag is supported and was accepted.

See https://www.chromestatus.com/feature/6360971442388992 and https://docs.google.com/document/d/1-Z_dj9AQ4SjgDLAEY3ELR0YrlHR3JZyJPhaHAstS5WU/edit# (this link focuses mostly on ChromeOS).

贡献者指南