[gimp] app: connect GimpGeglConfig:num-processors to GeglConfig:threads



commit 120db980dc3246349f0074f1d7da42b8487aa5c7
Author: Michael Natterer <mitch gimp org>
Date:   Sat May 19 08:50:05 2012 +0200

    app: connect GimpGeglConfig:num-processors to GeglConfig:threads
    
    whatever it might be good for...

 app/gegl/gimp-gegl.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/app/gegl/gimp-gegl.c b/app/gegl/gimp-gegl.c
index 176e6d7..5e9047a 100644
--- a/app/gegl/gimp-gegl.c
+++ b/app/gegl/gimp-gegl.c
@@ -37,6 +37,7 @@
 
 
 static void  gimp_gegl_notify_tile_cache_size (GimpGeglConfig *config);
+static void  gimp_gegl_notify_num_processors  (GimpGeglConfig *config);
 
 
 void
@@ -55,7 +56,8 @@ gimp_gegl_init (Gimp *gimp)
   g_object_set (gegl_config (),
                 "tile-width",  TILE_WIDTH,
                 "tile-height", TILE_HEIGHT,
-                "cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
+                "cache-size",  (gint) MIN (config->tile_cache_size, G_MAXINT),
+                "threads",     config->num_processors,
                 NULL);
 
   /* turn down the precision of babl - permitting use of lookup tables for
@@ -69,6 +71,9 @@ gimp_gegl_init (Gimp *gimp)
   g_signal_connect (config, "notify::tile-cache-size",
                     G_CALLBACK (gimp_gegl_notify_tile_cache_size),
                     NULL);
+  g_signal_connect (config, "notify::num-processors",
+                    G_CALLBACK (gimp_gegl_notify_num_processors),
+                    NULL);
 
   gimp_babl_init ();
 
@@ -82,3 +87,11 @@ gimp_gegl_notify_tile_cache_size (GimpGeglConfig *config)
                 "cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
                 NULL);
 }
+
+static void
+gimp_gegl_notify_num_processors (GimpGeglConfig *config)
+{
+  g_object_set (gegl_config (),
+                "threads", config->num_processors,
+                NULL);
+}



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