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



commit 72bbcf0579a3cf4491f2a8d284212734a95c178a
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.
    
    https://gitlab.gnome.org/GNOME/gegl/merge_requests/14

 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]