[gimp/soc-2011-seamless-clone2] app: construct the image's first projection incrementally



commit f1c6a7d58911bda660bb397379fef480e1b086be
Author: Michael Natterer <mitch gimp org>
Date:   Sat Dec 15 19:33:21 2012 +0100

    app: construct the image's first projection incrementally
    
    just as all subsequent ones. Fixes potentially huge delay for new
    images, because we used to construct the entire projection in one go.

 app/core/gimpprojection.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 83f32fd..eb97f20 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -280,8 +280,17 @@ gimp_projection_get_buffer (GimpPickable *pickable)
 
       proj->validate_handler = gimp_tile_handler_projection_new (graph);
       gegl_buffer_add_handler (proj->buffer, proj->validate_handler);
-      gimp_tile_handler_projection_invalidate (proj->validate_handler,
-                                               0, 0, width, height);
+
+      /*  This used to call gimp_tile_handler_projection_invalidate()
+       *  which forced the entire projection to be constructed in one
+       *  go for new images, causing a potentially huge delay. Now we
+       *  initially validate stuff the normal way, which makes the
+       *  image appear incrementally, but it keeps everything
+       *  responsive.
+       */
+      gimp_projection_add_update_area (proj, 0, 0, width, height);
+      proj->invalidate_preview = TRUE;
+      gimp_projection_flush (proj);
     }
 
   return proj->buffer;


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