简体   繁体   中英

Android Tablet: Very poor Browser performance for HTML5 canvas

I bought a new tablet (Asus Memo Pad 10, Android 4.2). One of the first things I did was try to run a small HTML5 canvas game that i wrote. I saw that the frame rate was very bad (3 fps), which is very weird, because my mother has the same talet and on hers it runs with 30 fps. I also got another tablet which is about the same speed and this one also runs at ~30 fps, same for my phone, which should also be pretty much the same performance, and also runf fine on that. This happens for all browsers, i tried chrome, FF and Opera, all have 3 or 4 fps. Apart from that, the tablet seems to be fine, i tried other games, for example Heartstone, which runs fine, also I ran a benchmark (pcmark) which gave me an everage result for this tablet. Im really wondering why the performance for my game is so bad. All it does is some basic 2d canvas rendering. No js errors in console. I dont use any libs / frameworks. I use requestAnimationFrame() for rendering. When i use setTimeout() or setInterval() instead, the game suddenly runs at much higher fps, but fails to actually render at that speed, so it still actually looks like 3 fps or so, while the loop runs 50 or 60 times a sec. This also happens when i put the "setTimeout" call at the end of the loop. Another thing to note is: when i check performance with chrome dev tools, it looks like the cpu is like 90% idle, which somehow would explain why the game runs so slow.

Anyone has an idea why this is happening and what i could do about it ?

Ok, i played around in the chrome flags (chrome://flags) and eventually it was possible to enable 2d canvas rendering, which my GPU (Mali 400 MP) seems to not support properly by default. After flagging all the 2d canvas stuff it eventually works and 2d canvas is now accelerated, at least for Chrome.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM