transform: sometimes do less work in gegl_transform_get_invalidated_by_change

As spotted by massimo in bug #694917 - the construction of this object is not
neccesary in the case where we return early (finding the context rect could
further also be special cased to always avoid the overhead of
constructing/destroying a gobject).
parent f5ccd4fc
......@@ -989,6 +989,12 @@ gegl_transform_get_invalidated_by_change (GeglOperation *op,
* to be enough.
*/
gegl_transform_create_composite_matrix (transform, &matrix);
if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&matrix))
return region;
sampler = gegl_buffer_sampler_new_at_level (NULL,
babl_format("RaGaBaA float"),
transform->sampler,
......@@ -996,12 +1002,6 @@ gegl_transform_get_invalidated_by_change (GeglOperation *op,
context_rect = *gegl_sampler_get_context_rect (sampler);
g_object_unref (sampler);
gegl_transform_create_composite_matrix (transform, &matrix);
if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&matrix))
return region;
/*
* Fatten (dilate) the input region by the context_rect.
*/
......
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