Commit 12f920d8 authored by Michael Natterer's avatar Michael Natterer 😴

app: change GimpTileHandlerValidate's API to use GeglRectangle

instead of x, y, width, height.
parent bf6c3cb4
......@@ -943,14 +943,14 @@ gimp_projection_paint_area (GimpProjection *proj,
{
if (proj->priv->validate_handler)
gimp_tile_handler_validate_invalidate (proj->priv->validate_handler,
x, y, w, h);
GEGL_RECTANGLE (x, y, w, h));
if (now)
{
GeglNode *graph = gimp_projectable_get_graph (proj->priv->projectable);
if (proj->priv->validate_handler)
gimp_tile_handler_validate_undo_invalidate (proj->priv->validate_handler,
x, y, w, h);
GEGL_RECTANGLE (x, y, w, h));
gegl_node_blit_buffer (graph, proj->priv->buffer,
GEGL_RECTANGLE (x, y, w, h), 0, GEGL_ABYSS_NONE);
......
......@@ -361,24 +361,23 @@ gimp_tile_handler_validate_assign (GimpTileHandlerValidate *validate,
void
gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
gint x,
gint y,
gint width,
gint height)
GeglRectangle *rect)
{
cairo_rectangle_int_t rect = { x, y, width, height };
g_return_if_fail (GIMP_IS_TILE_HANDLER_VALIDATE (validate));
g_return_if_fail (rect != NULL);
cairo_region_union_rectangle (validate->dirty_region, &rect);
cairo_region_union_rectangle (validate->dirty_region,
(cairo_rectangle_int_t *) rect);
if (validate->max_z > 0)
{
GeglTileSource *source = GEGL_TILE_SOURCE (validate);
gint tile_x1 = x / validate->tile_width;
gint tile_y1 = y / validate->tile_height;
gint tile_x2 = (x + width - 1) / validate->tile_width + 1;
gint tile_y2 = (y + height - 1) / validate->tile_height + 1;
gint tile_x1 = rect->x / validate->tile_width;
gint tile_y1 = rect->y / validate->tile_height;
gint tile_x2 = (rect->x + rect->width - 1) /
validate->tile_width + 1;
gint tile_y2 = (rect->y + rect->height - 1) /
validate->tile_height + 1;
gint tile_x;
gint tile_y;
gint tile_z;
......@@ -399,14 +398,11 @@ gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
void
gimp_tile_handler_validate_undo_invalidate (GimpTileHandlerValidate *validate,
gint x,
gint y,
gint width,
gint height)
GeglRectangle *rect)
{
cairo_rectangle_int_t rect = { x, y, width, height };
g_return_if_fail (GIMP_IS_TILE_HANDLER_VALIDATE (validate));
g_return_if_fail (rect != NULL);
cairo_region_subtract_rectangle (validate->dirty_region, &rect);
cairo_region_subtract_rectangle (validate->dirty_region,
(cairo_rectangle_int_t *) rect);
}
......@@ -71,15 +71,9 @@ void gimp_tile_handler_validate_assign (GimpTileHandlerValidate
GeglBuffer *buffer);
void gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
gint x,
gint y,
gint width,
gint height);
GeglRectangle *rect);
void gimp_tile_handler_validate_undo_invalidate (GimpTileHandlerValidate *validate,
gint x,
gint y,
gint width,
gint height);
GeglRectangle *rect);
G_END_DECLS
......
......@@ -1856,9 +1856,9 @@ gradient_map_new (GimpPickable *pickable)
buffer);
gimp_tile_handler_validate_invalidate (GIMP_TILE_HANDLER_VALIDATE (handler),
0, 0,
gegl_buffer_get_width (buffer),
gegl_buffer_get_height (buffer));
GEGL_RECTANGLE (0, 0,
gegl_buffer_get_width (buffer),
gegl_buffer_get_height (buffer)));
g_object_unref (handler);
......
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