Commit 9e863688 authored by Daniel Sabo's avatar Daniel Sabo

Drop cache if the node's output format has changed

parent b1c13f37
......@@ -2052,21 +2052,29 @@ gegl_node_computed_event (GeglCache *self,
GeglCache *
gegl_node_get_cache (GeglNode *node)
{
GeglPad *pad;
const Babl *format = NULL;
g_return_val_if_fail (GEGL_IS_NODE (node), NULL);
if (!node->cache)
{
GeglPad *pad;
const Babl *format;
/* XXX: it should be possible to have cache for other pads than
* only "output" pads
*/
pad = gegl_node_get_pad (node, "output");
if (!pad)
return NULL;
/* XXX: it should be possible to have cache for other pads than
* only "output" pads
*/
pad = gegl_node_get_pad (node, "output");
if (!pad)
return NULL;
format = gegl_pad_get_format (pad);
format = gegl_pad_get_format (pad);
if (node->cache && format &&
node->cache->format != format)
{
/* FIXME: Also cover output_format = NULL and cache->format != RGBA float */
g_object_unref(node->cache);
node->cache = NULL;
}
if (!node->cache)
{
if (!format)
{
format = babl_format ("RGBA float");
......
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