New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 859275 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Offscreen canvas flickers

Project Member Reported by gman@chromium.org, Jun 30 2018

Issue description

Chrome Version: Version 69.0.3476.0 (Official Build) canary (64-bit)
OS: MacOS 10.13.15
GPU: NVIDIA GeForce GT 750M 2048 MB

What steps will reproduce the problem?
(1) http://jsfiddle.net/greggman/gmpkvu30/
(2) size the window

What is the expected result?

Here is no flicker

What happens instead?

Lots of flicker.

Note if resizing is not required to see the flicker but at least with a small window it makes it more likely. On a fullscreen example it flickers without resizing


Please use labels and text to provide additional information.

If this is a regression (i.e., worked before), please consider using the
bisect tool (https://www.chromium.org/developers/bisect-builds-py) to help
us identify the root cause and more rapidly triage the issue.

For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.


 
Status: WontFix (was: Untriaged)
The example code has a commit() inside a RAF. This is not a supported use case.
Perhaps we should add a warning then?
Status: Available (was: WontFix)
It shouldn't flicker regardless of use. It is not required to constantly render to a canvas so even if it's skipping frames because of incorrect use it should not flicker.
Here's a perfectly valid usecase

http://jsfiddle.net/greggman/y36aujrf/

It's trying to render at 15fps so it does this

  let then = -1000;
  function loop(time) {
    time *= 0.001;
    const elapsed = time - then;
    if (elapsed > 1 / 15) {
      then = time;
      render();
      gl.commit();
    }
    requestAnimationFrame(loop);
  }
  requestAnimationFrame(loop);


Cc: fs...@chromium.org
requestAnimationFrame() on a web worker has (or seems to have) the semantic that it automatically commits updates to the OffscreenCanvas contexts which are updated within its callback's scope, similarly to how the main thread's requestAnimationFrame works.

For this reason it's an error to call commit() from within a worker's requestAnimationFrame callback. The spec should be changed to make commit() throw an exception in this case. Some work is in progress on the specs in https://github.com/whatwg/html/pull/3677 and another pull request which I can't find immediately.

Here's an update of your resizing example which removes the incorrect call to commit() and works well:

http://jsfiddle.net/gmpkvu30/2/

and an update of your 15 FPS rendering example which removes the call to commit() and works well:

http://jsfiddle.net/y36aujrf/3/

Thanks for putting these together; we should change the spec and implementation so that they clearly show incorrect uses of the API and work well cross-browser.

Status: WontFix (was: Available)

Sign in to add a comment