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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -