[gegl/wip/rishi/process-blit-to-cache: 1/2] GeglNode: Don't copy if the result is already in the destination



commit a884ee812f4f5b8735164f3de95bea86ea4e934d
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Dec 20 23:28:24 2018 +0100

    GeglNode: Don't copy if the result is already in the destination
    
    This can happen if the GeglNode has been explicitly asked to render to
    its own GeglCache, even when it caches naturally during the processing
    of the graph. eg., if the GeglNode and its underlying GeglOperation
    haven't disabled caching and the area being rendered lies within the
    node's bounding box.
    
    In such cases, the GeglBuffer obtained out of processing the GeglNode
    is its own GeglCache. Hence, there's no need to copy it to the
    destination buffer if the destination is the cache itself.

 gegl/graph/gegl-node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 220ce7476..1d8cb263b 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -1110,7 +1110,7 @@ gegl_node_blit_buffer (GeglNode            *self,
 
   if (result)
     {
-      if (buffer)
+      if (buffer && buffer != result)
         gegl_buffer_copy (result, &request, GEGL_ABYSS_NONE, buffer, NULL);
       g_object_unref (result);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]