GNOME Bugzilla – Bug 760628
Need a way for meta operations to know the bounding box of the input
Last modified: 2016-01-23 13:36:37 UTC
I have a meta-operation that composites a custom shadow/gradient over an input image. The meta-operation needs to know the bounding box of the input so that it can place the shadow/gradient over it and crop it around the edges. I expect to do this by setting the relevant co-ordinates on the shadow/gradient operation by looking at the input bounding box. Unfortunately, the prepare vfunc is not called for meta-operations. Therefore there is no good place to set the properties of the child operation. One workaround would be to copy/paste the compositor logic (ie. gegl:over, etc.) into the shadow/gradient operation and use relative co-ordinates instead. This is what gegl:vignette does. However, this is limiting because I can no longer mix and match different shadow/gradient operations with compositors easily.
Created attachment 319014 [details] [review] operations/common/load: Remove unused prepare implementation
Created attachment 319015 [details] [review] process: Call prepare for meta-ops
(In reply to Debarshi Ray from comment #2) > Created attachment 319015 [details] [review] [review] > process: Call prepare for meta-ops One sticking point with this approach is the locking. It is not clear to me what the GeglNode mutex is supposed to guard. As far as I can tell it guards the cache and its extents. If we lock the parent, then we will get into a deadlock if the parent's prepare function changes the properties of the child operations because that will cause the whole graph to be re-prepared and we will try to lock the mutex again. Maybe the answer is to use a recursive mutex? I don't know.
Comment on attachment 319014 [details] [review] operations/common/load: Remove unused prepare implementation I pushed this one because it's just dead code removal. It doesn't really change anything.
Created attachment 319588 [details] [review] process: Call prepare for meta-ops Bubble the prepare call upwards if there are nested meta-ops.