Bug 177132

Summary: WebGL canvas passed to drawImage is very slow
Product: WebKit Reporter: Ashley Gullen <ashley>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: macOS 10.13   

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.