Commit b4ee9ff0 authored by Ell's avatar Ell

app: add gimp_tile_handler_validate_buffer_set_extent()

... which sets the extent of a buffer with an assigned
GimpTileHandlerValidate, clipping the dirty region to the new
extent.
parent 90610ac8
......@@ -26,6 +26,7 @@
#include "gimp-gegl-types.h"
#include "gimp-gegl-loops.h"
#include "gimp-gegl-utils.h"
#include "gimptilehandlervalidate.h"
......@@ -560,6 +561,30 @@ gimp_tile_handler_validate_validate (GimpTileHandlerValidate *validate,
}
}
gboolean
gimp_tile_handler_validate_buffer_set_extent (GeglBuffer *buffer,
const GeglRectangle *extent)
{
GimpTileHandlerValidate *validate;
g_return_val_if_fail (GEGL_IS_BUFFER (buffer), FALSE);
g_return_val_if_fail (extent != NULL, FALSE);
validate = gimp_tile_handler_validate_get_assigned (buffer);
g_return_val_if_fail (validate != NULL, FALSE);
if (gimp_gegl_buffer_set_extent (buffer, extent))
{
cairo_region_intersect_rectangle (validate->dirty_region,
(const cairo_rectangle_int_t *) extent);
return TRUE;
}
return FALSE;
}
void
gimp_tile_handler_validate_buffer_copy (GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
......
......@@ -69,33 +69,36 @@ struct _GimpTileHandlerValidateClass
};
GType gimp_tile_handler_validate_get_type (void) G_GNUC_CONST;
GType gimp_tile_handler_validate_get_type (void) G_GNUC_CONST;
GeglTileHandler * gimp_tile_handler_validate_new (GeglNode *graph);
GeglTileHandler * gimp_tile_handler_validate_new (GeglNode *graph);
void gimp_tile_handler_validate_assign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
void gimp_tile_handler_validate_unassign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
GimpTileHandlerValidate * gimp_tile_handler_validate_get_assigned (GeglBuffer *buffer);
void gimp_tile_handler_validate_assign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
void gimp_tile_handler_validate_unassign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
GimpTileHandlerValidate * gimp_tile_handler_validate_get_assigned (GeglBuffer *buffer);
void gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
const GeglRectangle *rect);
void gimp_tile_handler_validate_undo_invalidate (GimpTileHandlerValidate *validate,
const GeglRectangle *rect);
void gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
const GeglRectangle *rect);
void gimp_tile_handler_validate_undo_invalidate (GimpTileHandlerValidate *validate,
const GeglRectangle *rect);
void gimp_tile_handler_validate_begin_validate (GimpTileHandlerValidate *validate);
void gimp_tile_handler_validate_end_validate (GimpTileHandlerValidate *validate);
void gimp_tile_handler_validate_begin_validate (GimpTileHandlerValidate *validate);
void gimp_tile_handler_validate_end_validate (GimpTileHandlerValidate *validate);
void gimp_tile_handler_validate_validate (GimpTileHandlerValidate *validate,
GeglBuffer *buffer,
const GeglRectangle *rect,
gboolean intersect);
void gimp_tile_handler_validate_validate (GimpTileHandlerValidate *validate,
GeglBuffer *buffer,
const GeglRectangle *rect,
gboolean intersect);
void gimp_tile_handler_validate_buffer_copy (GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
GeglBuffer *dst_buffer,
const GeglRectangle *dst_rect);
gboolean gimp_tile_handler_validate_buffer_set_extent (GeglBuffer *buffer,
const GeglRectangle *extent);
void gimp_tile_handler_validate_buffer_copy (GeglBuffer *src_buffer,
const GeglRectangle *src_rect,
GeglBuffer *dst_buffer,
const GeglRectangle *dst_rect);
G_END_DECLS
......
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