|
Viewing 1 to (4 Total) Huge performance drop while using cacheAsBitmap |
Total Posts: 7
Joined: March 21, 2012
|
Hi
I am scrolling a huge image using srollRect on my mobile. When I use cacheAsBitmap for caching bitmap then I am able to get around 11-12 FPS but when I disable it then FPS jumps to 59 FPS. I there something wrong because on other forums I have read that using cacheAsBitmap should increase performance rather then degrading it.
For testing I am using wildfire s which have Adreno 200 gpu.
Deepak
Tags:
Posted on June 06, 2012 at 5:14 AM
|
|
|
Total Posts: 2147
Joined: August 25, 2011
|
Re: Huge performance drop while using cacheAsBitmap
Flash uses a software renderer.
I believe that when you use "cacheAsBitmap" in Flash, you are switching between a software vector renderer, to a software bitmap, which can improve performance.
NME uses a hardware renderer.
When you use "cacheAsBitmap" in NME, you are switching between a hardware bitmap and a software bitmap. Particularly on mobile, hardware will run much faster. I know this seems backwards, but considering this difference between Flash and NME in regards to hardware rendering, it may make more sense.
So in Flash you are switching between two forms of a software renderer, and in NME "cacheAsBitmap" is triggering a software renderer for something that otherwise would be done as a hardware surface.
Posted on June 06, 2012 at 10:17 AM
|
Total Posts: 272
Joined: March 08, 2012
|
Re: Huge performance drop while using cacheAsBitmap
When running on CPP targets, is cacheAsBitmap on by default like it is in Flash, or is it off? (Similarly, what about Assets: getBitmapData?)
Posted on June 06, 2012 at 12:03 PM
|
Total Posts: 548
Joined: October 07, 2011
|
Re: Huge performance drop while using cacheAsBitmap
cacheAsBitmap is normally off. It is useful when:
a. Your object does not change, or
b. when the hardware render quality is not good enough.
For a., you are effectively paying a start-up cost to get a speed-up later on. But if you change the object, you never get this speedup.
If you have a know region, you could consider using BitmapData.draw to create a big bitmap, then use scrollRect to display only a portion of it. This will avoid recreating the bitmap every frame.
Hugh
Posted on June 07, 2012 at 12:16 AM
|