[gimp] Revert "core: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer"
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Revert "core: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer"
- Date: Mon, 8 Apr 2013 00:36:16 +0000 (UTC)
commit d53deda61bf60535a8505b7f6e6e37d28f405925
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 8 02:34:56 2013 +0200
Revert "core: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer"
This reverts commit c204b0ac413539ee763483970a64eb437a43de3f, it's
a nice speedup we should keep, but we can't return a GimpChannel
of != image precision from that function. Needs more thinking.
app/core/gimpimage-contiguous-region.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/app/core/gimpimage-contiguous-region.c b/app/core/gimpimage-contiguous-region.c
index f16ba88..64edbbc 100644
--- a/app/core/gimpimage-contiguous-region.c
+++ b/app/core/gimpimage-contiguous-region.c
@@ -113,10 +113,11 @@ gimp_image_contiguous_region_by_seed (GimpImage *image,
src_buffer = gimp_pickable_get_buffer (pickable);
- mask_buffer = gegl_buffer_new (gegl_buffer_get_extent (src_buffer),
- babl_format ("Y float"));
+ mask = gimp_channel_new_mask (image,
+ gegl_buffer_get_width (src_buffer),
+ gegl_buffer_get_height (src_buffer));
- gegl_buffer_clear (mask_buffer, NULL);
+ mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
gegl_buffer_sample (src_buffer, x, y, NULL, start_col, src_format,
GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
@@ -144,15 +145,6 @@ gimp_image_contiguous_region_by_seed (GimpImage *image,
antialias, threshold,
x, y, start_col);
- /* wrap mask_buffer in a drawable and return it */
- mask = gimp_channel_new_mask (image,
- gegl_buffer_get_width (mask_buffer),
- gegl_buffer_get_height (mask_buffer));
-
- gimp_drawable_set_buffer (GIMP_DRAWABLE (mask), FALSE, "", mask_buffer);
-
- g_object_unref (mask_buffer);
-
return mask;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]