[gimp/goat-invasion: 278/418] app: switch to gegl_buffer_sample() in GimpOperationShapeburst



commit afb7f7d42fe8f980ac1eef432e83ec4a6c269bc8
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 27 09:52:10 2012 +0200

    app: switch to gegl_buffer_sample() in GimpOperationShapeburst
    
    and fix the progress fractions.

 app/gegl/gimpoperationshapeburst.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/gegl/gimpoperationshapeburst.c b/app/gegl/gimpoperationshapeburst.c
index af0dc2f..114ee9c 100644
--- a/app/gegl/gimpoperationshapeburst.c
+++ b/app/gegl/gimpoperationshapeburst.c
@@ -195,8 +195,6 @@ gimp_operation_shapeburst_process (GeglOperation       *operation,
   gfloat     *memory;
   gint        length;
   gint        i;
-  gint        max_progress = roi->width * roi->height;
-  gint        progress     = 0;
 
   length = roi->width + 1;
   memory = g_new (gfloat, length * 2);
@@ -239,17 +237,18 @@ gimp_operation_shapeburst_process (GeglOperation       *operation,
                 {
                   guchar src_uchar;
 
-#if 0
+#if 1
                   /* FIXME: this should be much faster, it converts
                    * to 32 bit rgba intermediately, bah...
                    */
                   gegl_buffer_sample (input, x, y, NULL, &src_uchar,
                                       input_format,
                                       GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
-#endif
+#else
                   gegl_buffer_get (input, GIMP_GEGL_RECT (x, y, 1, 1), 1.0,
                                    input_format, &src_uchar,
                                    GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
+#endif
 
                   src = src_uchar;
 
@@ -304,9 +303,8 @@ gimp_operation_shapeburst_process (GeglOperation       *operation,
       distp_prev = distp_cur;
       distp_cur = tmp;
 
-      progress += roi->height;
       g_object_set (operation,
-                    "progress", (gdouble) progress / max_progress,
+                    "progress", (gdouble) i / roi->height,
                     NULL);
     }
 



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