[gimp/gimp-2-10] app: in gimp_projection_chunk_render_start(), properly invalidate preview



commit dfc038e6509850338c99ce503d576b053ba8fb7d
Author: Ell <ell_se yahoo com>
Date:   Sat Jan 12 08:29:16 2019 -0500

    app: in gimp_projection_chunk_render_start(), properly invalidate preview
    
    In gimp_projection_chunk_render_start(), when the current
    projection rendering is complete, but not finalized yet, and no new
    rendering is started (since the current update region is empty),
    make sure to invalidate the projectable's preview, since it
    normally happens when rendering is finalized, which doesn't happen
    in this case.
    
    (cherry picked from commit 42845c9462821f0d95b002a8e44efe90e42fb173)

 app/core/gimpprojection.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 894e5907bd..d0a3037607 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -708,7 +708,8 @@ gimp_projection_flush_whenever (GimpProjection *proj,
 static void
 gimp_projection_chunk_render_start (GimpProjection *proj)
 {
-  cairo_region_t *region = proj->priv->update_region;
+  cairo_region_t *region             = proj->priv->update_region;
+  gboolean        invalidate_preview = FALSE;
 
   if (proj->priv->iter)
     {
@@ -716,6 +717,9 @@ gimp_projection_chunk_render_start (GimpProjection *proj)
 
       proj->priv->iter = NULL;
 
+      if (cairo_region_is_empty (region))
+        invalidate_preview = proj->priv->invalidate_preview;
+
       if (proj->priv->update_region)
         {
           cairo_region_union (region, proj->priv->update_region);
@@ -751,6 +755,16 @@ gimp_projection_chunk_render_start (GimpProjection *proj)
           g_source_remove (proj->priv->idle_id);
           proj->priv->idle_id = 0;
         }
+
+      if (invalidate_preview)
+        {
+          /* invalidate the preview here since it is constructed from
+           * the projection
+           */
+          proj->priv->invalidate_preview = FALSE;
+
+          gimp_projectable_invalidate_preview (proj->priv->projectable);
+        }
     }
 }
 


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