Rasterific icon indicating copy to clipboard operation
Rasterific copied to clipboard

Compositing

Open SwiftsNamesake opened this issue 8 years ago • 2 comments

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).

SwiftsNamesake avatar Sep 04 '17 12:09 SwiftsNamesake

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:

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.

Twinside avatar Sep 04 '17 14:09 Twinside

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.

SwiftsNamesake avatar Sep 04 '17 17:09 SwiftsNamesake