Compositing
Forgive me if this has already been covered, but is there a way of compositing Images efficiently?
I'm using this library (thank you again!) to render UI and the frame rate is suffering a bit from having to re-create an Image on every update. I'd like to reduce the workload by reusing the elements that don't change.
I noticed Path and the hidden Compositor module, but I'm not sure how they address this problem (if at all).
Could you describe your use case a little more (how you build your draw call)?
If you want to follow the performance path, you will:
- Make heavy use of cacheDrawing
- Drop completely the intermediate description and use the Immediate module (with the help of drawOrdersOfDrawing to create the orders).
With a bit of hack, you should be able to reuse an image from one frame to the next by creating yourself a DrawContext
And you won't gain anything from the Compositor module, it's a low level module to help plot pixels in the pipeline.
Alright, thanks for the quick reply. I'll take your advice and see what comes of it. I'd rather stay away from Immediate if I can get away with it.