Bug 177132 - WebGL canvas passed to drawImage is very slow
Summary: WebGL canvas passed to drawImage is very slow
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified macOS 10.13
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-09-19 05:04 PDT by Ashley Gullen
Modified: 2017-09-19 05:04 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ashley Gullen 2017-09-19 05:04:39 PDT
Steps to reproduce:

1. Visit: http://www.scirra.com/labs/bugs/webgl-canvas2d-perf.html
2. Observe the FPS reading

Actual results:

The demo simply creates a window-sized WebGL canvas which changes every frame, and copies it to a window-sized 2D canvas with drawImage(). On a mid-2015 Macbook Pro, this runs at about ~25 FPS.

Expected results:

It should run at 60 FPS, as it does in Chrome.

Drawing a WebGL canvas to a 2D canvas is a simple workaround for rendering multiple views of one WebGL context. We use this in Construct 3 at https://editor.construct.net, and so this overload of drawImage() is critical to the performance of our web app and this issue causes it to be unnecessarily slow. The poor performance suggests a CPU readback is happening per frame, when it should be possible to fully GPU accelerate this.