[gegl/soc-2011-warp: 16/25] gegl:warp: add code to test copy on write



commit 5b633976595cb5a7306cfaa2f0d890591069efd5
Author: Michael Murà <batolettre gmail com>
Date:   Sat Jul 30 02:08:21 2011 +0200

    gegl:warp: add code to test copy on write

 operations/workshop/warp.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/operations/workshop/warp.c b/operations/workshop/warp.c
index c662789..55c3ad8 100644
--- a/operations/workshop/warp.c
+++ b/operations/workshop/warp.c
@@ -21,6 +21,12 @@
 #include <math.h>
 #include <stdio.h> /* for test only */
 
+/* #define COPY_ON_WRITE */
+#ifndef COPY_ON_WRITE
+#include "gegl.h"
+#include "gegl-buffer-private.h"
+#endif
+
 #ifdef GEGL_CHANT_PROPERTIES
 
 gegl_chant_double (strength, _("Strength"), 0.0, 100.0, 1.0,
@@ -315,7 +321,14 @@ process (GeglOperation       *operation,
 
   printf("Process %p\n", operation);
 
+#ifdef COPY_ON_WRITE
   priv->buffer = gegl_buffer_dup (input);
+#else
+  g_assert (GEGL_IS_BUFFER (input));
+
+  priv->buffer = gegl_buffer_new (gegl_buffer_get_extent (input), input->format);
+  gegl_buffer_copy (input, gegl_buffer_get_extent (input), priv->buffer, gegl_buffer_get_extent (input));
+#endif
 
   event = gegl_path_get_path (o->stroke);
 



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