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

Issue 906619 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

2d offscreen canvas causes GPU switch on macbook

Project Member Reported by jakearchibald@chromium.org, Nov 19

Issue description

https://static-misc.glitch.me/offscreen-rotate/

This demo gets pixel data for a rotated large bitmap.

On a 2017 Macbook pro, performing the operation locally takes 220ms. Performing the operation on an offscreen canvas takes 1400ms, as it causes a GPU switch.

To recreate the issue, you need to start with the integrated GPU active.

In our use-case (squoosh.app), we want to perform image processing in a worker, and kill the worker if it's idle. In our case, switching GPU is unnecessary (it just wastes the user's battery) and causes major jank during the switch.

I've attached a trace where I click each button, first performing the operation on a local canvas, then an offscreen canvas.
 
trace_Mon_Nov_19_2018_13.56.54.json.gz
2.4 MB Download
Owner: senorblanco@chromium.org
Status: Assigned (was: Untriaged)
senorblanco@, could you please either take a look at this or assign to the appropriate person?
Owner: ----
Status: Untriaged (was: Assigned)
Another use-case on the same site (https://squoosh.app): With large images, canvas.putImageData is becoming a bit of a main thread bottleneck for us. Obviously the answer is offscreen canvas, but we can't use it since the GPU-switch jank is worse than the jank we're trying to avoid.
Cc: kbr@chromium.org
Labels: -Pri-3 Pri-2
Owner: fs...@chromium.org
Status: Assigned (was: Untriaged)
I could reproduce it.  We shouldn't be doing this.  fserb@ could you please take a look?

Sign in to add a comment