[gegl] buffer: mark non-empty duplicate tiles as dirty



commit 1b114921f1d2593dc8bc854d846d4711654bcc44
Author: Ell <ell_se yahoo com>
Date:   Mon Feb 26 05:08:12 2018 -0500

    buffer: mark non-empty duplicate tiles as dirty
    
    While duplicate tiles share the tile data in-memory, they are
    stored separately, hence (non-empty) duplicate tiles need to be
    marked as dirty upon creation, or else their data will be lost when
    stored, unless modified.

 gegl/buffer/gegl-tile.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile.c b/gegl/buffer/gegl-tile.c
index 52a1649..3392b49 100644
--- a/gegl/buffer/gegl-tile.c
+++ b/gegl/buffer/gegl-tile.c
@@ -140,6 +140,13 @@ gegl_tile_dup (GeglTile *src)
   tile->clone_state  = CLONE_STATE_CLONED;
   tile->n_clones     = src->n_clones;
 
+  /* if the tile is not empty, mark it as dirty, since, even though the in-
+   * memory tile data is shared with the source tile, the stored tile data is
+   * separate.
+   */
+  if (! tile->is_zero_tile)
+    tile->rev++;
+
   tile->destroy_notify      = src->destroy_notify;
   tile->destroy_notify_data = src->destroy_notify_data;
 


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