Commit dfb16f05 authored by Øyvind Kolås's avatar Øyvind Kolås

keep an 0x0 sized buffer around that is shared by all needs for such a

* gegl/operation/gegl-operation-context.c: (emptybuf),
(gegl_operation_context_get_target): keep an 0x0 sized buffer around
that is shared by all needs for such a buffer to be passed as a dummy
token between nodes.

svn path=/trunk/; revision=2711
parent f460d915
2008-11-09 Øyvind Kolås <pippin@gimp.org>
* gegl/operation/gegl-operation-context.c: (emptybuf),
(gegl_operation_context_get_target): keep an 0x0 sized buffer around
that is shared by all needs for such a buffer to be passed as a dummy
token between nodes.
2008-11-09 Øyvind Kolås <pippin@gimp.org>
* NEWS: created draft NEWS from ChangeLog entries.
......@@ -14,18 +21,6 @@
chunk-size (number of output pixels computed simultanously) from
256*256 to 1024*1024.
2008-11-08 Øyvind Kolås <pippin@gimp.org>
* gegl/operation/gegl-operation-point-composer.c:
(gegl_operation_point_composer_class_init): enable caching.
* gegl/operation/gegl-operation-point-render.c:
(gegl_operation_point_render_class_init): enable caching.
* gegl/property-types/gegl-path.c: (gegl_param_vector_init):
* gegl/operation/gegl-operation-context.c: indentation.
* gegl/buffer/gegl-buffer.c: (gegl_buffer_create_sub_buffer):
extra sanity (XXX)
2008-11-08 Øyvind Kolås <pippin@gimp.org>
* bin/editor.c: (cairo_gui_expose), (gui_press_event): made moving the
......
......@@ -323,6 +323,20 @@ gegl_operation_context_get_source (GeglOperationContext *context,
return input;
}
static GeglBuffer *emptybuf (void)
{
static GeglBuffer *empty = NULL; /* we leak this single empty buffer,
avoiding having to create it weighs
up the penalty.
*/
if (!empty)
{
GeglRectangle rect={0,0,0,0};
empty = gegl_buffer_new (&empty, babl_format ("RGBA float"));
}
return empty;
}
GeglBuffer *
gegl_operation_context_get_target (GeglOperationContext *context,
const gchar *padname)
......@@ -350,12 +364,17 @@ gegl_operation_context_get_target (GeglOperationContext *context,
result = &context->result_rect;
if (node->dont_cache == FALSE &&
if (result->width == 0 ||
result->height == 0)
{
output = g_object_ref (emptybuf());
}
else if (node->dont_cache == FALSE &&
! GEGL_OPERATION_CLASS (G_OBJECT_GET_CLASS (operation))->no_cache)
{
GeglBuffer *cache;
cache = GEGL_BUFFER (gegl_node_get_cache (node));
output = gegl_buffer_create_sub_buffer (cache, result);
GeglBuffer *cache;
cache = GEGL_BUFFER (gegl_node_get_cache (node));
output = gegl_buffer_create_sub_buffer (cache, result);
}
else
{
......
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