[gegl] Fixed error causing blitting to fail when only aux was connected to svg blend operations, and visual



commit 4c467b758bdfdd8ce61bf6a3e17739bec5afd9a1
Author: Isaac Wagner <isaacbw src gnome org>
Date:   Sun Aug 19 03:52:50 2012 -0400

    Fixed error causing blitting to fail when only aux was connected to svg blend operations, and visual artifacts to occur when only the input was connected

 operations/generated/color-burn.c    |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/color-dodge.c   |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/darken.c        |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/difference.c    |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/exclusion.c     |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/hard-light.c    |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/lighten.c       |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/overlay.c       |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/plus.c          |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/screen.c        |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/soft-light.c    |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/svg-12-blend.rb |   52 ++++++++++++++++++++++++++++++++-
 operations/generated/svg-multiply.c  |   52 ++++++++++++++++++++++++++++++++-
 13 files changed, 650 insertions(+), 26 deletions(-)
---
diff --git a/operations/generated/color-burn.c b/operations/generated/color-burn.c
index 5151289..0dabf02 100644
--- a/operations/generated/color-burn.c
+++ b/operations/generated/color-burn.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -108,6 +155,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:color-burn";
diff --git a/operations/generated/color-dodge.c b/operations/generated/color-dodge.c
index aeef156..18d1f16 100644
--- a/operations/generated/color-dodge.c
+++ b/operations/generated/color-dodge.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -108,6 +155,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:color-dodge";
diff --git a/operations/generated/darken.c b/operations/generated/darken.c
index 2addc14..0335ff3 100644
--- a/operations/generated/darken.c
+++ b/operations/generated/darken.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:darken";
diff --git a/operations/generated/difference.c b/operations/generated/difference.c
index 1e8fc6c..26217c6 100644
--- a/operations/generated/difference.c
+++ b/operations/generated/difference.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:difference";
diff --git a/operations/generated/exclusion.c b/operations/generated/exclusion.c
index 12d3cb2..4dc154f 100644
--- a/operations/generated/exclusion.c
+++ b/operations/generated/exclusion.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:exclusion";
diff --git a/operations/generated/hard-light.c b/operations/generated/hard-light.c
index 5b2afb0..bcf5019 100644
--- a/operations/generated/hard-light.c
+++ b/operations/generated/hard-light.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -108,6 +155,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:hard-light";
diff --git a/operations/generated/lighten.c b/operations/generated/lighten.c
index fff5249..4da6c48 100644
--- a/operations/generated/lighten.c
+++ b/operations/generated/lighten.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:lighten";
diff --git a/operations/generated/overlay.c b/operations/generated/overlay.c
index 6652949..f3d1fd6 100644
--- a/operations/generated/overlay.c
+++ b/operations/generated/overlay.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -108,6 +155,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:overlay";
diff --git a/operations/generated/plus.c b/operations/generated/plus.c
index 01bd189..7fb9e35 100644
--- a/operations/generated/plus.c
+++ b/operations/generated/plus.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:plus";
diff --git a/operations/generated/screen.c b/operations/generated/screen.c
index d0bccd0..6201ffe 100644
--- a/operations/generated/screen.c
+++ b/operations/generated/screen.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:screen";
diff --git a/operations/generated/soft-light.c b/operations/generated/soft-light.c
index 1e7d19e..a8442c1 100644
--- a/operations/generated/soft-light.c
+++ b/operations/generated/soft-light.c
@@ -53,6 +53,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -67,8 +114,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -111,6 +158,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   gegl_operation_class_set_keys (operation_class,
diff --git a/operations/generated/svg-12-blend.rb b/operations/generated/svg-12-blend.rb
index fb4effd..013b4e8 100755
--- a/operations/generated/svg-12-blend.rb
+++ b/operations/generated/svg-12-blend.rb
@@ -92,6 +92,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -106,8 +153,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 '
 
 file_tail1 = '
@@ -124,6 +171,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 '
 
diff --git a/operations/generated/svg-multiply.c b/operations/generated/svg-multiply.c
index 30de1fd..d19d135 100644
--- a/operations/generated/svg-multiply.c
+++ b/operations/generated/svg-multiply.c
@@ -52,6 +52,53 @@ static void prepare (GeglOperation *operation)
   gegl_operation_set_format (operation, "output", format);
 }
 
+/* Fast paths */
+static gboolean operation_process (GeglOperation        *operation,
+                                   GeglOperationContext *context,
+                                   const gchar          *output_prop,
+                                   const GeglRectangle  *result,
+                                   gint                  level)
+{
+  GeglOperationClass  *operation_class;
+  gpointer input, aux;
+  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+
+  /* get the raw values this does not increase the reference count */
+  input = gegl_operation_context_get_object (context, "input");
+  aux = gegl_operation_context_get_object (context, "aux");
+
+  /* pass the input/aux buffers directly through if they are alone*/
+  {
+    const GeglRectangle *in_extent = NULL;
+    const GeglRectangle *aux_extent = NULL;
+
+    if (input)
+      in_extent = gegl_buffer_get_abyss (input);
+
+    if ((!input ||
+        (aux && !gegl_rectangle_intersect (NULL, in_extent, result))))
+      {
+         gegl_operation_context_take_object (context, "output",
+                                             g_object_ref (aux));
+         return TRUE;
+      }
+    if (aux)
+      aux_extent = gegl_buffer_get_abyss (aux);
+
+    if (!aux ||
+        (input && !gegl_rectangle_intersect (NULL, aux_extent, result)))
+      {
+        gegl_operation_context_take_object (context, "output",
+                                            g_object_ref (input));
+        return TRUE;
+      }
+  }
+  /* chain up, which will create the needed buffers for our actual
+   * process function
+   */
+  return operation_class->process (operation, context, output_prop, result, level);
+}
+
 static gboolean
 process (GeglOperation       *op,
          void                *in_buf,
@@ -66,8 +113,8 @@ process (GeglOperation       *op,
   gfloat * GEGL_ALIGNED out = out_buf;
   gint    i;
 
-  if (aux==NULL)
-    return TRUE;
+  if(aux == NULL)
+     return TRUE;
 
   for (i = 0; i < n_pixels; i++)
     {
@@ -105,6 +152,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
 
   point_composer_class->process = process;
+  operation_class->process = operation_process;
   operation_class->prepare = prepare;
 
   operation_class->compat_name = "gegl:svg-multiply";



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