emscripten-core/emscripten

Support `desynchronized` canvas context attribute

Fechada

#8.406 aberto em 5 de abr. de 2019

 (5 comentários) (5 reações) (0 responsável)C++ (3.519 forks)batch import
good first bughelp wanted

Métricas do repositório

Stars
 (27.361 estrelas)
Métricas de merge de PR
 (Mesclagem média 19d 10h) (147 fundiu PRs em 30d)

Description

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).

Guia do colaborador