"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gegl/gegl-parallel.c" between
gegl-0.4.18.tar.xz and gegl-0.4.20.tar.xz

About: GEGL (Generic Graphics Library) is a graph based image processing framework (mainly developed for GIMP).

gegl-parallel.c  (gegl-0.4.18.tar.xz):gegl-parallel.c  (gegl-0.4.20.tar.xz)
skipping to change at line 249 skipping to change at line 249
g_return_if_fail (func != NULL); g_return_if_fail (func != NULL);
if (size == 0) if (size == 0)
return; return;
n_threads = gegl_parallel_distribute_get_optimal_n_threads ( n_threads = gegl_parallel_distribute_get_optimal_n_threads (
size, size,
thread_cost); thread_cost);
n_threads = MIN (n_threads, size);
if (n_threads == 1) if (n_threads == 1)
{ {
func (0, size, user_data); func (0, size, user_data);
return; return;
} }
data.size = size; data.size = size;
data.func = func; data.func = func;
data.user_data = user_data; data.user_data = user_data;
skipping to change at line 330 skipping to change at line 332
{ {
GeglParallelDistributeAreaData data; GeglParallelDistributeAreaData data;
gint n_threads; gint n_threads;
g_return_if_fail (area != NULL); g_return_if_fail (area != NULL);
g_return_if_fail (func != NULL); g_return_if_fail (func != NULL);
if (area->width <= 0 || area->height <= 0) if (area->width <= 0 || area->height <= 0)
return; return;
if (split_strategy == GEGL_SPLIT_STRATEGY_AUTO)
{
if (area->width > area->height)
split_strategy = GEGL_SPLIT_STRATEGY_VERTICAL;
else
split_strategy = GEGL_SPLIT_STRATEGY_HORIZONTAL;
}
n_threads = gegl_parallel_distribute_get_optimal_n_threads ( n_threads = gegl_parallel_distribute_get_optimal_n_threads (
(gdouble) area->width * (gdouble) area->height, (gdouble) area->width * (gdouble) area->height,
thread_cost); thread_cost);
if (n_threads == 1) switch (split_strategy)
{ {
func (area, user_data); case GEGL_SPLIT_STRATEGY_HORIZONTAL:
n_threads = MIN (n_threads, area->height);
break;
return; case GEGL_SPLIT_STRATEGY_VERTICAL:
n_threads = MIN (n_threads, area->width);
break;
default:
g_return_if_reached ();
} }
if (split_strategy == GEGL_SPLIT_STRATEGY_AUTO) if (n_threads == 1)
{ {
if (area->width > area->height) func (area, user_data);
split_strategy = GEGL_SPLIT_STRATEGY_VERTICAL;
else return;
split_strategy = GEGL_SPLIT_STRATEGY_HORIZONTAL;
} }
data.area = area; data.area = area;
data.split_strategy = split_strategy; data.split_strategy = split_strategy;
data.func = func; data.func = func;
data.user_data = user_data; data.user_data = user_data;
gegl_parallel_distribute ( gegl_parallel_distribute (
n_threads, n_threads,
(GeglParallelDistributeFunc) gegl_parallel_distribute_area_func, (GeglParallelDistributeFunc) gegl_parallel_distribute_area_func,
 End of changes. 7 change blocks. 
8 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)