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

Issue 859276 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

OffscreenCanvas commit prevents worker from receiving messages

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

Issue description

Chrome Version: Version 69.0.3476.0 (Official Build) canary (64-bit)


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

What is the expected result?

The square should stay square

What happens instead?

The square gets stretched into a rectangle


The issue. The worker is structured like this

  const appInfo = {
    clientWidth: 300,
    clientHeight: 150,
  };

  function render() {
    if canvas size does not match appInfo size
      resize canvas

    ...renderScene...

    requestAnimationFrame(render);
    gl.commit();
  }
  requestAnimationFrame(render);

  onmessage = receive appInfo from main thread

On the main thread if the canvas has changed size it sends a message

That message arrives only once. If you look at the console output you'll see the main thread is sending messages about the new size but the worker never receives them.

Given that it's using requestAnimationFrame and therefore should be able to respond to events it seems like it should be able to receive the messages.

As for why rAF then commit. Since it takes time to schedule a rAF it makes sense to ask for the next frame before committing since committing supposedly blocks so we want the system to know that we want another frame as soon as possible therefore we ask for a raf before committing.

Note that swapping those (http://jsfiddle.net/greggman/gpnqt7db/)

    gl.commit()
    requestAnimationFrame

does not fix the problem
 

Comment 1 by gman@chromium.org, Jun 30 2018

Let me add I have other samples that use `fetch` and `ImageBitmap` to try to download images but because the worker never receives any other events the callbacks for fetch never arrive.

If I switch to pumping the worker from the main thread as in onmessage=render then events arrive and things work as expected.
Status: WontFix (was: Untriaged)

Sign in to add a comment