[gimp] app: temp HACK: provide an "RaGaBaA float" buffer to gegl:transform



commit 3d8341b6e8e5bb767c80d205bd3fe37b93fc8009
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 27 14:46:42 2012 +0100

    app: temp HACK: provide an "RaGaBaA float" buffer to gegl:transform
    
    so we can quickly test the effects proper caching in GEGL itself would
    have.

 app/core/gimpdrawable-transform.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c
index 21ed0e3..2eff8c8 100644
--- a/app/core/gimpdrawable-transform.c
+++ b/app/core/gimpdrawable-transform.c
@@ -134,11 +134,31 @@ gimp_drawable_transform_buffer_affine (GimpDrawable           *drawable,
   gimp_matrix3_mult (&inv, &gegl_matrix);
   gimp_matrix3_translate (&gegl_matrix, -x1, -y1);
 
+  /*  Experimental HACK to check the performance improvement of having
+   *  the transform op's input cached in the right format
+   */
+  if (gegl_buffer_get_format (orig_buffer) == babl_format ("RaGaBaA float"))
+    {
+      g_object_ref (orig_buffer);
+    }
+  else
+    {
+      GeglBuffer *temp =
+        gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                         gegl_buffer_get_width  (orig_buffer),
+                                         gegl_buffer_get_height (orig_buffer)),
+                         babl_format ("RaGaBaA float"));
+      gegl_buffer_copy (orig_buffer, NULL, temp, NULL);
+      orig_buffer = temp;
+    }
+
   gimp_gegl_apply_transform (orig_buffer, progress, NULL,
                              new_buffer,
                              interpolation_type,
                              &gegl_matrix);
 
+  g_object_unref (orig_buffer);
+
   *new_offset_x = x1;
   *new_offset_y = y1;
 



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