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
Post a Comment