What is the performance difference between native Canvas api and html5 canvas API for android?
I have non-interactive 2d animation application using html5 canvas and it works great under desktop browsers but performance is miserable under android. How does the performance of android native Canvas vs html5 canvas compare? Since the API is radically different before I spend all the efforts I am posting this question. Is there alternative native android API that is very simi开发者_如何学运维lar to html5 canvas for 2d animations applications?
My anwser is that the Native One of Android is MUCH MORE SLOWER than js canvas...
Unbelievable !!!
Here is the result of drawing a simple rectangle for 1000 times on my machine
1: Using View and onDraw : costs 5~7s
2: Using Native Canvas(singleton) and a dummy bitmap(singleton), Paint(singleton) and Thread. 3~6s
3: Using Javascript and createElement : 1.1s
4: Using Javascript and canvas : 0.1~0.2s
There's a problem with android browser and its canvas implementation. With a xoom (dual cpu), canvas performances are ugly compared to an plain old iPad v1.
精彩评论