From 57da340f784f84acda6ebdcf712e1c2e9863c2d0 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 25 Feb 2014 21:19:25 +0100 Subject: [PATCH] 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 38b489ac6f..c16adf698f 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 40840f6f74..6725bac538 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 4b61bc7443..287134da67 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 0514d63e3c..4d6bd50cc9 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;