GNOME Bugzilla – Bug 638462
[patch] need not realize items for anti-aliased canvas
Last modified: 2014-08-02 12:52:24 UTC
As far as I can tell (by looking at a small sample of the render() methods), the anti-aliased version of GnomeCanvasItem does not need gdk graphics contexts. However, the items realize() methods do allocate one. In my use case, Xournal, all strokes needlessly allocate a gc. Since the number of strokes can easily reach into the 10,000s, this gives immense performance difficulties. When editing files of moderate size (say 20 pages), Xournal becomes unusable. The attached, one-line patch solves this. I haven't run into any trouble with it when using Xournal. I will try to get some testing with other applications using an anti-aliased canvas. Perhaps someone familiar with the inner workings of the canvas can judge whether it is safe to commit. Here's the original bug on Launchpad: https://bugs.launchpad.net/ubuntu/+source/libgnomecanvas/+bug/657783
You might want to take a look at the copy of libgnomecanvas that's in evolution. This has been adapted to the new drawing api in the latest gtk+ and doesn't use GdkGC at all...
Thanks for your response. I just compiled the new version of libgnomecanvas that's in the evolution tree. However, it contains API changes as well (for example, no more GnomeCanvasPoints, no more gnome_canvas_new_aa() ) so I cannot easily test it in my use case. What are the plans for libgnomecanvas? This new version is somewhat integrated with the rest of evolution, using code from e_util for instance. Will there be new releases with the old api? If so, my patch may be relevant for those.
> What are the plans for libgnomecanvas? It's dead.
The last libgnomecanvas code changes took place in January 2011: https://git.gnome.org/browse/archive/libgnomecanvas/log/ This project is not under active development anymore. This project got recently archived in GNOME Git. It is currently unlikely that there will be any further active development. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again. If you are interested in maintainership, inform https://mail.gnome.org/mailman/listinfo/desktop-devel-list