membrane

James Amberger 2023-12-17T03:34:05.300009Z

I’m looking at the diagram and trying to follow along in the code but am not sure how the view gets supplied to the event function

phronmophobic 2023-12-21T13:48:56.048179Z

There’s currently no diffing. There are some instances where paints are cached. Mainly, I haven’t implemented any diffing because it hasn’t been necessary. There are a lot of cool drawing optimizations that are possible, but repainting hasn’t been a bottleneck so I’ve been focusing on other things.

phronmophobic 2023-12-21T13:50:10.943099Z

One cool idea is that a lot of the drawing optimizations should be portable across backends.

James Amberger 2023-12-21T14:28:29.752809Z

right, right. this is fascinating work. unlike with re-frame (which I agree is great) I find myself reading your whole src

phronmophobic 2023-12-21T15:23:28.446839Z

Hopefully, it's not too messy! I really wish I could spend more time on each individual piece, but just making a simple todo app requires quite a few different pieces. I tried really hard to reuse existing UI related libraries, but many of them are highly coupled to specific frameworks.

James Amberger 2023-12-21T01:45:54.243529Z

Thanks. So do the backends “diff” from repaint to repaint or do they just redraw the whole render target every repaint?

phronmophobic 2023-12-17T20:32:59.671879Z

It's currently more of an implementation detail , but passing the view to the event function is the responsibility of the "graphics backend"/"toolkit". Using the skia backend as an example, the mouse-button-callback calls the event function https://github.com/phronmophobic/membrane/blob/88afb37cda16ea343b2ec3b9790ee15896f4993d/src/membrane/skia.clj#L1656. The callback is setup when the window is created https://github.com/phronmophobic/membrane/blob/88afb37cda16ea343b2ec3b9790ee15896f4993d/src/membrane/skia.clj#L2127C7-L2127C7. In the future, I'd like to provide better support for creating new backends and simplifying existing backends.