diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-08 13:35:48 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 18:09:33 +0300 |
commit | 4c4a7e84c64472e38811933646f3fefeb071b0b4 (patch) | |
tree | 5145108f3689d4a24e6ed66137165896eeba43f6 /source/blender/blenkernel/intern/colortools.c | |
parent | d2708b0f73d5f0e0a40b36da21c6a0d15405e739 (diff) |
Task scheduler: Use single parallel range function with more flexible function
Now all the fine-tuning is happening using parallel range settings structure,
which avoid passing long lists of arguments, allows extend fine-tuning further,
avoid having lots of various functions which basically does the same thing.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 67153564a0f..46d06a3ac78 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1387,8 +1387,16 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings * ScopesUpdateDataChunk data_chunk = {{0}}; INIT_MINMAX(data_chunk.min, data_chunk.max); - BLI_task_parallel_range_finalize(0, ibuf->y, &data, &data_chunk, sizeof(data_chunk), - scopes_update_cb, scopes_update_finalize, ibuf->y > 256, false); + ParallelRangeSettings settings; + BLI_parallel_range_settings_defaults(&settings); + settings.use_threading = (ibuf->y > 256); + settings.userdata_chunk = &data_chunk; + settings.userdata_chunk_size = sizeof(data_chunk); + settings.func_finalize = scopes_update_finalize; + BLI_task_parallel_range(0, ibuf->y, + &data, + scopes_update_cb, + &settings); /* test for nicer distribution even - non standard, leave it out for a while */ #if 0 |