简体   繁体   中英

HTML5 canvas drawing is slower in Cocoa WebView than Safari

I'm trying to build a wrapper app using WebView for HTML5 game that uses canvas for drawing. In Safari I'm getting 60fps but in WebView inside a wrapper app fps drops significantly (to 30-45).

Is canvas slower in WebView than Safari or I'm doing something wrong? If so, why and can anything be done about it?

I have searched the Web for answer but can't find any mention of speed difference.

Thank you!

Unfortunately, haven't found the answer to my question but have solved my problem. I circumvented WebViews canvas drawing slowness by not using WebView.

I rather built a wrapper for my game using JavaScriptCore framework and redirected canvas calls to OpenGL functions. Also redirected audio calls to OpenAL, and mouse input from view to JavaScript.

Game code haven't changed a bit, and engine (small, custom one) got a few function overrides.

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