Drawing using multiple threads in Swing & EDT - Can JavaFX support this?
richard.bair at oracle.com
Mon Apr 28 02:47:02 UTC 2014
> I do not know if JavaFX was ever designed to allow such an approach.
The intent was that you wouldn't have to, but that the system would do it for you. That is, we (in theory) would break a scene graph down and process it with multiple threads, both for bounding volume computations as well as rasterization, utilizing the hardware efficiently and sparing you the pain. With Canvas, if you needed to draw your own, you could do so (setup draw commands and apply them to the canvas on the fx thread).
We don't have optimal threading on the graphics side yet, one of my biggest todo items (a refactoring there could also yield a pipeline more friendly to advanced GPU usage whereas now we basically do es 2.0 only).
The deficiency with the canvas approach compared to java 2D is that the construction happens on a background thread but rasterization does not.
You can still use Java2D with FX exactly as you did with swing, as buffered images can be fed to the fx scene graph.
More information about the openjfx-dev