Commit 1590d4b5 authored by Daniel Sabo's avatar Daniel Sabo

Don't manipulate BackendFile's header in GeglBuffer

Instead sync the extent using the backend's public API and update
BackendFile's values when the header gets written.
parent 11583e43
......@@ -34,7 +34,6 @@
#include "gegl-buffer-private.h"
#include "gegl-tile-storage.h"
#include "gegl-sampler.h"
#include "gegl-buffer-index.h"
#include "gegl-tile-backend.h"
#include "gegl-buffer-iterator.h"
#include "gegl-buffer-cl-cache.h"
......@@ -177,14 +176,8 @@ gegl_buffer_flush (GeglBuffer *buffer)
_gegl_buffer_drop_hot_tile (buffer);
if ((GeglBufferHeader*)(backend->priv->header))
{
GeglBufferHeader* header = backend->priv->header;
header->x = buffer->extent.x;
header->y = buffer->extent.y;
header->width =buffer->extent.width;
header->height =buffer->extent.height;
}
if (backend)
gegl_tile_backend_set_extent (backend, &buffer->extent);
gegl_tile_source_command (GEGL_TILE_SOURCE (buffer),
GEGL_TILE_FLUSH, 0,0,0,NULL);
......
......@@ -40,7 +40,6 @@ struct _GeglTileBackendPrivate
GeglRectangle extent;
gpointer header;
gpointer storage;
gboolean shared;
};
......
......@@ -290,26 +290,15 @@ gboolean
gegl_buffer_set_extent (GeglBuffer *buffer,
const GeglRectangle *extent)
{
GeglBufferHeader *header;
g_return_val_if_fail (GEGL_IS_BUFFER (buffer), FALSE);
buffer->extent = *extent;
header = gegl_buffer_backend (buffer)->priv->header;
if (header)
{
header->x = buffer->extent.x;
header->y = buffer->extent.y;
header->width = buffer->extent.width;
header->height = buffer->extent.height;
}
if (buffer->backend)
gegl_tile_backend_set_extent (buffer->backend, &buffer->extent);
if (buffer->abyss_tracks_extent)
{
buffer->abyss = *extent;
}
buffer->abyss = *extent;
return TRUE;
}
......
......@@ -523,9 +523,15 @@ gegl_tile_backend_file_write_header (GeglTileBackendFile *self)
{
GeglFileBackendThreadParams *params = g_new0 (GeglFileBackendThreadParams, 1);
guchar *new_source = g_malloc (256);
GeglRectangle roi = gegl_tile_backend_get_extent ((GeglTileBackend *)self);
gegl_tile_backend_file_ensure_exist (self);
self->header.x = roi.x;
self->header.y = roi.y;
self->header.width = roi.width;
self->header.height = roi.height;
memcpy (new_source, &(self->header), 256);
params->operation = OP_WRITE;
......@@ -1209,8 +1215,6 @@ gegl_tile_backend_file_constructed (GObject *object)
g_assert (self->file);
backend->priv->header = &self->header;
gegl_tile_backend_set_flush_on_destroy (backend, FALSE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment