app: cache result of floating selections

Use an output cache for floating-selection filters, to speed up
anchoring.

(cherry picked from commit 3f45e893bf)
This commit is contained in:
Ell
2018-12-28 03:31:27 -05:00
parent 20d6db79c2
commit 8415bc7d94
2 changed files with 6 additions and 11 deletions

View File

@ -208,7 +208,9 @@ _gimp_drawable_add_floating_sel_filter (GimpDrawable *drawable)
gegl_node_add_child (node, fs_source);
private->fs_applicator = gimp_applicator_new (node, FALSE, FALSE);
private->fs_applicator = gimp_applicator_new (node, FALSE, TRUE);
gimp_filter_set_applicator (private->fs_filter, private->fs_applicator);
private->fs_crop_node =
gegl_node_new_child (node,

View File

@ -132,19 +132,12 @@ floating_sel_anchor (GimpLayer *layer)
NULL, NULL, NULL, NULL))
{
filter = gimp_drawable_get_floating_sel_filter (drawable);
g_object_ref (filter);
}
/* first remove the filter, then merge it, or we will get warnings
* about already connected nodes
*/
gimp_image_remove_layer (image, layer, TRUE, NULL);
if (filter)
{
gimp_drawable_merge_filter (drawable, filter, NULL, NULL, FALSE);
g_object_unref (filter);
}
gimp_drawable_merge_filter (drawable, filter, NULL, NULL, FALSE);
gimp_image_remove_layer (image, layer, TRUE, NULL);
gimp_image_undo_group_end (image);