gwt canvas context.drawImage very slow -


i'm using gwt canvas draw 50 identical 16x16 images full screen (in draw()) requestanimationframe, main loop below:

animationscheduler.get().requestanimationframe(new animationcallback() {                     public void execute(double timestamp) {                         mainloop(deltatimeinms);                         animationscheduler.get().requestanimationframe(this,canvaselem);                     }                 }, canvaselem);   void mainloop(double deltatime) {         calcfps(deltatime);         clearcontext();         update(deltatime);         draw(); } 

i store images using clientbundle dataresources. converted images , imageelement able call context.draw.

the fps before 50 images rendered around 60fps. when rendered fps around 20fps. (both in chrome , mozilla) in dev mode.

i think image loading might of problem.

animationscheduler.get().requestanimationframe(new animationcallback() {                     public void execute(double timestamp) {                         mainloop(deltatimeinms);                         animationscheduler.get().requestanimationframe(this,canvaselem);                     }                 }, canvaselem);   void mainloop(double deltatime) {         calcfps(deltatime);         clearcontext();         update(deltatime); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -