[gimp] app: use an explicit tile format when talking to plug-ins



commit f0daec882fa0be7e058a66baab0a5abc20808457
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 20 23:54:48 2012 +0200

    app: use an explicit tile format when talking to plug-ins

 app/plug-in/gimpplugin-message.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c
index 8fd93ec..766d409 100644
--- a/app/plug-in/gimpplugin-message.c
+++ b/app/plug-in/gimpplugin-message.c
@@ -190,6 +190,7 @@ gimp_plug_in_handle_tile_put (GimpPlugIn *plug_in,
   GimpWireMessage  msg;
   GimpDrawable    *drawable;
   GeglBuffer      *buffer;
+  const Babl      *format;
   GeglRectangle    tile_rect;
 
   tile_data.drawable_ID = -1;
@@ -309,15 +310,18 @@ gimp_plug_in_handle_tile_put (GimpPlugIn *plug_in,
       return;
     }
 
+  /* XXX use an appropriate format here */
+  format = gegl_buffer_get_format (buffer);
+
   if (tile_data.use_shm)
     {
-      gegl_buffer_set (buffer, &tile_rect, 0, NULL,
+      gegl_buffer_set (buffer, &tile_rect, 0, format,
                        gimp_plug_in_shm_get_addr (plug_in->manager->shm),
                        GEGL_AUTO_ROWSTRIDE);
     }
   else
     {
-      gegl_buffer_set (buffer, &tile_rect, 0, NULL,
+      gegl_buffer_set (buffer, &tile_rect, 0, format,
                        tile_info->data,
                        GEGL_AUTO_ROWSTRIDE);
     }
@@ -398,6 +402,7 @@ gimp_plug_in_handle_tile_get (GimpPlugIn *plug_in,
       return;
     }
 
+  /* XXX use an appropriate format here */
   format = gegl_buffer_get_format (buffer);
 
   tile_size = (babl_format_get_bytes_per_pixel (format) *
@@ -413,7 +418,7 @@ gimp_plug_in_handle_tile_get (GimpPlugIn *plug_in,
 
   if (tile_data.use_shm)
     {
-      gegl_buffer_get (buffer, &tile_rect, 1.0, NULL,
+      gegl_buffer_get (buffer, &tile_rect, 1.0, format,
                        gimp_plug_in_shm_get_addr (plug_in->manager->shm),
                        GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
     }
@@ -421,7 +426,7 @@ gimp_plug_in_handle_tile_get (GimpPlugIn *plug_in,
     {
       tile_data.data = g_malloc (tile_size);
 
-      gegl_buffer_get (buffer, &tile_rect, 1.0, NULL,
+      gegl_buffer_get (buffer, &tile_rect, 1.0, format,
                        tile_data.data,
                        GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
     }



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