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

This commit is contained in:
Michael Natterer 2012-06-29 01:51:56 +02:00
parent a6e1eace45
commit 5c11326ad7
2 changed files with 19 additions and 19 deletions

View File

@ -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);

View File

@ -47,24 +47,33 @@ 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
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
g_object_set (gegl_config (),
"cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
#if 0
"threads", config->num_processors,
#endif
NULL);
}
/* turn down the precision of babl - permitting use of lookup tables for
* gamma conversions, this precision is anyways high enough for both 8bit