Commit 03141fc3 authored by Ell's avatar Ell

app: don't use mask sampler in gimp_pickable_contiguous_region_by_seed()

In gimp_pickable_contiguous_region_by_seed(), use gegl_buffer_get()
to sample the mask buffer, instead of using a sampler.  The sampler
is created at the beginning of the operation, and is subsequently
used after modifying the mask buffer, which should be avoided,
since the sampler may return outdated cached data.
parent 20f20dd7
......@@ -598,7 +598,6 @@ find_contiguous_region (GeglBuffer *src_buffer,
const Babl *mask_format = babl_format ("Y float");
GeglSampler *src_sampler;
GeglSampler *mask_sampler;
gint old_y;
gint start, end;
gint new_start, new_end;
......@@ -611,8 +610,6 @@ find_contiguous_region (GeglBuffer *src_buffer,
src_sampler = gegl_buffer_sampler_new (src_buffer,
mask_sampler = gegl_buffer_sampler_new (mask_buffer,
segment_queue = g_queue_new ();
......@@ -629,7 +626,9 @@ find_contiguous_region (GeglBuffer *src_buffer,
gfloat val;
gegl_sampler_get (mask_sampler, x, y, NULL, &val, GEGL_ABYSS_NONE);
gegl_buffer_get (mask_buffer, GEGL_RECTANGLE (x, y, 1, 1), 1.0,
mask_format, &val, GEGL_AUTO_ROWSTRIDE,
if (val != 0.0)
......@@ -690,7 +689,6 @@ find_contiguous_region (GeglBuffer *src_buffer,
g_queue_free (segment_queue);
g_object_unref (mask_sampler);
g_object_unref (src_sampler);
#ifdef FETCH_ROW
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment