Original issue 1368 created by fa3rhan on 2014-09-04T21:39:21.000Z:
What steps will reproduce the problem?
1. Use OSR with CefBrowserSettings.windowless_frame_rate = 60 or cefclient with '--off-screen-rendering-enabled --off-screen-frame-rate=60'
2. load a website with a perpetual css animation or webGL
What is the expected output? What do you see instead?
It should output 60fps, instead it does (at most) 30
What version of the product are you using? On what operating system?
Cef branch 2062 on linux
Please provide any additional information below.
Chromium does render at 60fps (as shown by running webGL benchmarks), but CropScaleReadbackAndCleanMailbox in render_widget_host_view_osr.cc isn't done in time, resulting in every other frame to get dropped, so OSR uses exacly half of the chromium frames.
When adding another browser that renders at the same time, the frame rate goes down to 15 fps each, with 3 browsers it's 10 each.
Note that this has nothing to do with the CefBrowserSettings.windowless_frame_rate limitation and is not a performance problem, it happens with tiny browser windows all the same.
here is what I think is the problem:
Chromium runs with vsync per default which means the GL thread gets blocked when a buffer swap is requested. When Cef queues the download of the frame buffer contents into system memory, the GL thread is already blocked, so the download will be done after the GL thread is finished waiting for vsync and cef recieves the copy finished callback too late for the next frame to be used.