app: in gimp_gegl_mask_bounds(), add support for arbitrary buffer extents

(cherry picked from commit 6df0be91ba)
This commit is contained in:
Ell
2019-09-05 17:37:34 +03:00
parent 16c676809c
commit f4b179c09e

View File

@ -32,7 +32,8 @@ gimp_gegl_mask_bounds (GeglBuffer *buffer,
gint *y2) gint *y2)
{ {
GeglBufferIterator *iter; GeglBufferIterator *iter;
GeglRectangle *roi; const GeglRectangle *extent;
const GeglRectangle *roi;
const Babl *format; const Babl *format;
gint bpp; gint bpp;
gint tx1, tx2, ty1, ty2; gint tx1, tx2, ty1, ty2;
@ -43,11 +44,13 @@ gimp_gegl_mask_bounds (GeglBuffer *buffer,
g_return_val_if_fail (x2 != NULL, FALSE); g_return_val_if_fail (x2 != NULL, FALSE);
g_return_val_if_fail (y2 != NULL, FALSE); g_return_val_if_fail (y2 != NULL, FALSE);
extent = gegl_buffer_get_extent (buffer);
/* go through and calculate the bounds */ /* go through and calculate the bounds */
tx1 = gegl_buffer_get_width (buffer); tx1 = extent->x + extent->width;
ty1 = gegl_buffer_get_height (buffer); ty1 = extent->y + extent->height;
tx2 = 0; tx2 = extent->x;
ty2 = 0; ty2 = extent->y;
format = gegl_buffer_get_format (buffer); format = gegl_buffer_get_format (buffer);
bpp = babl_format_get_bytes_per_pixel (format); bpp = babl_format_get_bytes_per_pixel (format);