This commit is contained in:
Maurits Rijk 2003-01-18 15:02:50 +00:00
parent a31c0f7d19
commit c311c5c81f
2 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2003-01-18 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/common/CML_explorer.c (CML_next_value): g_rand_new is a
terribly expensive function, not something you want to execute
several million times! Fixes #103025
2003-01-17 Michael Natterer <mitch@gimp.org>
One more Plug-In cleanup, it's still a mess...

View File

@ -431,6 +431,7 @@ static CML_sensitive_widget_table random_sensitives[RANDOM_SENSITIVES_NUM] =
{ NULL, 0 }
};
static GRand *gr;
static gint drawable_id = 0;
static gint copy_source = 0;
static gint copy_destination = 0;
@ -557,7 +558,6 @@ CML_main_function (gint preview_p)
gdouble *hues, *sats, *vals;
gdouble *newh, *news, *newv;
gdouble *haux, *saux, *vaux;
GRand *gr;
/* open THE drawable */
drawable = gimp_drawable_get (drawable_id);
@ -775,7 +775,7 @@ CML_main_function (gint preview_p)
(VALS.val.function == CML_KEEP_VALUES))
gimp_pixel_rgn_get_rect (&src_rgn, src_buffer,
x1, y1 + dy, width_by_pixel, keep_height);
CML_compute_next_step (cell_num, &hues, &sats, &vals, &newh, &news, &newv,
&haux, &saux, &vaux);
@ -924,9 +924,7 @@ CML_next_value (gdouble *vec,
gdouble hold_rate = 1 - param->mod_rate;
gdouble env_factor = 0;
gint index;
GRand *gr;
gr = g_rand_new();
self_mod_rate = (1 - param->env_sensitivity - param->ch_sensitivity);
switch (param->arrange)
@ -1013,8 +1011,6 @@ CML_next_value (gdouble *vec,
Cannonization shuold be done in color mapping phase. */
val = CLAMP (val, 0.0, 1);
g_rand_free (gr);
return val;
}
#undef AVE_DIST