[gimp/gimp-2-10] app: cache result of floating selections
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: cache result of floating selections
- Date: Fri, 28 Dec 2018 08:58:20 +0000 (UTC)
commit 8415bc7d94181d0ab1f2d30ac48e7e6a786b88ca
Author: Ell <ell_se yahoo com>
Date: Fri Dec 28 03:31:27 2018 -0500
app: cache result of floating selections
Use an output cache for floating-selection filters, to speed up
anchoring.
(cherry picked from commit 3f45e893bf5a9fe0908309a178c12bd486b3e308)
app/core/gimpdrawable-floating-selection.c | 4 +++-
app/core/gimplayer-floating-selection.c | 13 +++----------
2 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/app/core/gimpdrawable-floating-selection.c b/app/core/gimpdrawable-floating-selection.c
index 4cc381fb1f..9af4a457a1 100644
--- a/app/core/gimpdrawable-floating-selection.c
+++ b/app/core/gimpdrawable-floating-selection.c
@@ -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,
diff --git a/app/core/gimplayer-floating-selection.c b/app/core/gimplayer-floating-selection.c
index 4b4797f4fb..f43ce985b3 100644
--- a/app/core/gimplayer-floating-selection.c
+++ b/app/core/gimplayer-floating-selection.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]