[gimp] app: use GeglConfig's new 64 bit tile-cache-size property if it exists



commit 5c11326ad78aa206cdbf7bef4c2a3818c84796cc
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jun 29 01:51:56 2012 +0200

    app: use GeglConfig's new 64 bit tile-cache-size property if it exists

 app/config/gimpgeglconfig.c |    9 ---------
 app/gegl/gimp-gegl.c        |   29 +++++++++++++++++++----------
 2 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/app/config/gimpgeglconfig.c b/app/config/gimpgeglconfig.c
index e76bd0e..e9d9edb 100644
--- a/app/config/gimpgeglconfig.c
+++ b/app/config/gimpgeglconfig.c
@@ -147,18 +147,9 @@ gimp_gegl_config_class_init (GimpGeglConfigClass *klass)
   else
     memory_size = 1 << 30; /* 1GB */
 
-#ifdef __GNUC__
-#warning limiting tile cache size to G_MAXINT
-#endif
-  memory_size = MIN (memory_size, G_MAXINT);
-
   GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
                                     "tile-cache-size", TILE_CACHE_SIZE_BLURB,
-#if 0
                                     0, MIN (G_MAXSIZE, GIMP_MAX_MEMSIZE),
-#else
-                                    0, MIN (G_MAXINT, GIMP_MAX_MEMSIZE),
-#endif
                                     memory_size,
                                     GIMP_PARAM_STATIC_STRINGS |
                                     GIMP_CONFIG_PARAM_CONFIRM);
diff --git a/app/gegl/gimp-gegl.c b/app/gegl/gimp-gegl.c
index 4280e15..027de23 100644
--- a/app/gegl/gimp-gegl.c
+++ b/app/gegl/gimp-gegl.c
@@ -48,23 +48,32 @@ gimp_gegl_init (Gimp *gimp)
   config = GIMP_GEGL_CONFIG (gimp->config);
 
 #ifdef __GNUC__
-#warning limiting tile cache size to G_MAXINT
-#endif
-
-#ifdef __GNUC__
 #warning not setting GeglConfig:threads
 #endif
 
-  g_object_set (gegl_config (),
+  if (g_object_class_find_property (G_OBJECT_GET_CLASS (gegl_config ()),
+                                    "tile-cache-size"))
+    {
+      g_object_set (gegl_config (),
+                    "cache-size", (guint64) config->tile_cache_size,
 #if 0
-                "tile-width",  TILE_WIDTH,
-                "tile-height", TILE_HEIGHT,
+                    "threads",    config->num_processors,
+#endif
+                    NULL);
+    }
+  else
+    {
+#ifdef __GNUC__
+#warning limiting tile cache size to G_MAXINT
 #endif
-                "cache-size",  (gint) MIN (config->tile_cache_size, G_MAXINT),
+
+      g_object_set (gegl_config (),
+                    "cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
 #if 0
-                "threads",     config->num_processors,
+                    "threads",    config->num_processors,
 #endif
-                NULL);
+                    NULL);
+    }
 
   /* turn down the precision of babl - permitting use of lookup tables for
    * gamma conversions, this precision is anyways high enough for both 8bit



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