Fun with code (since 2006)

Vote for a new cacheAsBitmap behavior !


11.27.08 Posted in Actionscript 3 by

As I said the other day, the current cacheAsBitmap behavior has a few drawbacks which makes it nearly unuseful. As you know, the biggest problem of cacheAsBitmap is that the cached bitmap gets updated in memory everytime you modify it. In fact, only a translation on x and y axis does not update the cached bitmap in memory. A great addition in a future player would be locking the cached bitmap update in memory when the cached DisplayObject is modified.

The idea could be something like :

DisplayObject.cacheAsBitmap ( redraw:Boolean=true );

We could get huge performance improvements in terms of rendering in many cases, from game development to complex websites.

Please vote for a new cacheAsBitmap behavior, Flash Player engineers are listening ;)



19 Responses to “Vote for a new cacheAsBitmap behavior !”

  1. Tek says:

    It isn’t democratic, I really want to vote against, just to add a little fun to my day ! :)

    I of course have voted for.

  2. maroo says:

    how about this:

    DisplayObject.cacheAsBitmap = true;
    DisplayObject.bitmapCacheMethod = BitmapCacheMethod.ALWAYS;

  3. Thibault Imbert says:

    Hi maroo,

    Yes this is a good idea !

    Thibault

  4. Daryl Teo says:

    Ah! At first I was a little confused… why would you lock the cached bitmap in memory when the DisplayObject changed. Then I read your rasterizing article and I realised that that IS what you want to do.

    Rasterizing to a animated PNG would be great too, but I guess 1 thing at a time :)

  5. Macaca says:

    I like maroo’s idea:

    DisplayObject.cacheAsBitmap = true;
    DisplayObject.bitmapCacheMethod = BitmapCacheMethod.ALWAYS;

    But then add some more fancy bitmapCacheMethod’s .. like BitmapCacheMethod.TRANSLATE_ONLY, BitmapCacheMethod.SMOOTH etc.

  6. Pleh says:

    Voted :) I like maroo’s idea too.

    Thibault, Did you get my email the other day about Icon rendering?

  7. Thibault Imbert says:

    Hi Pleh,

    Yes ! I have to take a look at it again. I will get back to you soon !

    best,

    Thibault

  8. Pleh says:

    Thanks, I was afraid it may have been junked :)

  9. Robin Lambell says:

    Voted :)

    So what are you calling this one? “Adobe Make Some Bitmaps and leave them alone?”

  10. Thibault Imbert says:

    haha Robin,

    Do not tempt me ! :)

  11. Adriaan says:

    great proposal, I’ve voted +1!

  12. Pure says:

    Great idea

  13. Alama says:

    Yes!! Je vote également! ;)

    Un paramètre “autoRefresh” serait le bienvenu.

  14. Elliot Geno says:

    YES YES YES!

    I have had to write my own cacheAsBitmap feature to get around this!

  15. [...] Vote for a new cacheAsBitmap behavior! [...]

     
  16. Davide says:

    Great idea! Please, imlpements that feature. Moreover, general pixel/line hardware acceleration should be implemented. I see a lot on interest in stage hardware acceleration (not only the video/movie) the acceleration should take care of blitting too. If you place multiple effect on the same stage, the movieclip slowdown in some cases.

    Thank you
    Best regards

  17. Gary Paluk says:

    I also like Maroos implementation, however setting DisplayObject.cacheAsBitmap = true / false is unneccessary if you also have:

    DisplayObject.bitmapCacheMethod = BitmapCacheMethod.NEVER;

    Gary Paluk

Leave a Reply

Open Sort Options

Sort comments by:
  • * Applied after refresh

ByteArray.org
Fun with code since 2006.