javascript - Google Chrome hardware acceleration making game run slow -


so have been working on game in html5 canvas , noticed games lags , performs slower when hardware acceleration turned on in google chrome when turned off. can try here

from doing profiling see problem lies in drawimage. more drawing 1 canvas onto another. lot of this.

hardware acceleration on. profile while hardware accelerated

hardware acceleration off. enter image description here

is there fundamental missing 1 canvas another? why difference profound?

if remember correctly, in-dom canvases loaded gpu memory in chrome, , off-dom canvases may not be. each drawimage off-screen canvas on-screen canvas results in loading content of canvas onto gpu texture, followed copy of memory on-gpu onto on-screen canvas. cost of sending new texture through gpu can quite high. loading textures high-throughput, high-latency, on gpus.

someone chrome team have chime in definitive answer, fits experience canvases in chrome.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -