API Review RT:17407 Canvas Node
Daniel Zwolenski
zonski at googlemail.com
Wed Apr 25 14:35:34 PDT 2012
Is the Canvas going to be noticeable less performant than, say, painting in Swing?
So for the things I listed would the recommendation be to use the Scene Graph and make everything out of Nodes, or use the new Canvas?
If we are meant to use Nodes it would be great to get a better understanding on how to optimize for performance with respect to non-visible nodes (eg create/destroy them or just keep them around) as well as good examples of mouse handling when there are lots of contained nodes within nodes within nodes. Eg could the document team put together a detailed sample/tutorial on building something like a CAD editor, with panning, zoom, drag and drop, shape connectors, scribble annotations, etc?
>> - a PDF viewer with ability to draw markup/scribble on it
>>
>> - a highly graphical custom component that looked like a 'clipboard' (actually a 'permit board' hanging from a wall)
>>
>> - a 'flingable' carousel of the above components that the user can horizontally flip through (touch screen)
>>
>> - a scrollable site map showing a schematic of an industrial site
>>
>> - annotated images (ie markup/scribble on photos taken)
>>
>> - simple CAD diagram rendering
>>
>> Most of these things _could_ be built using 'Nodes' in a Group but a canvas feels more natural and straight forward (eg mouse detection on a map). This could be because it's what I'm used to in Swing but either way I would have used Canvas if I had it.
>
> Just a quick note on this: don't expect great performance from immediate mode. I guarantee that on some platforms and chipsets such as PowerVR, immediate mode will be much slower. Also, we're not going to compute a damage rectangle to hand you, so you will have to manage your own dirty regions if you want to paint only a portion of the canvas. It really is intended only for specific drawing tasks which don't scale to a scene graph, such as particle systems or such things.
>
> Richard
More information about the openjfx-dev
mailing list