[gimp] app, libgimp: pass "use-opencl" to plug-ins



commit 57da340f784f84acda6ebdcf712e1c2e9863c2d0
Author: Michael Natterer <mitch gimp org>
Date:   Tue Feb 25 21:19:25 2014 +0100

    app, libgimp: pass "use-opencl" to plug-ins
    
    and configure Gegl on the plug-in side accordingly. This bumps
    the GIMP protocol version.

 app/plug-in/gimppluginmanager-call.c |    3 ++-
 libgimp/gimp.c                       |    4 ++++
 libgimpbase/gimpprotocol.c           |    4 ++--
 libgimpbase/gimpprotocol.h           |    4 ++--
 4 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c
index 38b489a..c16adf6 100644
--- a/app/plug-in/gimppluginmanager-call.c
+++ b/app/plug-in/gimppluginmanager-call.c
@@ -155,6 +155,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
   if (plug_in)
     {
       GimpCoreConfig    *core_config    = manager->gimp->config;
+      GimpGeglConfig    *gegl_config    = GIMP_GEGL_CONFIG (core_config);
       GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (core_config);
       GimpGuiConfig     *gui_config     = GIMP_GUI_CONFIG (core_config);
       GPConfig           config;
@@ -191,7 +192,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
       config.show_help_button = (gui_config->use_help &&
                                  gui_config->show_help_button);
       config.use_cpu_accel    = manager->gimp->use_cpu_accel;
-      config.gimp_reserved_5  = 0;
+      config.use_opencl       = gegl_config->use_opencl;
       config.gimp_reserved_6  = 0;
       config.gimp_reserved_7  = 0;
       config.gimp_reserved_8  = 0;
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 40840f6..6725bac 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -1954,6 +1954,10 @@ gimp_config (GPConfig *config)
 
   gimp_cpu_accel_set_use (config->use_cpu_accel);
 
+  g_object_set (gegl_config (),
+                "use-opencl", config->use_opencl,
+                NULL);
+
   if (_shm_ID != -1)
     {
 #if defined(USE_SYSV_SHM)
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index 4b61bc7..287134d 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -499,7 +499,7 @@ _gp_config_read (GIOChannel      *channel,
                               user_data))
     goto cleanup;
   if (! _gimp_wire_read_int8 (channel,
-                              (guint8 *) &config->gimp_reserved_5, 1,
+                              (guint8 *) &config->use_opencl, 1,
                               user_data))
     goto cleanup;
   if (! _gimp_wire_read_int8 (channel,
@@ -591,7 +591,7 @@ _gp_config_write (GIOChannel      *channel,
                                user_data))
     return;
   if (! _gimp_wire_write_int8 (channel,
-                               (const guint8 *) &config->gimp_reserved_5, 1,
+                               (const guint8 *) &config->use_opencl, 1,
                                user_data))
     return;
   if (! _gimp_wire_write_int8 (channel,
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index 0514d63..4d6bd50 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 /* Increment every time the protocol changes
  */
-#define GIMP_PROTOCOL_VERSION  0x0014
+#define GIMP_PROTOCOL_VERSION  0x0015
 
 
 enum
@@ -69,7 +69,7 @@ struct _GPConfig
   gint8    check_type;
   gint8    show_help_button;
   gint8    use_cpu_accel;
-  gint8    gimp_reserved_5;
+  gint8    use_opencl;
   gint8    gimp_reserved_6;
   gint8    gimp_reserved_7;
   gint8    gimp_reserved_8;


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