Question about cacheAsBitmap

With the new cacheAsBitmap option, is it possible to force the renderer to not redraw while scaling a flattened Sprite/MovieClip? So you basicly get the same performance as scaling a single bitmap?

Right now, scaling a large nested complex movieclip seems to be very expensive and results in a very low FPS.

I believe scaling is triggering a redraw. Do you know if cacheAsBitmap on Flash redraws on scale? Is cacheAsBitmapMatrix required to get the behavior you want? (it is not implemented outside of Flash yet, but it could be)

I do believe cacheAsBitmap also forces a redraw when scaling on flash. However the render cost is lower. cacheAsBitmapMatrix blocks redrawing on flash so that is the desired result. However; this is as far as I know only implemented on mobile yet.

So an implementation of cacheAsBitmapMatrix that would work on desktop also would indeed produce the behavior I’m looking for :blush:

How hard do you think it would be to get cacheAsBitmapMatrix working on the desktop targets?

I think we need to continue to do testing on the caching algorithm in place, first. Once that’s stable, supporting cacheAsBitmapMatrix probably won’t be terribly complicated

Could cacheAsBitmap not trigger a redraw when scaled if openfl-disable-graphics-upscaling is enabled? Wouldnt that be the correct behaviour?

Umm, I’m not sure. That define is meant for logic around the shape.graphics vector rendering, but perhaps we should cause it to apply to both

Yes, that makes sense in my opinion! :slight_smile: