I saw Skia's implementation but I do want to have a full UI toolkit and for 95% of the application cljfx fits the bill perfectly. When I get enough going I will put that on the list to benchmark and be sure about.
I think cljfx would simplify distribution as well
How are you managing redrawing your canvas when the user resizes the main window? Are you keeping a mirror of the window properties in an atom to force a redraw that way?
I put canvas’s width and height into app state, and listen to size changes to update the state. Then redraws will happen automatically on resize
https://github.com/vlaaad/reveal/blob/master/src/vlaaad/reveal/output_panel.clj#L476
That makes sense. I am bit concerned about how smooth that will appear but since I am bouncing all the way to opengl and back anyway I don't think it can be butter smooth.
Does that coalesce rendering? For example does a single resize cause 2 render requests?
Yes, it appears like it does with batching descriptions. This is great.
Not sure I understand the question, but you can request rendering million times per second from multiple threads, and it should preform redraws once per frame from javafx ui thread
That's when using renderer abstraction
There's an example of that somewhere...
https://github.com/cljfx/cljfx/blob/master/examples/e24_concurrency.clj
That is what I was looking for. If a user starts resizing the window then you can easily end up with too many events to render and some level of coalescing makes sense. Sorry of all the detailed questions, I am also going through the code to see what is going on.