GNOME Bugzilla – Bug 762987
Short circuit gegl_node_connect_from if the nodes are already connected
Last modified: 2016-03-05 17:26:23 UTC
Reading the gegl_node_connect_from implementation, I see that we needlessly disconnect and invalidate the nodes even if they were already connected as desired. Would be nice if we were smart about this instead of expecting applications to be more careful.
Created attachment 322860 [details] [review] GeglNode: Clean up
Created attachment 322861 [details] [review] Short circuit gegl_node_connect_from if the nodes are already connected
Created attachment 322865 [details] [review] Short circuit gegl_node_connect_from if the nodes are already connected
I have also pushed the patches to gegl:wip/rishi/node-connect
Created attachment 323071 [details] [review] Short circuit gegl_node_connect_from if the nodes are already connected Compare other_pad with source_pad, not sink_pad.
Definetely desirable - and doesn't seem to cause any regression - pushed to master.
Created attachment 323119 [details] [review] tests: Re-connecting connected nodes should not cause invalidation
commit bb8fe84f2801cf20f91a0c4c849022c9f4125808 Author: Debarshi Ray <debarshir@gnome.org> Date: Wed Mar 2 14:25:12 2016 +0100 Short circuit gegl_node_connect_from if the nodes are already connected This avoids a needless invalidation when the parameters are already connected as desired. https://bugzilla.gnome.org/show_bug.cgi?id=762987 commit 6c3efef409e09325cfb4d21c5f50e82582c95bc0 Author: Debarshi Ray <debarshir@gnome.org> Date: Wed Mar 2 14:22:16 2016 +0100 GeglNode: Clean up Since gegl_node_pads_exist already logs a WARNING when the pads can't be found, there is no need to log another one in the caller. This will also help us short gegl_node_connect_from when its parameters are already connected, and avoid a needless invalidation. https://bugzilla.gnome.org/show_bug.cgi?id=762987
From #gegl on GIMPNet: <pippin> rishi: feel free to push the test to master as well :)
commit 77a34a29e8e6db876cbc9b1d169ba2ceeefaf43c Author: Debarshi Ray <debarshir@gnome.org> Date: Fri Mar 4 18:55:20 2016 +0100 tests: Re-connecting connected nodes should not cause invalidation https://bugzilla.gnome.org/show_bug.cgi?id=762987