Skip to main content
Participant
June 20, 2013
Question

Slow load of BitmapData

  • June 20, 2013
  • 1 reply
  • 473 views

In my application, i am using a graphical counter for score. It has several effects that would be too hard to render real-time, so i have my whole animation converted to 2525x45px picture. In my application, i am cutting this image to 100 bitmapDatas(10 for each digit) and in the runtime i am switching bitmapDatas in my Bitmap object, so it creates an animation. I am doing this with AIR 3.1 on BB Playbook, with GPU rendering ON(no Stage3D !).

The problem is : at the first run, digits(frames of the animations) are being displayed very slowly and it slows the whole app, the lag starts at aproximetly 30th frame. But once every frame of the animations has been displayed and the animatin loops, everything goes fine.

My solution: i tried to use getPixel() on every BitmapData, to force FlashPlayer to load them into memory and dont slow it later, but it didnt work.

What i thing might work: somehow force FP to load all the BitmapDatas to GPU memory(bitmaps should be displayed with GPU) without actually displaying them(i dont want to show something i dont want to be shown.)

Thanks for any suggestions

This topic has been closed for replies.

1 reply

chris.campbell
Legend
June 20, 2013

Are you seeing this performance hit with any other platform?  In particular, if you can get this to occur on the desktop, android, or iOS you can use Adobe Scout to profile your app and see where the slowdown occurs.

Participant
June 20, 2013

Hi,

ive tried Scout on Desktop and it didnt showed the slowdown as on Playbook. My theory is that when i create that 100 DOs at start, they are stored in RAM but not in GPU memory. I think they arent loaded to GPU unless you add them to stage and display them. While the FP successfully handles loading first 50 DOs into GPU, it has problem to do so with next 50 DOs, bexouse it is simple too much for it(whole animation is displayed within 5-6 seconds) and some buffer probably gets full. I just simply need to load it all into GPU before the game itself starts(while is the player in the menu and does nothing).

EDIT: Ive also tried this on BB10(Blackberry Dev Alpha C) and no issue was reproduced, but i think it is becouse DAC has much more powerful HW than Playbook

chris.campbell
Legend
June 20, 2013

Have you tried posting about this on the BB AIR forums?

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/bd-p/tablet

Given that this doesn't happen with the desktop, it might be a BB SDK specific issue.  BB is responsible for all support of AIR on their platform.