Index: gegl/operation/gegl-operation-area-filter.c =================================================================== --- gegl/operation/gegl-operation-area-filter.c (revision 1801) +++ gegl/operation/gegl-operation-area-filter.c (working copy) @@ -32,7 +32,7 @@ static GeglRectangle compute_input_reque const GeglRectangle *region); static GeglRectangle compute_affected_region (GeglOperation *operation, const gchar *input_pad, - GeglRectangle region); + const GeglRectangle *region); static void gegl_operation_area_filter_class_init (GeglOperationAreaFilterClass *klass) @@ -93,7 +93,7 @@ compute_input_request (GeglOperation gegl_rectangle_intersect (&rect, region, &defined); if (rect.width != 0 && - rect.height != 0) + rect.height != 0) { rect.x -= area->left; rect.y -= area->top; @@ -105,15 +105,17 @@ compute_input_request (GeglOperation } static GeglRectangle -compute_affected_region (GeglOperation *operation, - const gchar *input_pad, - GeglRectangle region) +compute_affected_region (GeglOperation *operation, + const gchar *input_pad, + const GeglRectangle *region) { GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation); + GeglRectangle retval; + + retval.x = region->x - area->left; + retval.y = region->y - area->top; + retval.width = region->width + area->left + area->right; + retval.height = region->height + area->top + area->bottom; - region.x -= area->left; - region.y -= area->top; - region.width += area->left + area->right; - region.height += area->top + area->bottom; - return region; + return retval; } Index: gegl/operation/gegl-operation.c =================================================================== --- gegl/operation/gegl-operation.c (revision 1801) +++ gegl/operation/gegl-operation.c (working copy) @@ -36,7 +36,7 @@ static void attach static GeglRectangle get_defined_region (GeglOperation *self); static GeglRectangle compute_affected_region (GeglOperation *self, const gchar *input_pad, - GeglRectangle region); + const GeglRectangle *region); static GeglRectangle compute_input_request (GeglOperation *self, const gchar *input_pad, const GeglRectangle *region); @@ -133,20 +133,27 @@ gegl_operation_get_defined_region (GeglO } GeglRectangle -gegl_operation_compute_affected_region (GeglOperation *self, - const gchar *input_pad, - GeglRectangle region) +gegl_operation_compute_affected_region (GeglOperation *self, + const gchar *input_pad, + const GeglRectangle *region) { - GeglOperationClass *klass = GEGL_OPERATION_GET_CLASS (self); + GeglOperationClass *klass; + GeglRectangle retval = { 0, }; - if (region.width == 0 || - region.height == 0) - return region; + g_return_val_if_fail (GEGL_IS_OPERATION (self), retval); + g_return_val_if_fail (input_pad != NULL, retval); + g_return_val_if_fail (region != NULL, retval); + + klass = GEGL_OPERATION_GET_CLASS (self); + + if (region->width == 0 || + region->height == 0) + return *region; if (klass->compute_affected_region) return klass->compute_affected_region (self, input_pad, region); - return region; + return *region; } static GeglRectangle @@ -363,9 +370,9 @@ get_defined_region (GeglOperation *self) } static GeglRectangle -compute_affected_region (GeglOperation *self, - const gchar *input_pad, - GeglRectangle region) +compute_affected_region (GeglOperation *self, + const gchar *input_pad, + const GeglRectangle *region) { if (self->node->is_graph) { @@ -374,7 +381,8 @@ compute_affected_region (GeglOperation * input_pad, region); } - return region; + + return *region; } void Index: gegl/operation/gegl-operation.h =================================================================== --- gegl/operation/gegl-operation.h (revision 1801) +++ gegl/operation/gegl-operation.h (working copy) @@ -87,9 +87,9 @@ struct _GeglOperationClass * graph. A default implementation of this, if not provided should probably * be to report that the entire defined region is dirtied. */ - GeglRectangle (*compute_affected_region) (GeglOperation *operation, - const gchar *input_pad, - GeglRectangle region); + GeglRectangle (*compute_affected_region) (GeglOperation *operation, + const gchar *input_pad, + const GeglRectangle *region); /* computes the rectangle needed to be correctly computed in a buffer * on the named input_pad, for a given result rectangle @@ -144,7 +144,7 @@ GeglNode * gegl_operation_get_sourc const gchar *pad_name); GeglRectangle gegl_operation_compute_affected_region (GeglOperation *operation, const gchar *input_pad, - GeglRectangle region); + const GeglRectangle *region); GeglRectangle gegl_operation_get_defined_region (GeglOperation *operation); GeglRectangle gegl_operation_adjust_result_region (GeglOperation *operation, const GeglRectangle *roi); Index: gegl/graph/gegl-node.c =================================================================== --- gegl/graph/gegl-node.c (revision 1801) +++ gegl/graph/gegl-node.c (working copy) @@ -519,7 +519,8 @@ source_invalidated (GeglNode *sourc if (destination->operation) { dirty_rect = gegl_operation_compute_affected_region (destination->operation, - gegl_pad_get_name (destination_pad), *rect); + gegl_pad_get_name (destination_pad), + rect); } else {