[gegl] gegl-config: remove tile_width/tile_height



commit 628887b53b6811eaf3e47b122e1b69424fe174ad
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Sep 19 22:54:12 2018 +0200

    gegl-config: remove tile_width/tile_height
    
    The default tile_width/tile_height can still be set with the environment
    variable GEGL_TILE_SIZE as before, it is however now initialized locally
    in GeglBuffer instead of looked up via gegl_config()

 gegl/buffer/gegl-buffer.c | 33 +++++++++++++++++++++++----------
 gegl/gegl-config.c        | 33 ---------------------------------
 gegl/gegl-config.h        |  2 --
 gegl/gegl-init.c          | 23 -----------------------
 4 files changed, 23 insertions(+), 68 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer.c b/gegl/buffer/gegl-buffer.c
index c13d28361..cd4e9618b 100644
--- a/gegl/buffer/gegl-buffer.c
+++ b/gegl/buffer/gegl-buffer.c
@@ -848,17 +848,30 @@ gegl_buffer_class_init (GeglBufferClass *class)
                                                         G_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT_ONLY));
 
-  g_object_class_install_property (gobject_class, PROP_TILE_HEIGHT,
-                                   g_param_spec_int ("tile-height", "tile-height", "height of a tile",
-                                                     -1, G_MAXINT, gegl_config()->tile_height,
-                                                     G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT_ONLY));
+  {
+    gint tile_height = 128;
+    gint tile_width = 128;
+    if (g_getenv ("GEGL_TILE_SIZE"))
+    {
+      const gchar *str = g_getenv ("GEGL_TILE_SIZE");
+      tile_width = atoi(str);
+      str = strchr (str, 'x');
+      if (str)
+        tile_height = atoi(str+1);
+    }
 
-  g_object_class_install_property (gobject_class, PROP_TILE_WIDTH,
-                                   g_param_spec_int ("tile-width", "tile-width", "width of a tile",
-                                                     -1, G_MAXINT, gegl_config()->tile_width,
-                                                     G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT_ONLY));
+    g_object_class_install_property (gobject_class, PROP_TILE_HEIGHT,
+                                     g_param_spec_int ("tile-height", "tile-height", "height of a tile",
+                                                       -1, G_MAXINT, tile_height,
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_CONSTRUCT_ONLY));
+
+    g_object_class_install_property (gobject_class, PROP_TILE_WIDTH,
+                                     g_param_spec_int ("tile-width", "tile-width", "width of a tile",
+                                                       -1, G_MAXINT, tile_width,
+                                                       G_PARAM_READWRITE |
+                                                       G_PARAM_CONSTRUCT_ONLY));
+  }
 
   g_object_class_install_property (gobject_class, PROP_PATH,
                                    g_param_spec_string ("path", "Path",
diff --git a/gegl/gegl-config.c b/gegl/gegl-config.c
index f34b416c7..12f3dc4cf 100644
--- a/gegl/gegl-config.c
+++ b/gegl/gegl-config.c
@@ -40,8 +40,6 @@ enum
   PROP_TILE_CACHE_SIZE,
   PROP_CHUNK_SIZE,
   PROP_SWAP,
-  PROP_TILE_WIDTH,
-  PROP_TILE_HEIGHT,
   PROP_THREADS,
   PROP_USE_OPENCL,
   PROP_QUEUE_SIZE,
@@ -68,14 +66,6 @@ gegl_config_get_property (GObject    *gobject,
         g_value_set_int (value, config->chunk_size);
         break;
 
-      case PROP_TILE_WIDTH:
-        g_value_set_int (value, config->tile_width);
-        break;
-
-      case PROP_TILE_HEIGHT:
-        g_value_set_int (value, config->tile_height);
-        break;
-
       case PROP_QUALITY:
         g_value_set_double (value, config->quality);
         break;
@@ -122,12 +112,6 @@ gegl_config_set_property (GObject      *gobject,
       case PROP_CHUNK_SIZE:
         config->chunk_size = g_value_get_int (value);
         break;
-      case PROP_TILE_WIDTH:
-        config->tile_width = g_value_get_int (value);
-        break;
-      case PROP_TILE_HEIGHT:
-        config->tile_height = g_value_get_int (value);
-        break;
       case PROP_QUALITY:
         config->quality = g_value_get_double (value);
         return;
@@ -176,23 +160,6 @@ gegl_config_class_init (GeglConfigClass *klass)
   gobject_class->get_property = gegl_config_get_property;
   gobject_class->finalize     = gegl_config_finalize;
 
-
-  g_object_class_install_property (gobject_class, PROP_TILE_WIDTH,
-                                   g_param_spec_int ("tile-width",
-                                                     "Tile width",
-                                                     "default tile width for created buffers.",
-                                                     0, G_MAXINT, 128,
-                                                     G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT));
-
-  g_object_class_install_property (gobject_class, PROP_TILE_HEIGHT,
-                                   g_param_spec_int ("tile-height",
-                                                     "Tile height",
-                                                     "default tile height for created buffers.",
-                                                     0, G_MAXINT, 128,
-                                                     G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT));
-
   g_object_class_install_property (gobject_class, PROP_TILE_CACHE_SIZE,
                                    g_param_spec_uint64 ("tile-cache-size",
                                                         "Tile Cache size",
diff --git a/gegl/gegl-config.h b/gegl/gegl-config.h
index f830390a5..f4c3626d7 100644
--- a/gegl/gegl-config.h
+++ b/gegl/gegl-config.h
@@ -39,8 +39,6 @@ struct _GeglConfig
   guint64  tile_cache_size;
   gint     chunk_size; /* The size of elements being processed at once */
   gdouble  quality;
-  gint     tile_width;
-  gint     tile_height;
   gboolean use_opencl;
   gint     queue_size;
   gchar   *application_license;
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index 39bb6c323..e9d8dcdd1 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -273,7 +273,6 @@ static gchar    *cmd_gegl_swap           = NULL;
 static gchar    *cmd_gegl_cache_size     = NULL;
 static gchar    *cmd_gegl_chunk_size     = NULL;
 static gchar    *cmd_gegl_quality        = NULL;
-static gchar    *cmd_gegl_tile_size      = NULL;
 static gchar    *cmd_gegl_threads        = NULL;
 static gboolean *cmd_gegl_disable_opencl = NULL;
 
@@ -289,11 +288,6 @@ static const GOptionEntry cmd_entries[]=
      G_OPTION_ARG_STRING, &cmd_gegl_cache_size,
      N_("How much memory to (approximately) use for caching imagery"), "<megabytes>"
     },
-    {
-     "gegl-tile-size", 0, 0,
-     G_OPTION_ARG_STRING, &cmd_gegl_tile_size,
-     N_("Default size of tiles in GeglBuffers"), "<widthxheight>"
-    },
     {
      "gegl-chunk-size", 0, 0,
      G_OPTION_ARG_STRING, &cmd_gegl_chunk_size,
@@ -368,15 +362,6 @@ static void gegl_config_parse_env (GeglConfig *config)
   if (g_getenv ("GEGL_CHUNK_SIZE"))
     config->chunk_size = atoi(g_getenv("GEGL_CHUNK_SIZE"));
 
-  if (g_getenv ("GEGL_TILE_SIZE"))
-    {
-      const gchar *str = g_getenv ("GEGL_TILE_SIZE");
-      config->tile_width = atoi(str);
-      str = strchr (str, 'x');
-      if (str)
-        config->tile_height = atoi(str+1);
-    }
-
   if (g_getenv ("GEGL_THREADS"))
     {
       _gegl_threads = atoi(g_getenv("GEGL_THREADS"));
@@ -677,14 +662,6 @@ gegl_post_parse_hook (GOptionContext *context,
     config->tile_cache_size = atoll (cmd_gegl_cache_size)*1024*1024;
   if (cmd_gegl_chunk_size)
     config->chunk_size = atoi (cmd_gegl_chunk_size);
-  if (cmd_gegl_tile_size)
-    {
-      const gchar *str = cmd_gegl_tile_size;
-      config->tile_width = atoi(str);
-      str = strchr (str, 'x');
-      if (str)
-        config->tile_height = atoi(str+1);
-    }
   if (cmd_gegl_threads)
     {
       _gegl_threads = atoi (cmd_gegl_threads);


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