Commit 426947bd authored by Øyvind Kolås's avatar Øyvind Kolås

made GeglTileStore become GeglTileProvider.

        
        * gegl/buffer/Makefile.am:
	* gegl/buffer/*.[ch]: 
	* gegl/graph/gegl-node.c:



svn path=/trunk/; revision=1605
parent f18cd7ca
2007-09-06 Øyvind Kolås <pippin@gimp.org>
Made GeglTileStore become GeglTileProvider.
* gegl/buffer/Makefile.am:
* gegl/buffer/*.[ch]:
* gegl/graph/gegl-node.c:
2007-09-06 Øyvind Kolås <pippin@gimp.org>
* gegl/buffer/Makefile.am:
......
......@@ -17,13 +17,13 @@ BUFFER_sources = \
gegl-tile-backend.c \
gegl-tile-disk.c \
gegl-tile-mem.c \
gegl-tile-store.c \
gegl-handler.c \
gegl-handlers.c \
gegl-handler-cache.c \
gegl-handler-empty.c \
gegl-handler-log.c \
gegl-handler-zoom.c
gegl-handler-zoom.c \
gegl-provider.c
BUFFER_headers = \
gegl-buffer-allocator.h \
......@@ -44,13 +44,13 @@ BUFFER_headers = \
gegl-tile-backend.h \
gegl-tile-disk.h \
gegl-tile-mem.h \
gegl-tile-store.h \
gegl-handler.h \
gegl-handlers.h \
gegl-handler-cache.h \
gegl-handler-empty.h \
gegl-handler-log.h \
gegl-handler-zoom.h
gegl-handler-zoom.h \
gegl-provider.h
libbuffer_la_SOURCES = $(BUFFER_sources) $(BUFFER_headers)
libbufferinclude_HEADERS = gegl-buffer.h
......
......@@ -109,7 +109,7 @@ gegl_buffer_alloc (GeglBufferAllocator *allocator,
allocator->max_height = needed_height;
{ GeglBuffer *tmp = g_object_new (GEGL_TYPE_BUFFER,
"source", allocator,
"provider", allocator,
"x", x,
"y", y,
"width", width,
......@@ -151,7 +151,7 @@ gegl_buffer_new_from_format (void *babl_format,
"path", path,
NULL);
allocator = g_object_new (GEGL_TYPE_BUFFER_ALLOCATOR,
"source", storage,
"provider", storage,
NULL);
g_object_unref (storage);
g_hash_table_insert (allocators, babl_format, allocator);
......@@ -163,7 +163,7 @@ gegl_buffer_new_from_format (void *babl_format,
"format", babl_format,
NULL);
allocator = g_object_new (GEGL_TYPE_BUFFER_ALLOCATOR,
"source", storage,
"provider", storage,
NULL);
g_object_unref (storage);
g_hash_table_insert (allocators, babl_format, allocator);
......
/* This file is part of GEGL.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006, 2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
......@@ -115,7 +135,7 @@ gegl_buffer_load (GeglBuffer *buffer,
gint factor = 1 << entry->z;
tile = gegl_tile_store_get_tile (GEGL_TILE_STORE (buffer),
tile = gegl_provider_get_tile (GEGL_PROVIDER (buffer),
entry->x + info->x_tile_shift / factor,
entry->y + info->y_tile_shift / factor,
entry->z);
......
/* This file is part of GEGL.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006, 2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
......@@ -194,7 +214,7 @@ gegl_buffer_save (GeglBuffer *buffer,
if (1)
{
if (gegl_tile_store_message (GEGL_TILE_STORE (buffer),
if (gegl_provider_message (GEGL_PROVIDER (buffer),
GEGL_TILE_EXIST, tx, ty, z, NULL))
{
tx += info->x_tile_shift / factor;
......@@ -255,7 +275,7 @@ gegl_buffer_save (GeglBuffer *buffer,
GeglTile *tile;
gint factor = 1 << entry->z;
tile = gegl_tile_store_get_tile (GEGL_TILE_STORE (buffer),
tile = gegl_provider_get_tile (GEGL_PROVIDER (buffer),
entry->x - info->x_tile_shift / factor,
entry->y - info->y_tile_shift / factor,
entry->z);
......
......@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* Copyright 2006,2007 Øyvind Kolås <pippin@gimp.org>
*/
#ifndef _GEGL_BUFFER_TYPES_H
#define _GEGL_BUFFER_TYPES_H
......@@ -25,8 +25,8 @@ typedef struct _GeglInterpolator GeglInterpolator;
typedef struct _GeglTile GeglTile;
typedef struct _GeglTileClass GeglTileClass;
typedef struct _GeglTileStore GeglTileStore;
typedef struct _GeglTileStoreClass GeglTileStoreClass;
typedef struct _GeglProvider GeglProvider;
typedef struct _GeglProviderClass GeglProviderClass;
typedef struct _GeglTileBackend GeglTileBackend;
typedef struct _GeglTileBackendClass GeglTileBackendClass;
......
......@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* Copyright 2006,2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <glib.h>
......@@ -227,12 +227,12 @@ gegl_buffer_dispose (GObject *object)
gegl_buffer_sample_cleanup (buffer);
if (handler->source &&
GEGL_IS_BUFFER_ALLOCATOR (handler->source))
if (handler->provider &&
GEGL_IS_BUFFER_ALLOCATOR (handler->provider))
{
gegl_buffer_void (buffer);
#if 0
handler->source = NULL; /* this might be a dangerous way of marking that we have already voided */
handler->provider = NULL; /* this might be a dangerous way of marking that we have already voided */
#endif
}
......@@ -250,14 +250,14 @@ gegl_buffer_dispose (GObject *object)
static GeglTileBackend *
gegl_buffer_backend (GeglBuffer *buffer)
{
GeglTileStore *tmp = GEGL_TILE_STORE (buffer);
GeglProvider *tmp = GEGL_PROVIDER (buffer);
if (!tmp)
return NULL;
do
{
tmp = GEGL_HANDLER (tmp)->source;
tmp = GEGL_HANDLER (tmp)->provider;
} while (tmp &&
/*GEGL_IS_TILE_TRAIT (tmp) &&*/
!GEGL_IS_TILE_BACKEND (tmp));
......@@ -271,11 +271,11 @@ gegl_buffer_backend (GeglBuffer *buffer)
GeglStorage *
gegl_buffer_storage (GeglBuffer *buffer)
{
GeglTileStore *tmp = GEGL_TILE_STORE (buffer);
GeglProvider *tmp = GEGL_PROVIDER (buffer);
do
{
tmp = ((GeglHandler *) (tmp))->source;
tmp = ((GeglHandler *) (tmp))->provider;
} while (!GEGL_IS_STORAGE (tmp));
return (GeglStorage *) tmp;
......@@ -290,39 +290,39 @@ gegl_buffer_constructor (GType type,
{
GObject *object;
GeglBuffer *buffer;
GeglHandlers *handlers;
GeglHandlers *handlers;
GeglTileBackend *backend;
GeglHandler *handler;
GeglTileStore *source;
GeglHandler *handler;
GeglProvider *provider;
gint tile_width;
gint tile_height;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
buffer = GEGL_BUFFER (object);
buffer = GEGL_BUFFER (object);
handlers = GEGL_HANDLERS (object);
handler = GEGL_HANDLER (object);
source = handler->source;
backend = gegl_buffer_backend (buffer);
provider = handler->provider;
backend = gegl_buffer_backend (buffer);
if (source)
if (provider)
{
if (GEGL_IS_STORAGE (source))
buffer->format = GEGL_STORAGE (source)->format;
else if (GEGL_IS_BUFFER (source))
buffer->format = GEGL_BUFFER (source)->format;
if (GEGL_IS_STORAGE (provider))
buffer->format = GEGL_STORAGE (provider)->format;
else if (GEGL_IS_BUFFER (provider))
buffer->format = GEGL_BUFFER (provider)->format;
}
if (!source)
if (!provider)
{
/* if no source is specified if a format is specified, we
/* if no provider is specified if a format is specified, we
* we need to create our own
* source (this adds a redirectin buffer in between for
* provider (this adds a redirectin buffer in between for
* all "allocated from format", type buffers.
*/
g_assert (buffer->format);
source = GEGL_TILE_STORE (gegl_buffer_new_from_format (buffer->format,
provider = GEGL_PROVIDER (gegl_buffer_new_from_format (buffer->format,
buffer->x,
buffer->y,
buffer->width,
......@@ -331,12 +331,12 @@ gegl_buffer_constructor (GType type,
* the top level behavior exhibited by this buffer object.
*/
g_object_set (buffer,
"source", source,
"provider", provider,
NULL);
g_object_unref (source);
g_object_unref (provider);
g_assert (source);
backend = gegl_buffer_backend (GEGL_BUFFER (source));
g_assert (provider);
backend = gegl_buffer_backend (GEGL_BUFFER (provider));
g_assert (backend);
}
......@@ -346,17 +346,17 @@ gegl_buffer_constructor (GType type,
tile_height = backend->tile_height;
if (buffer->width == -1 &&
buffer->height == -1) /* no specified extents, inheriting from source */
buffer->height == -1) /* no specified extents, inheriting from provider */
{
if (GEGL_IS_BUFFER (source))
if (GEGL_IS_BUFFER (provider))
{
buffer->width = GEGL_BUFFER (source)->width;
buffer->height = GEGL_BUFFER (source)->height;
buffer->width = GEGL_BUFFER (provider)->width;
buffer->height = GEGL_BUFFER (provider)->height;
}
else if (GEGL_IS_STORAGE (source))
else if (GEGL_IS_STORAGE (provider))
{
buffer->width = GEGL_STORAGE (source)->width;
buffer->height = GEGL_STORAGE (source)->height;
buffer->width = GEGL_STORAGE (provider)->width;
buffer->height = GEGL_STORAGE (provider)->height;
}
}
......@@ -383,21 +383,21 @@ gegl_buffer_constructor (GType type,
else if (buffer->abyss_width == -1 ||
buffer->abyss_height == -1)
{
buffer->abyss_x = GEGL_BUFFER (source)->abyss_x - buffer->shift_x;
buffer->abyss_y = GEGL_BUFFER (source)->abyss_y - buffer->shift_y;
buffer->abyss_width = GEGL_BUFFER (source)->abyss_width;
buffer->abyss_height = GEGL_BUFFER (source)->abyss_height;
buffer->abyss_x = GEGL_BUFFER (provider)->abyss_x - buffer->shift_x;
buffer->abyss_y = GEGL_BUFFER (provider)->abyss_y - buffer->shift_y;
buffer->abyss_width = GEGL_BUFFER (provider)->abyss_width;
buffer->abyss_height = GEGL_BUFFER (provider)->abyss_height;
}
/* intersect our own abyss with parent's abyss if it exists
*/
if (GEGL_IS_BUFFER (source))
if (GEGL_IS_BUFFER (provider))
{
GeglRectangle parent = {
GEGL_BUFFER (source)->abyss_x - buffer->shift_x,
GEGL_BUFFER (source)->abyss_y - buffer->shift_y,
GEGL_BUFFER (source)->abyss_width,
GEGL_BUFFER (source)->abyss_height
GEGL_BUFFER (provider)->abyss_x - buffer->shift_x,
GEGL_BUFFER (provider)->abyss_y - buffer->shift_y,
GEGL_BUFFER (provider)->abyss_width,
GEGL_BUFFER (provider)->abyss_height
};
GeglRectangle request = {
buffer->abyss_x,
......@@ -415,14 +415,14 @@ gegl_buffer_constructor (GType type,
}
/* compute our own total shift */
if (GEGL_IS_BUFFER (source))
if (GEGL_IS_BUFFER (provider))
{
GeglBuffer *source_buf;
GeglBuffer *provider_buf;
source_buf = GEGL_BUFFER (source);
provider_buf = GEGL_BUFFER (provider);
buffer->total_shift_x = source_buf->total_shift_x;
buffer->total_shift_y = source_buf->total_shift_y;
buffer->total_shift_x = provider_buf->total_shift_x;
buffer->total_shift_y = provider_buf->total_shift_y;
}
else
{
......@@ -452,20 +452,20 @@ gegl_buffer_constructor (GType type,
}
static GeglTile *
get_tile (GeglTileStore *tile_store,
get_tile (GeglProvider *tile_store,
gint x,
gint y,
gint z)
{
GeglHandlers *handlers = GEGL_HANDLERS (tile_store);
GeglTileStore *source = GEGL_HANDLER (tile_store)->source;
GeglTile *tile = NULL;
GeglProvider *provider = GEGL_HANDLER (tile_store)->provider;
GeglTile *tile = NULL;
if (handlers->chain != NULL)
tile = gegl_tile_store_get_tile (GEGL_TILE_STORE (handlers->chain->data),
tile = gegl_provider_get_tile (GEGL_PROVIDER (handlers->chain->data),
x, y, z);
else if (source)
tile = gegl_tile_store_get_tile (source, x, y, z);
else if (provider)
tile = gegl_provider_get_tile (provider, x, y, z);
else
g_assert (0);
......@@ -499,10 +499,10 @@ static void
gegl_buffer_class_init (GeglBufferClass *class)
{
GObjectClass *gobject_class;
GeglTileStoreClass *tile_store_class;
GeglProviderClass *tile_store_class;
gobject_class = (GObjectClass *) class;
tile_store_class = (GeglTileStoreClass *) class;
tile_store_class = (GeglProviderClass *) class;
parent_class = g_type_class_peek_parent (class);
gobject_class->dispose = gegl_buffer_dispose;
......@@ -530,12 +530,12 @@ gegl_buffer_class_init (GeglBufferClass *class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, PROP_X,
g_param_spec_int ("x", "x", "local origin's offset relative to source origin",
g_param_spec_int ("x", "x", "local origin's offset relative to provider origin",
G_MININT, G_MAXINT, 0,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, PROP_Y,
g_param_spec_int ("y", "y", "local origin's offset relative to source origin",
g_param_spec_int ("y", "y", "local origin's offset relative to provider origin",
G_MININT, G_MAXINT, 0,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
......@@ -603,7 +603,7 @@ gegl_buffer_void_tile (GeglBuffer *buffer,
{
gint z = 0;
return gegl_tile_store_message (GEGL_TILE_STORE (buffer),
return gegl_provider_message (GEGL_PROVIDER (buffer),
GEGL_TILE_VOID, x, y, z, NULL);
}
......@@ -611,7 +611,7 @@ gegl_buffer_void_tile (GeglBuffer *buffer,
gboolean
gegl_buffer_idle (GeglBuffer *buffer)
{
return gegl_tile_store_message (GEGL_TILE_STORE (buffer),
return gegl_provider_message (GEGL_PROVIDER (buffer),
GEGL_TILE_IDLE, 0, 0, 0, NULL);
}
#endif
......@@ -655,7 +655,7 @@ gegl_buffer_void (GeglBuffer *buffer)
gint tx = gegl_tile_indice (tiledx / factor, tile_width);
gint ty = gegl_tile_indice (tiledy / factor, tile_height);
gegl_tile_store_message (GEGL_TILE_STORE (buffer),
gegl_provider_message (GEGL_PROVIDER (buffer),
GEGL_TILE_VOID, tx, ty, z, NULL);
bufx += (tile_width - offsetx) * factor;
......@@ -725,7 +725,7 @@ pset (GeglBuffer *buffer,
gint tiledy = buffer_y + buffer->total_shift_y + y;
gint tiledx = buffer_x + buffer->total_shift_x + x;
GeglTile *tile = gegl_tile_store_get_tile ((GeglTileStore *) (buffer),
GeglTile *tile = gegl_provider_get_tile ((GeglProvider *) (buffer),
gegl_tile_indice (tiledx, tile_width),
gegl_tile_indice (tiledy, tile_height),
0);
......@@ -809,7 +809,7 @@ pset (GeglBuffer *buffer,
g_object_unref (buffer->hot_tile);
buffer->hot_tile = NULL;
}
tile = gegl_tile_store_get_tile ((GeglTileStore *) (buffer),
tile = gegl_provider_get_tile ((GeglProvider *) (buffer),
indice_x, indice_y,
0);
}
......@@ -892,9 +892,9 @@ pget (GeglBuffer *buffer,
g_object_unref (buffer->hot_tile);
buffer->hot_tile = NULL;
}
tile = gegl_tile_store_get_tile ((GeglTileStore *) (buffer),
indice_x, indice_y,
0);
tile = gegl_provider_get_tile ((GeglProvider *) (buffer),
indice_x, indice_y,
0);
}
if (tile)
......@@ -1051,7 +1051,7 @@ gegl_buffer_iterate (GeglBuffer *buffer,
else
{
guchar *tile_base, *tp;
GeglTile *tile = gegl_tile_store_get_tile ((GeglTileStore *) (buffer),
GeglTile *tile = gegl_provider_get_tile ((GeglProvider *) (buffer),
gegl_tile_indice (tiledx, tile_width),
gegl_tile_indice (tiledy, tile_height),
level);
......@@ -1183,7 +1183,7 @@ gegl_buffer_set (GeglBuffer *buffer,
return;
}
sub_buf = g_object_new (GEGL_TYPE_BUFFER,
"source", buffer,
"provider", buffer,
"x", rect->x,
"y", rect->y,
"width", rect->width,
......@@ -1208,7 +1208,7 @@ static void gegl_buffer_get_scaled (GeglBuffer *buffer,
gint level)
{
GeglBuffer *sub_buf = g_object_new (GEGL_TYPE_BUFFER,
"source", buffer,
"provider", buffer,
"x", rect->x,
"y", rect->y,
"width", rect->width,
......@@ -1715,7 +1715,7 @@ gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
GeglRectangle *extent)
{
return g_object_new (GEGL_TYPE_BUFFER,
"source", buffer,
"provider", buffer,
"x", extent->x,
"y", extent->y,
"width", extent->width,
......
......@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* Copyright 2006,2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <stdio.h>
......@@ -99,13 +99,13 @@ dispose (GObject *object)
}
static GeglTile *
get_tile (GeglTileStore *tile_store,
get_tile (GeglProvider *tile_store,
gint x,
gint y,
gint z)
{
GeglHandlerCache *cache = GEGL_HANDLER_CACHE (tile_store);
GeglTileStore *source = GEGL_HANDLER (tile_store)->source;
GeglProvider *provider = GEGL_HANDLER (tile_store)->provider;
GeglTile *tile = NULL;
tile = gegl_handler_cache_get_tile (cache, x, y, z);
......@@ -117,8 +117,8 @@ get_tile (GeglTileStore *tile_store,
}
cache->misses++;
if (source)
tile = gegl_tile_store_get_tile (source, x, y, z);
if (provider)
tile = gegl_provider_get_tile (provider, x, y, z);
if (tile)
{
......@@ -132,7 +132,7 @@ static gboolean
gegl_handler_cache_void (GeglHandlerCache *cache, gint x, gint y, gint z);
static gboolean
message (GeglTileStore *tile_store,
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
gint y,
......@@ -164,8 +164,8 @@ message (GeglTileStore *tile_store,
{
gegl_handler_cache_void (cache, x, y, z);
}
if (handler->source)
return gegl_tile_store_message (handler->source, message, x, y, z, data);
if (handler->provider)
return gegl_provider_message (handler->provider, message, x, y, z, data);
return FALSE;
}
......@@ -221,7 +221,7 @@ static void
gegl_handler_cache_class_init (GeglHandlerCacheClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
GeglTileStoreClass *tile_store_class = GEGL_TILE_STORE_CLASS (class);
GeglProviderClass *tile_store_class = GEGL_PROVIDER_CLASS (class);
parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = set_property;
......@@ -292,7 +292,7 @@ gegl_handler_cache_wash (GeglHandlerCache *cache)
}
if (last_dirty != NULL)
{
gegl_tile_store (last_dirty);
gegl_provider (last_dirty);
return TRUE;
}
return FALSE;
......
......@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* Copyright 2006,2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <glib.h>
#include <glib-object.h>
......@@ -43,17 +43,17 @@ finalize (GObject *object)
}
static GeglTile *
get_tile (GeglTileStore *gegl_tile_store,
get_tile (GeglProvider *gegl_provider,
gint x,
gint y,
gint z)
{
GeglTileStore *source = GEGL_HANDLER (gegl_tile_store)->source;
GeglHandlerEmpty *empty = GEGL_HANDLER_EMPTY (gegl_tile_store);
GeglProvider *provider = GEGL_HANDLER (gegl_provider)->provider;
GeglHandlerEmpty *empty = GEGL_HANDLER_EMPTY (gegl_provider);
GeglTile *tile = NULL;
if (source)
tile = gegl_tile_store_get_tile (source, x, y, z);
if (provider)
tile = gegl_provider_get_tile (provider, x, y, z);
if (tile != NULL)
return tile;
......@@ -134,9 +134,9 @@ static void
gegl_handler_empty_class_init (GeglHandlerEmptyClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GeglTileStoreClass *gegl_tile_store_class = GEGL_TILE_STORE_CLASS (klass);
GeglProviderClass *gegl_provider_class = GEGL_PROVIDER_CLASS (klass);
gegl_tile_store_class->get_tile = get_tile;
gegl_provider_class->get_tile = get_tile;
gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
gobject_class->constructor = constructor;
......
......@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* Copyright 2006, 2007 Øyvind Kolås <pippin@gimp.org>
*/
#include <glib.h>
#include <glib-object.h>
......@@ -28,18 +28,18 @@ G_DEFINE_TYPE (GeglHandlerLog, gegl_handler_log, GEGL_TYPE_TILE_TRAIT)
static GObjectClass * parent_class = NULL;
static GeglTile *
get_tile (GeglTileStore *gegl_tile_store,
get_tile (GeglProvider *gegl_provider,
gint x,
gint y,
gint z)
{
GeglTileStore *source = GEGL_HANDLER (gegl_tile_store)->source;
GeglProvider *provider = GEGL_HANDLER (gegl_provider)->provider;
GeglTile *tile = NULL;
g_warning ("%p get_tile (%i,%i,%i)", (void *) gegl_tile_store, x, y, z);
g_warning ("%p get_tile (%i,%i,%i)", (void *) gegl_provider, x, y, z);
if (source)
tile = gegl_tile_store_get_tile (source, x, y, z);
if (provider)
tile = gegl_provider_get_tile (provider, x, y, z);
return tile;
}
......@@ -51,28 +51,28 @@ static char *messages[] =
};
static gboolean
message (GeglTileStore *gegl_tile_store,
message (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
gint y,
gint z,
gpointer data)
{
GeglHandler *handler = GEGL_HANDLER (gegl_tile_store);
GeglHandler *handler = GEGL_HANDLER (gegl_provider);
g_warning ("%p message(%s, x=%i, y=%i, z=%i, data=%p)", (void *) gegl_tile_store, messages[message], x, y, z, data);
if (handler->source)
return gegl_tile_store_message (handler->source, message, x, y, z, data);
g_warning ("%p message(%s, x=%i, y=%i, z=%i, data=%p)", (void *) gegl_provider, messages[message], x, y, z, data);
if (handler->provider)
return gegl_provider_message (handler->provider, message, x, y, z, data);
return FALSE;
}