Commit 904a35d7 authored by Michael Natterer's avatar Michael Natterer 😴

app: remove width, height from GimpDrawableUndo and GimpDrawable::swap_tiles()

because we always store/swap a buffer of the actual size now.
parent a0c1007b
......@@ -547,7 +547,8 @@ gimp_edit_fade (GimpImage *image,
pixel_region_init (&src2PR, src2_tiles,
0, 0,
undo->width, undo->height,
gegl_buffer_get_width (undo->buffer),
gegl_buffer_get_height (undo->buffer),
FALSE);
gimp_drawable_apply_region (drawable, &src2PR,
......
......@@ -166,9 +166,7 @@ static GeglNode * gimp_channel_get_node (GimpItem *item);
static void gimp_channel_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
gint y);
static gint gimp_channel_get_opacity_at (GimpPickable *pickable,
gint x,
......@@ -935,14 +933,11 @@ static void
gimp_channel_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height)
gint y)
{
gimp_drawable_invalidate_boundary (drawable);
GIMP_DRAWABLE_CLASS (parent_class)->swap_pixels (drawable, buffer,
x, y, width, height);
GIMP_DRAWABLE_CLASS (parent_class)->swap_pixels (drawable, buffer, x, y);
GIMP_CHANNEL (drawable)->bounds_known = FALSE;
}
......
......@@ -160,9 +160,7 @@ static void gimp_drawable_real_push_undo (GimpDrawable *drawable,
static void gimp_drawable_real_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
gint y);
static void gimp_drawable_sync_source_node (GimpDrawable *drawable,
gboolean detach_fs);
......@@ -885,8 +883,7 @@ gimp_drawable_real_push_undo (GimpDrawable *drawable,
gimp_image_undo_push_drawable (gimp_item_get_image (GIMP_ITEM (drawable)),
undo_desc, drawable,
buffer,
x, y, width, height);
buffer, x, y);
g_object_unref (buffer);
}
......@@ -895,11 +892,11 @@ static void
gimp_drawable_real_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height)
gint y)
{
GeglBuffer *tmp;
gint width = gegl_buffer_get_width (buffer);
gint height = gegl_buffer_get_height (buffer);
tmp = gimp_gegl_buffer_dup (buffer);
......@@ -1530,15 +1527,12 @@ void
gimp_drawable_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height)
gint y)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GEGL_IS_BUFFER (buffer));
GIMP_DRAWABLE_GET_CLASS (drawable)->swap_pixels (drawable, buffer,
x, y, width, height);
GIMP_DRAWABLE_GET_CLASS (drawable)->swap_pixels (drawable, buffer, x, y);
}
void
......
......@@ -105,9 +105,7 @@ struct _GimpDrawableClass
void (* swap_pixels) (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
gint y);
};
......@@ -195,9 +193,7 @@ GeglNode * gimp_drawable_get_mode_node (GimpDrawable *drawable);
void gimp_drawable_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
gint y);
void gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
......
......@@ -36,9 +36,7 @@ enum
PROP_0,
PROP_BUFFER,
PROP_X,
PROP_Y,
PROP_WIDTH,
PROP_HEIGHT
PROP_Y
};
......@@ -100,18 +98,6 @@ gimp_drawable_undo_class_init (GimpDrawableUndoClass *klass)
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_WIDTH,
g_param_spec_int ("width", NULL, NULL,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_HEIGHT,
g_param_spec_int ("height", NULL, NULL,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
......@@ -150,12 +136,6 @@ gimp_drawable_undo_set_property (GObject *object,
case PROP_Y:
drawable_undo->y = g_value_get_int (value);
break;
case PROP_WIDTH:
drawable_undo->width = g_value_get_int (value);
break;
case PROP_HEIGHT:
drawable_undo->height = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -182,12 +162,6 @@ gimp_drawable_undo_get_property (GObject *object,
case PROP_Y:
g_value_set_int (value, drawable_undo->y);
break;
case PROP_WIDTH:
g_value_set_int (value, drawable_undo->width);
break;
case PROP_HEIGHT:
g_value_set_int (value, drawable_undo->height);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -220,9 +194,7 @@ gimp_drawable_undo_pop (GimpUndo *undo,
gimp_drawable_swap_pixels (GIMP_DRAWABLE (GIMP_ITEM_UNDO (undo)->item),
drawable_undo->buffer,
drawable_undo->x,
drawable_undo->y,
drawable_undo->width,
drawable_undo->height);
drawable_undo->y);
}
static void
......
......@@ -39,8 +39,6 @@ struct _GimpDrawableUndo
GeglBuffer *buffer;
gint x;
gint y;
gint width;
gint height;
/* stuff for "Fade" */
TileManager *src2_tiles;
......
......@@ -211,9 +211,7 @@ gimp_image_undo_push_drawable (GimpImage *image,
GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height)
gint y)
{
GimpItem *item;
......@@ -232,8 +230,6 @@ gimp_image_undo_push_drawable (GimpImage *image,
"buffer", buffer,
"x", x,
"y", y,
"width", width,
"height", height,
NULL);
}
......
......@@ -61,9 +61,7 @@ GimpUndo * gimp_image_undo_push_drawable (GimpImage *image,
GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
gint y);
GimpUndo * gimp_image_undo_push_drawable_mod (GimpImage *image,
const gchar *undo_desc,
GimpDrawable *drawable,
......
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