[gegl] buffer: Initialize revisions inside gegl_tile_new(), not outside



commit 512dd91ab03bc4b92160884c2e602852048a8dbb
Author: Martin Nordholts <martinn src gnome org>
Date:   Fri Jul 23 14:11:12 2010 +0200

    buffer: Initialize revisions inside gegl_tile_new(), not outside

 gegl/buffer/gegl-tile-backend-ram.c     |    4 +---
 gegl/buffer/gegl-tile-backend-tiledir.c |    4 +---
 gegl/buffer/gegl-tile-handler-zoom.c    |    2 --
 gegl/buffer/gegl-tile.c                 |    1 +
 4 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-backend-ram.c b/gegl/buffer/gegl-tile-backend-ram.c
index 30c22f7..147a5b7 100644
--- a/gegl/buffer/gegl-tile-backend-ram.c
+++ b/gegl/buffer/gegl-tile-backend-ram.c
@@ -155,9 +155,7 @@ get_tile (GeglTileSource *tile_store,
     if (!entry)
       return NULL;
 
-    tile             = gegl_tile_new (backend->tile_size);
-    tile->stored_rev = 1;
-    tile->rev        = 1;
+    tile = gegl_tile_new (backend->tile_size);
 
     ram_entry_read (tile_backend_ram, entry, tile->data);
   }
diff --git a/gegl/buffer/gegl-tile-backend-tiledir.c b/gegl/buffer/gegl-tile-backend-tiledir.c
index 4e44f84..01b64b4 100644
--- a/gegl/buffer/gegl-tile-backend-tiledir.c
+++ b/gegl/buffer/gegl-tile-backend-tiledir.c
@@ -152,9 +152,7 @@ get_tile (GeglTileSource *tile_store,
     entry.y = y;
     entry.z = z;
 
-    tile             = gegl_tile_new (backend->tile_size);
-    tile->stored_rev = 1;
-    tile->rev        = 1;
+    tile = gegl_tile_new (backend->tile_size);
 
     gio_entry_read (tile_backend_tiledir, &entry, tile->data);
     return tile;
diff --git a/gegl/buffer/gegl-tile-handler-zoom.c b/gegl/buffer/gegl-tile-handler-zoom.c
index cc51b5c..b7be35f 100644
--- a/gegl/buffer/gegl-tile-handler-zoom.c
+++ b/gegl/buffer/gegl-tile-handler-zoom.c
@@ -260,8 +260,6 @@ get_tile (GeglTileSource *gegl_tile_source,
         tile->y          = y;
         tile->z          = z;
         tile->tile_storage = zoom->tile_storage;
-        tile->stored_rev = 1;
-        tile->rev        = 1;
 
         if (zoom->cache)
           gegl_tile_handler_cache_insert (zoom->cache, tile, x, y, z);
diff --git a/gegl/buffer/gegl-tile.c b/gegl/buffer/gegl-tile.c
index fafd1dd..4d0daa8 100644
--- a/gegl/buffer/gegl-tile.c
+++ b/gegl/buffer/gegl-tile.c
@@ -138,6 +138,7 @@ gegl_tile_new (gint size)
 
   tile->data       = gegl_malloc (size);
   tile->size       = size;
+  tile->rev        = 1;
   tile->stored_rev = 1;
 
   return tile;



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