[gegl] operations/transform/transform-core: Avoid conversions in fast paths



commit 0f5af44eb86e12c6fec864fafac0f8dd644cfeb8
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Nov 23 13:03:17 2015 +0100

    operations/transform/transform-core: Avoid conversions in fast paths
    
    The fast paths either pass the input buffer on to the output (like
    gegl:nop), or create a shifted output buffer from the input. Hence,
    there is no need for any Babl format conversions.
    
    We don't need to check for the identity matrix because it is also a
    fast translate matrix. Add a comment to clarify that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758534

 operations/transform/transform-core.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index a207c9b..759b1f1 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -132,7 +132,11 @@ gegl_transform_prepare (GeglOperation *operation)
 
   gegl_transform_create_composite_matrix (transform, &matrix);
 
-  if (gegl_transform_matrix3_allow_fast_translate (&matrix))
+  /* The identity matrix is also a fast translate matrix. */
+  if (gegl_transform_is_intermediate_node (transform) ||
+      gegl_transform_matrix3_allow_fast_translate (&matrix) ||
+      (gegl_matrix3_is_translate (&matrix) &&
+       transform->sampler == GEGL_SAMPLER_NEAREST))
     {
       const Babl *fmt = gegl_operation_get_source_format (operation, "input");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]