Commit 6a5b419b authored by Øyvind Kolås's avatar Øyvind Kolås

renamed to:

* gegl/buffer/gegl-tile-backend-gio-tiles.c:
* gegl/buffer/gegl-tile-backend-gio-tiles.h: renamed to:
* gegl/buffer/gegl-tile-backend-tiledir.c:
* gegl/buffer/gegl-tile-backend-tiledir.h:
* gegl/buffer/gegl-tile-backend-swapfile.c:
* gegl/buffer/gegl-tile-backend-swapfile.h: renamed to:
* gegl/buffer/gegl-tile-backend-file.c:
* gegl/buffer/gegl-tile-backend-file.h:
* gegl/buffer/Makefile.am:
* gegl/buffer/gegl-buffer-access.c:
* gegl/buffer/gegl-buffer-save.c:
* gegl/buffer/gegl-buffer-save.h:
* gegl/buffer/gegl-buffer.c: 
* gegl/buffer/gegl-tile-backend.h:
* gegl/buffer/gegl-tile-handler-cache.c:
* gegl/buffer/gegl-tile-source.h:
* gegl/buffer/gegl-tile-storage.c:  updated accordingly.

svn path=/trunk/; revision=2197
parent b10a8750
2008-04-18 Øyvind Kolås <pippin@gimp.org>
* gegl/buffer/gegl-tile-backend-gio-tiles.c:
* gegl/buffer/gegl-tile-backend-gio-tiles.h: renamed to:
* gegl/buffer/gegl-tile-backend-tiledir.c:
* gegl/buffer/gegl-tile-backend-tiledir.h:
* gegl/buffer/gegl-tile-backend-swapfile.c:
* gegl/buffer/gegl-tile-backend-swapfile.h: renamed to:
* gegl/buffer/gegl-tile-backend-file.c:
* gegl/buffer/gegl-tile-backend-file.h:
* gegl/buffer/Makefile.am:
* gegl/buffer/gegl-buffer-access.c:
* gegl/buffer/gegl-buffer-save.c:
* gegl/buffer/gegl-buffer-save.h:
* gegl/buffer/gegl-buffer.c:
* gegl/buffer/gegl-tile-backend.h:
* gegl/buffer/gegl-tile-handler-cache.c:
* gegl/buffer/gegl-tile-source.h:
* gegl/buffer/gegl-tile-storage.c: updated accordingly.
2008-04-18 Øyvind Kolås <pippin@gimp.org>
* gegl/gegl-utils.c: (gegl_malloc), (gegl_free): modified custom
......
......@@ -17,12 +17,12 @@ BUFFER_sources = \
gegl-tile-source.c \
gegl-tile-storage.c \
gegl-tile-backend.c \
gegl-tile-backend-swapfile.c \
gegl-tile-backend-gio-tiles.c \
gegl-tile-backend-file.c \
gegl-tile-backend-tiledir.c \
gegl-tile-backend-ram.c \
gegl-tile-handler.c \
gegl-tile-handler-chain.c \
gegl-tile-handler-cache.c \
gegl-tile-handler-chain.c \
gegl-tile-handler-empty.c \
gegl-tile-handler-log.c \
gegl-tile-handler-zoom.c \
......
......@@ -567,16 +567,13 @@ gegl_buffer_set (GeglBuffer *buffer,
if (format == NULL)
format = buffer->format;
/* FIXME: go through chain of sources up to but not including
* tile_storage and disassociated Sampler */
if (rect && rect->width == 1 && rect->height == 1) /* fast path */
{
pset (buffer, rect->x, rect->y, format, src);
}
/* FIXME: if rect->width == TILE_WIDTH and rect->height == TILE_HEIGHT and
* aligned with tile grid, do a fast path, also provide helper functions
* for getting the upper left coords of tiles.
* for figuring out how to align accesses with the tile grid.
*/
else if (rect == NULL)
{
......@@ -1095,9 +1092,9 @@ gegl_buffer_sample (GeglBuffer *buffer,
g_warning ("unimplemented interpolation type %i", interpolation);
}
buffer->sampler = g_object_new (interpolation_type,
"buffer", buffer,
"format", format,
NULL);
"buffer", buffer,
"format", format,
NULL);
gegl_sampler_prepare (buffer->sampler);
}
gegl_sampler_get (buffer->sampler, x, y, dest);
......
......@@ -155,7 +155,10 @@ gegl_buffer_save (GeglBuffer *buffer,
if (sizeof (GeglBufferFileHeader) != 256)
{
g_warning ("GeglBufferFileHeader is %i bytes, should be 256 padding is off by: %i bytes %i ints", (int) sizeof (GeglBufferFileHeader), (int) sizeof (GeglBufferFileHeader) - 256, (int) (sizeof (GeglBufferFileHeader) - 256) / 4);
g_warning ("GeglBufferFileHeader is %i bytes, should be 256 padding is off by: %i bytes %i ints",
(int) sizeof (GeglBufferFileHeader),
(int) sizeof (GeglBufferFileHeader) - 256,
(int)(sizeof (GeglBufferFileHeader) - 256) / 4);
return;
}
......@@ -251,8 +254,7 @@ gegl_buffer_save (GeglBuffer *buffer,
info->tiles = g_list_reverse (info->tiles);
}
/* FIXME: sort the index into Z-order */
/* sort the list of tiles into zorder */
info->tiles = g_list_sort (info->tiles, z_order_compare);
/* set the offset in the file each tile will be stored on */
......
......@@ -39,8 +39,10 @@ typedef struct {
gint x;
gint y;
gint z;
guint offset;
guint flags;
guint offset; /* offset into file */
guint flags; /* flags? not used? */
guint padding1[8];
} GeglTileEntry;
void gegl_buffer_save (GeglBuffer *buffer,
......
......@@ -309,6 +309,8 @@ gegl_buffer_tile_storage (GeglBuffer *buffer)
tmp = ((GeglTileHandler *) (tmp))->source;
} while (!GEGL_IS_TILE_STORAGE (tmp));
g_assert (tmp);
return (GeglTileStorage *) tmp;
}
......
......@@ -25,18 +25,16 @@
#include <glib-object.h>
#include "gegl-tile-backend.h"
#include "gegl-tile-backend-swapfile.h"
#include "gegl-tile-backend-file.h"
struct _GeglTileBackendSwapfile
struct _GeglTileBackendFile
{
GeglTileBackend parent_instance;
gchar *path;
GFile *file;
GOutputStream *o;
GInputStream *i;
/*gint fd;*/
gchar *path;
GFile *file;
GOutputStream *o;
GInputStream *i;
GHashTable *entries;
GSList *free_list;
guint next_unused;
......@@ -64,9 +62,9 @@ struct _DiskEntry
};
static void inline
disk_entry_read (GeglTileBackendSwapfile *disk,
DiskEntry *entry,
guchar *dest)
disk_entry_read (GeglTileBackendFile *disk,
DiskEntry *entry,
guchar *dest)
{
gint nleft;
gboolean success;
......@@ -101,9 +99,9 @@ disk_entry_read (GeglTileBackendSwapfile *disk,
}
static void inline
disk_entry_write (GeglTileBackendSwapfile *disk,
DiskEntry *entry,
guchar *source)
disk_entry_write (GeglTileBackendFile *disk,
DiskEntry *entry,
guchar *source)
{
gint nleft;
gboolean success;
......@@ -137,7 +135,7 @@ disk_entry_write (GeglTileBackendSwapfile *disk,
}
static inline DiskEntry *
disk_entry_new (GeglTileBackendSwapfile *disk)
disk_entry_new (GeglTileBackendFile *disk)
{
DiskEntry *self = g_slice_new (DiskEntry);
......@@ -165,8 +163,8 @@ disk_entry_new (GeglTileBackendSwapfile *disk)
}
static inline void
disk_entry_destroy (DiskEntry *entry,
GeglTileBackendSwapfile *disk)
disk_entry_destroy (DiskEntry *entry,
GeglTileBackendFile *disk)
{
disk->free_list = g_slist_prepend (disk->free_list,
GINT_TO_POINTER (entry->offset));
......@@ -177,7 +175,7 @@ disk_entry_destroy (DiskEntry *entry,
}
G_DEFINE_TYPE (GeglTileBackendSwapfile, gegl_tile_backend_swapfile, GEGL_TYPE_TILE_BACKEND)
G_DEFINE_TYPE (GeglTileBackendFile, gegl_tile_backend_file, GEGL_TYPE_TILE_BACKEND)
static GObjectClass * parent_class = NULL;
......@@ -187,7 +185,7 @@ static gint peak_allocs = 0;
static gint peak_disk_size = 0;
void
gegl_tile_backend_swapfile_stats (void)
gegl_tile_backend_file_stats (void)
{
g_warning ("leaked: %i chunks (%f mb) peak: %i (%i bytes %fmb))",
allocs, disk_size / 1024 / 1024.0,
......@@ -213,10 +211,10 @@ dbg_dealloc (gint size)
}
static inline DiskEntry *
lookup_entry (GeglTileBackendSwapfile *self,
gint x,
gint y,
gint z)
lookup_entry (GeglTileBackendFile *self,
gint x,
gint y,
gint z)
{
DiskEntry key = { x, y, z, 0 };
......@@ -236,13 +234,13 @@ get_tile (GeglTileSource *self,
{
GeglTileBackend *backend;
GeglTileBackendSwapfile *tile_backend_swapfile;
GeglTileBackendFile *tile_backend_file;
DiskEntry *entry;
GeglTile *tile = NULL;
backend = GEGL_TILE_BACKEND (self);
tile_backend_swapfile = GEGL_TILE_BACKEND_SWAPFILE (backend);
entry = lookup_entry (tile_backend_swapfile, x, y, z);
tile_backend_file = GEGL_TILE_BACKEND_FILE (backend);
entry = lookup_entry (tile_backend_file, x, y, z);
if (!entry)
return NULL;
......@@ -251,7 +249,7 @@ get_tile (GeglTileSource *self,
tile->stored_rev = 1;
tile->rev = 1;
disk_entry_read (tile_backend_swapfile, entry, tile->data);
disk_entry_read (tile_backend_file, entry, tile->data);
return tile;
}
......@@ -263,27 +261,27 @@ set_tile (GeglTileSource *self,
gint z)
{
GeglTileBackend *backend;
GeglTileBackendSwapfile *tile_backend_swapfile;
GeglTileBackendFile *tile_backend_file;
DiskEntry *entry;
backend = GEGL_TILE_BACKEND (self);
tile_backend_swapfile = GEGL_TILE_BACKEND_SWAPFILE (backend);
entry = lookup_entry (tile_backend_swapfile, x, y, z);
tile_backend_file = GEGL_TILE_BACKEND_FILE (backend);
entry = lookup_entry (tile_backend_file, x, y, z);
if (entry == NULL)
{
entry = disk_entry_new (tile_backend_swapfile);
entry = disk_entry_new (tile_backend_file);
entry->x = x;
entry->y = y;
entry->z = z;
g_hash_table_insert (tile_backend_swapfile->entries, entry, entry);
g_hash_table_insert (tile_backend_file->entries, entry, entry);
}
g_assert (tile->flags == 0); /* when this one is triggered, dirty pyramid data
has been tried written to persistent tile_storage.
*/
disk_entry_write (tile_backend_swapfile, entry, tile->data);
disk_entry_write (tile_backend_file, entry, tile->data);
tile->stored_rev = tile->rev;
return NULL;
}
......@@ -296,16 +294,16 @@ void_tile (GeglTileSource *self,
gint z)
{
GeglTileBackend *backend;
GeglTileBackendSwapfile *tile_backend_swapfile;
GeglTileBackendFile *tile_backend_file;
DiskEntry *entry;
backend = GEGL_TILE_BACKEND (self);
tile_backend_swapfile = GEGL_TILE_BACKEND_SWAPFILE (backend);
entry = lookup_entry (tile_backend_swapfile, x, y, z);
tile_backend_file = GEGL_TILE_BACKEND_FILE (backend);
entry = lookup_entry (tile_backend_file, x, y, z);
if (entry != NULL)
{
disk_entry_destroy (entry, tile_backend_swapfile);
disk_entry_destroy (entry, tile_backend_file);
}
return NULL;
......@@ -319,12 +317,12 @@ exist_tile (GeglTileSource *self,
gint z)
{
GeglTileBackend *backend;
GeglTileBackendSwapfile *tile_backend_swapfile;
GeglTileBackendFile *tile_backend_file;
DiskEntry *entry;
backend = GEGL_TILE_BACKEND (self);
tile_backend_swapfile = GEGL_TILE_BACKEND_SWAPFILE (backend);
entry = lookup_entry (tile_backend_swapfile, x, y, z);
tile_backend_file = GEGL_TILE_BACKEND_FILE (backend);
entry = lookup_entry (tile_backend_file, x, y, z);
return entry!=NULL?((gpointer)0x1):NULL;
}
......@@ -372,7 +370,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GeglTileBackendSwapfile *self = GEGL_TILE_BACKEND_SWAPFILE (object);
GeglTileBackendFile *self = GEGL_TILE_BACKEND_FILE (object);
switch (property_id)
{
......@@ -394,7 +392,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GeglTileBackendSwapfile *self = GEGL_TILE_BACKEND_SWAPFILE (object);
GeglTileBackendFile *self = GEGL_TILE_BACKEND_FILE (object);
switch (property_id)
{
......@@ -411,13 +409,18 @@ get_property (GObject *object,
static void
finalize (GObject *object)
{
GeglTileBackendSwapfile *self = (GeglTileBackendSwapfile *) object;
GeglTileBackendFile *self = (GeglTileBackendFile *) object;
g_hash_table_unref (self->entries);
g_object_unref (self->i);
g_object_unref (self->o);
/* check if we should nuke the buffer or not */
if(0)g_print ("finalizing buffer %s", self->path);
if (self->path)
g_free (self->path);
g_file_delete (self->file, NULL, NULL);
g_object_unref (self->file);
......@@ -468,34 +471,25 @@ equalfunc (gconstpointer a,
}
static GObject *
gegl_tile_backend_swapfile_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
gegl_tile_backend_file_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GeglTileBackendSwapfile *disk;
GeglTileBackendFile *disk;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
disk = GEGL_TILE_BACKEND_SWAPFILE (object);
disk = GEGL_TILE_BACKEND_FILE (object);
disk->file = g_file_new_for_commandline_arg (disk->path);
disk->o = G_OUTPUT_STREAM (g_file_replace (disk->file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL));
g_output_stream_flush (disk->o, NULL, NULL);
disk->i = G_INPUT_STREAM (g_file_read (disk->file, NULL, NULL));
/*disk->fd = g_open (disk->path,
O_CREAT | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR | O_DIRECT);*/
if (!disk->file)
{
/*gchar *name = g_filename_display_name (disk->path);
g_message ("Unable to open swap file '%s': %s\n"
"GEGL is unable to initialize virtual memory",
name, g_strerror (errno));
g_free (name);*/
g_warning ("Unable to open swap file '%s'\n",disk->path);
return NULL;
}
g_assert (disk->file);
g_assert (disk->i);
......@@ -507,7 +501,7 @@ gegl_tile_backend_swapfile_constructor (GType type,
}
static void
gegl_tile_backend_swapfile_class_init (GeglTileBackendSwapfileClass *klass)
gegl_tile_backend_file_class_init (GeglTileBackendFileClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GeglTileSourceClass *gegl_tile_source_class = GEGL_TILE_SOURCE_CLASS (klass);
......@@ -516,7 +510,7 @@ gegl_tile_backend_swapfile_class_init (GeglTileBackendSwapfileClass *klass)
gobject_class->get_property = get_property;
gobject_class->set_property = set_property;
gobject_class->constructor = gegl_tile_backend_swapfile_constructor;
gobject_class->constructor = gegl_tile_backend_file_constructor;
gobject_class->finalize = finalize;
gegl_tile_source_class->command = command;
......@@ -532,7 +526,7 @@ gegl_tile_backend_swapfile_class_init (GeglTileBackendSwapfileClass *klass)
}
static void
gegl_tile_backend_swapfile_init (GeglTileBackendSwapfile *self)
gegl_tile_backend_file_init (GeglTileBackendFile *self)
{
self->path = NULL;
self->file = NULL;
......
......@@ -16,33 +16,33 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#ifndef __GEGL_TILE_BACKEND_SWAPFILE_H__
#define __GEGL_TILE_BACKEND_SWAPFILE_H__
#ifndef __GEGL_TILE_BACKEND_FILE_H__
#define __GEGL_TILE_BACKEND_FILE_H__
#include "gegl-tile-backend.h"
G_BEGIN_DECLS
#define GEGL_TYPE_TILE_BACKEND_SWAPFILE (gegl_tile_backend_swapfile_get_type ())
#define GEGL_TILE_BACKEND_SWAPFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_TILE_BACKEND_SWAPFILE, GeglTileBackendSwapfile))
#define GEGL_TILE_BACKEND_SWAPFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_TILE_BACKEND_SWAPFILE, GeglTileBackendSwapfileClass))
#define GEGL_IS_TILE_BACKEND_SWAPFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_TILE_BACKEND_SWAPFILE))
#define GEGL_IS_TILE_BACKEND_SWAPFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_TILE_BACKEND_SWAPFILE))
#define GEGL_TILE_BACKEND_SWAPFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_TILE_BACKEND_SWAPFILE, GeglTileBackendSwapfileClass))
#define GEGL_TYPE_TILE_BACKEND_FILE (gegl_tile_backend_file_get_type ())
#define GEGL_TILE_BACKEND_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_TILE_BACKEND_FILE, GeglTileBackendFile))
#define GEGL_TILE_BACKEND_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_TILE_BACKEND_FILE, GeglTileBackendFileClass))
#define GEGL_IS_TILE_BACKEND_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_TILE_BACKEND_FILE))
#define GEGL_IS_TILE_BACKEND_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_TILE_BACKEND_FILE))
#define GEGL_TILE_BACKEND_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_TILE_BACKEND_FILE, GeglTileBackendFileClass))
typedef struct _GeglTileBackendSwapfile GeglTileBackendSwapfile;
typedef struct _GeglTileBackendSwapfileClass GeglTileBackendSwapfileClass;
typedef struct _GeglTileBackendFile GeglTileBackendFile;
typedef struct _GeglTileBackendFileClass GeglTileBackendFileClass;
struct _GeglTileBackendSwapfileClass
struct _GeglTileBackendFileClass
{
GeglTileBackendClass parent_class;
};
GType gegl_tile_backend_swapfile_get_type (void) G_GNUC_CONST;
GType gegl_tile_backend_file_get_type (void) G_GNUC_CONST;
void gegl_tile_backend_swapfile_stats (void);
void gegl_tile_backend_file_stats (void);
G_END_DECLS
......
......@@ -22,44 +22,16 @@
#include <string.h>
#include <errno.h>
#define _GNU_SOURCE /* for O_DIRECT */
#include <fcntl.h>
#ifndef O_DIRECT
#define O_DIRECT 0
#endif
#include "gegl-tile-backend.h"
#include "gegl-tile-backend-tiledir.h"
/* Microsoft Windows does distinguish between binary and text files.
* We deal with binary files here and have to tell it to open them
* as binary files. Unortunately the O_BINARY flag used for this is
* specific to this platform, so we define it for others.
*/
#ifndef O_BINARY
#define O_BINARY 0
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
#include <io.h>
#ifndef S_IRUSR
#define S_IRUSR _S_IREAD
#endif
#ifndef S_IWUSR
#define S_IWUSR _S_IWRITE
#endif
#define ftruncate(f,d) g_win32_ftruncate(f,d)
#endif
struct _GeglTileBackendTileDir
{
GeglTileBackend parent_instance;
#include "gegl-tile-backend.h"
#include "gegl-tile-backend-gio-tiles.h"
gchar *path; /* the base path of the buffer */
GFile *buffer_dir;
};
/* These entries are kept in RAM for now, they should be written as an
* index to the swap file, at a position specified by a header block,
......@@ -84,7 +56,7 @@ exist_tile (GeglTileSource *store,
gint y,
gint z);
static GFile *make_tile_file (GeglTileBackendGioTiles *gio,
static GFile *make_tile_file (GeglTileBackendTileDir *gio,
gint x,
gint y,
gint z)
......@@ -95,7 +67,7 @@ static GFile *make_tile_file (GeglTileBackendGioTiles *gio,
}
static void inline
gio_entry_read (GeglTileBackendGioTiles *gio,
gio_entry_read (GeglTileBackendTileDir *gio,
GioEntry *entry,
guchar *dest)
{
......@@ -117,7 +89,7 @@ gio_entry_read (GeglTileBackendGioTiles *gio,
}
static void inline
gio_entry_write (GeglTileBackendGioTiles *gio,
gio_entry_write (GeglTileBackendTileDir *gio,
GioEntry *entry,
guchar *source)
{
......@@ -140,7 +112,7 @@ gio_entry_write (GeglTileBackendGioTiles *gio,
}
G_DEFINE_TYPE (GeglTileBackendGioTiles, gegl_tile_backend_gio_tiles, GEGL_TYPE_TILE_BACKEND)
G_DEFINE_TYPE (GeglTileBackendTileDir, gegl_tile_backend_tile_dir, GEGL_TYPE_TILE_BACKEND)
static GObjectClass * parent_class = NULL;
static gint allocs = 0;
......@@ -149,7 +121,7 @@ static gint peak_allocs = 0;
static gint peak_gio_size = 0;
void
gegl_tile_backend_gio_tiles_stats (void)
gegl_tile_backend_tile_dir_stats (void)
{
g_warning ("leaked: %i chunks (%f mb) peak: %i (%i bytes %fmb))",
allocs, gio_size / 1024 / 1024.0,
......@@ -167,7 +139,7 @@ get_tile (GeglTileSource *tile_store,
gint y,
gint z)
{
GeglTileBackendGioTiles *tile_backend_gio_tiles = GEGL_TILE_BACKEND_GIO_TILES (tile_store);
GeglTileBackendTileDir *tile_backend_tile_dir = GEGL_TILE_BACKEND_TILE_DIR (tile_store);
GeglTileBackend *backend = GEGL_TILE_BACKEND (tile_store);
GeglTile *tile = NULL;
......@@ -179,7 +151,7 @@ get_tile (GeglTileSource *tile_store,
tile->stored_rev = 1;
tile->rev = 1;
gio_entry_read (tile_backend_gio_tiles, &entry, tile->data);
gio_entry_read (tile_backend_tile_dir, &entry, tile->data);
return tile;
}
return NULL;
......@@ -193,14 +165,14 @@ set_tile (GeglTileSource *store,
gint z)
{
GeglTileBackend *backend = GEGL_TILE_BACKEND (store);
GeglTileBackendGioTiles *tile_backend_gio_tiles = GEGL_TILE_BACKEND_GIO_TILES (backend);
GeglTileBackendTileDir *tile_backend_tile_dir = GEGL_TILE_BACKEND_TILE_DIR (backend);
GioEntry entry = {x,y,z};
g_assert (tile->flags == 0); /* when this one is triggered, dirty pyramid data
has been tried written to persistent tile_storage.
*/
gio_entry_write (tile_backend_gio_tiles, &entry, tile->data);
gio_entry_write (tile_backend_tile_dir, &entry, tile->data);
tile->stored_rev = tile->rev;
return NULL;
}
......@@ -213,7 +185,7 @@ void_tile (GeglTileSource *store,
gint z)
{
GeglTileBackend *backend = GEGL_TILE_BACKEND (store);
GeglTileBackendGioTiles *gio = GEGL_TILE_BACKEND_GIO_TILES (backend);
GeglTileBackendTileDir *gio = GEGL_TILE_BACKEND_TILE_DIR (backend);
GFile *file;
file = make_tile_file (gio, x, y, z);
......@@ -230,7 +202,7 @@ exist_tile (GeglTileSource *store,
gint z)
{
GeglTileBackend *backend = GEGL_TILE_BACKEND (store);
GeglTileBackendGioTiles *gio = GEGL_TILE_BACKEND_GIO_TILES (backend);
GeglTileBackendTileDir *gio = GEGL_TILE_BACKEND_TILE_DIR (backend);
GFileInfo *file_info;
GFile *file;
gboolean found = FALSE;
......@@ -294,7 +266,7 @@ set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GeglTileBackendGioTiles *self = GEGL_TILE_BACKEND_GIO_TILES (object);
GeglTileBackendTileDir *self = GEGL_TILE_BACKEND_TILE_DIR (object);
switch (property_id)
{
......@@ -316,7 +288,7 @@ get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GeglTileBackendGioTiles *self = GEGL_TILE_BACKEND_GIO_TILES (object);
GeglTileBackendTileDir *self = GEGL_TILE_BACKEND_TILE_DIR (object);
switch (property_id)
{
......@@ -333,7 +305,7 @@ get_property (GObject *object,
static void
finalize (GObject *object)
{
GeglTileBackendGioTiles *self = (GeglTileBackendGioTiles *) object;
GeglTileBackendTileDir *self = (GeglTileBackendTileDir *) object;
GFileEnumerator *enumerator;
GFileInfo *info;
......@@ -366,15 +338,15 @@ finalize (GObject *object)
}
static GObject *
gegl_tile_backend_gio_tiles_constructor (GType type,
gegl_tile_backend_tile_dir_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GeglTileBackendGioTiles *gio;
GeglTileBackendTileDir *gio;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
gio = GEGL_TILE_BACKEND_GIO_TILES (object);
gio = GEGL_TILE_BACKEND_TILE_DIR (object);
gio->buffer_dir = g_file_new_for_commandline_arg (gio->path);
g_file_make_directory (gio->buffer_dir, NULL, NULL);
......@@ -382,7 +354,7 @@ gegl_tile_backend_gio_tiles_constructor (GType type,
}
static void
gegl_tile_backend_gio_tiles_class_init (GeglTileBackendGioTilesClass *klass)
gegl_tile_backend_tile_dir_class_init (GeglTileBackendTileDirClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GeglTileSourceClass *gegl_tile_source_class = GEGL_TILE_SOURCE_CLASS (klass);
......@@ -391,7 +363,7 @@ gegl_tile_backend_gio_tiles_class_init (GeglTileBackendGioTilesClass *klass)
gobject_class->get_property = get_property;
gobject_class->set_property = set_property;
gobject_class->constructor = gegl_tile_backend_gio_tiles_constructor;
gobject_class->constructor = gegl_tile_backend_tile_dir_constructor;
gobject_class->finalize = finalize;
gegl_tile_source_class->command = command;
......@@ -407,7 +379,7 @@ gegl_tile_backend_gio_tiles_class_init (GeglTileBackendGioTilesClass *klass)
}
static void
gegl_tile_backend_gio_tiles_init (GeglTileBackendGioTiles *self)
gegl_tile_backend_tile_dir_init (GeglTileBackendTileDir *self)
{
self->path = NULL;
}
......@@ -16,40 +16,33 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/