2010/3/23 Krzysztof KosiĆski <tweenk.pl@...400...>:
- Currently there are actually two different canvas, with one drawing
into an item of the other: SPCanvas uses a special item, SPCanvasArena, to display an NRArena with all NRArenaItems. I think this could be unified and NRArena should be just a group.
I'm not sure it is a good idea. The canvas and arena being different classes is very logical (image itself vs. auxiliary editing aids) and practically useful (those that only need a rendition of SVG can only create an arena and never worry about the canvas with its tiling machinery). Yes, there's some similarity between them, but not much, and a lot more subtle differences that would be a nightmare to reconciliate.
- Every canvas and arena item can receive events. This is useful when
implementing control points, but not for much else, and causes some slowdown when there are many complex paths, because on nearly every motion event the item under the cursor needs to be recalculated. I recall that when I profiled for slowdown in the new node tool, there was a nontrivial amount of time spent in children of pick_item on motion events. While the node tool obviously needs to do this, other tools like the selector don't - they only need to find the item under cursor on clicks.
No, actually it tracks it all the time because it changes the cursor over selectable objects, via enter/leave signals.
I propose to only pass events to items derived from a specific subclass, that register themselves in a geometric query structure when added to the canvas.
I agree some canvas items can be safely made insensitive to events, for example selection rectangle (if it's not already). But I doubt we will gain much performance on this - most canvas and arena items still have to be sensitive.
- In case this project is too ambitious for GSoC, its scope can be
reduced so that NRArena rendering is converted to use Cairo operations. Right now graphics are rendered into NRPixblocks.
Exactly, this was always my idea for this project since the very start. I can be your mentor again :) I'm not much of a guru on rendering and rasterization as such, but I have spent quite some time in arena/canvas code.