I’m experiencing HUGE fps drop on Android devices when I begin moving finger around the screen (it might be related to MOUSE_MOVE event I guess but I’m not adding any listeners). The moment I stop moving my finger fps changes to 60, mouseChildren, mouseEnabled and cacheAsBitmap doesn’t seem to change anything. I’m using newest openfl (legacy) and lime.
On Xperia Neo V fps drop is visible after adding 25 sprites, on galaxy s3 after 250.
for (i in 0...50)
{
var a = new Sprite();
addChild(a);
var rect:Sprite = new Sprite();
a.addChild(rect);
rect.graphics.lineStyle(3, 0x0D7923, 1);
rect.graphics.drawRoundRect(0, 0, 50, 50, 10);
a.mouseChildren = a.mouseEnabled = false;
a.cacheAsBitmap = true;
a.x = Std.random(stage.stageWidth);
a.y = Std.random(stage.stageHeight);
}
this.mouseChildren = this.mouseEnabled = false;
addChild(new FPS(10, 40, 0xFF0000));
Adding bitmap instead of drawing round rect has the same effect.
Same problem on pirate pig example, the moment I begin moving my finger fps drops from 60 to 30 and if I set max fps to 30 it drops to 20-25 : ( It’s really weird because I’ve been using openfl for some time now and I have never noticed this.
Yeah, it’s really weird, I’m not noticing fps drop on xperia tipo which is weaker than xperia neo v. I guess I’ll ignore this for now Hopefully only few devices behave like this.
I guess it worked, fps now drops to 45-50 instead of 30 Thanks a lot.
edit: Bigger sleep value decreases fps drop even more.
Also if anyone else would like to add restorer’s fix, onTouchEvent function is located in MainView.java in legacy template folder.
Pulled, please let me know, everyone, if you experience any other side-effects from this, such as delayed events of other types, or conflicts with native extensions. In general, dispatching less touch events does seem like the fix here, though