GNOME Bugzilla – Bug 761495
Don't invalidate the source when connecting two nodes
Last modified: 2016-03-05 17:26:13 UTC
Right now, connecting a source to a sink will invalidate both the source and sink. I can understand the sink being invalidated, but don't see why the source should be affected. My understanding of the code is that, while the intention was to only invalidate the sink, the source is also getting affected as an unforeseen side-effect. It uses gegl_node_source_invalidated to handle real_source::invalidated, whose job is to invalidate the sink when the source gets invalidated. Then, it calls gegl_node_property_changed to force the source to be invalidated so that it triggers gegl_node_source_invalidated to invalidate the sink. We can just directly calling gegl_node_source_invalidated, instead of doing this in a roundabout way. Also, I noticed that the use of gegl_node_property_changed doesn't match the comments in its definition. Supposedly the arg1==NULL code path is meant to handle operation changes. However, gegl_node_set_operation_object doesn't pass NULL. The only time NULL was being passed was during connection (see above), which, according to me, should be removed.
Created attachment 320331 [details] [review] GeglNode: Don't invalidate the source when connecting two nodes
From #gegl on GIMPNet: 15:28 <pippin> rishi: going to build gegl and gimp and do some minimal tests with your 761495 change :) 15:30 <rishi> Ok. 15:51 <rishi> pippin: I needed that fix to implement crossfades for point filters. 15:51 <rishi> Working on a rubber band animation for cropping now. 15:52 <pippin> sounds like it might fix the dragging preview curtain in gimp as well :) 15:52 <rishi> I don't know what "dragging preview curtain" is, but sounds good. 15:54 <pippin> the ability to have a split-view, with and without applied filter, and drag it back and forth to reposition it 15:56 <pippin> rishi: looks good to me, please push to master so it gets wider test coverage in gimp for different scenarios :)
commit 38ec4ac246039a7b870fd7e121b57d22d274ba97 Author: Debarshi Ray <debarshir@gnome.org> Date: Wed Feb 3 13:38:35 2016 +0100 GeglNode: Don't invalidate the source when connecting two nodes https://bugzilla.gnome.org/show_bug.cgi?id=761495
Created attachment 323120 [details] [review] tests: Sources shouldn't be invalidated when connecting & disconnecting
From #gegl on GIMPNet: <pippin> rishi: feel free to push the test to master as well :)
commit 889d0fd8f8c8bea47c93a1c24cd4964483c98e79 Author: Debarshi Ray <debarshir@gnome.org> Date: Fri Mar 4 19:14:20 2016 +0100 tests: Sources shouldn't be invalidated when connecting & disconnecting https://bugzilla.gnome.org/show_bug.cgi?id=761495