diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 17:17:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 17:17:43 +0300 |
commit | ca5fdd857b7864b0336aca655f2c04d00090c0f9 (patch) | |
tree | 5e19a8ec6a5c08ba9d6e8cf1f98cd7d9980a5f23 /source/blender/editors | |
parent | df1c88b652e6977491b7f2b019c326518ccdc320 (diff) | |
parent | 2aef87bfae4a6a91f626780767aab68b7791c9d4 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
7 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 3c0c083dbd7..a13df441c5f 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -866,9 +866,9 @@ static int bake_image_exec(bContext *C, wmOperator *op) RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT(view_layer) : NULL); /* baking itself is threaded, cannot use test_break in threads */ - BLI_init_threads(&threads, do_bake_render, 1); + BLI_threadpool_init(&threads, do_bake_render, 1); bkr.ready = 0; - BLI_insert_thread(&threads, &bkr); + BLI_threadpool_insert(&threads, &bkr); while (bkr.ready == 0) { PIL_sleep_ms(50); @@ -879,7 +879,7 @@ static int bake_image_exec(bContext *C, wmOperator *op) if (!G.background) BKE_blender_test_break(); } - BLI_end_threads(&threads); + BLI_threadpool_end(&threads); if (bkr.result == BAKE_RESULT_NO_OBJECTS) BKE_report(op->reports, RPT_ERROR, "No valid images found to bake to"); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index d4fd62c6dac..0130b93babf 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -339,12 +339,12 @@ static int screen_render_exec(bContext *C, wmOperator *op) RE_SetReports(re, op->reports); - BLI_begin_threaded_malloc(); + BLI_threaded_malloc_begin(); if (is_animation) RE_BlenderAnim(re, mainp, scene, camera_override, lay_override, scene->r.sfra, scene->r.efra, scene->r.frame_step); else RE_BlenderFrame(re, mainp, scene, view_layer, camera_override, lay_override, scene->r.cfra, is_write_still); - BLI_end_threaded_malloc(); + BLI_threaded_malloc_end(); RE_SetReports(re, NULL); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index e339a4c13b6..ae5b825e4ae 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -2694,7 +2694,7 @@ static void project_paint_face_init( int face_seam_flag; if (threaded) - BLI_lock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ + BLI_thread_lock(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ face_seam_flag = ps->faceSeamFlags[tri_index]; @@ -2711,7 +2711,7 @@ static void project_paint_face_init( if ((face_seam_flag & (PROJ_FACE_SEAM1 | PROJ_FACE_SEAM2 | PROJ_FACE_SEAM3)) == 0) { if (threaded) - BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ + BLI_thread_unlock(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ } else { @@ -2737,7 +2737,7 @@ static void project_paint_face_init( /* ps->faceSeamUVs cant be modified when threading, now this is done we can unlock */ if (threaded) - BLI_unlock_thread(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ + BLI_thread_unlock(LOCK_CUSTOM1); /* Other threads could be modifying these vars */ vCoSS[0] = ps->screenCoords[lt_vtri[0]]; vCoSS[1] = ps->screenCoords[lt_vtri[1]]; @@ -4138,7 +4138,7 @@ static bool project_bucket_iter_next( const int diameter = 2 * ps->brush_size; if (ps->thread_tot > 1) - BLI_lock_thread(LOCK_CUSTOM1); + BLI_thread_lock(LOCK_CUSTOM1); //printf("%d %d\n", ps->context_bucket_x, ps->context_bucket_y); @@ -4155,7 +4155,7 @@ static bool project_bucket_iter_next( ps->context_bucket_x++; if (ps->thread_tot > 1) - BLI_unlock_thread(LOCK_CUSTOM1); + BLI_thread_unlock(LOCK_CUSTOM1); return 1; } @@ -4164,7 +4164,7 @@ static bool project_bucket_iter_next( } if (ps->thread_tot > 1) - BLI_unlock_thread(LOCK_CUSTOM1); + BLI_thread_unlock(LOCK_CUSTOM1); return 0; } @@ -4883,7 +4883,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po } if (ps->thread_tot > 1) - BLI_init_threads(&threads, do_projectpaint_thread, ps->thread_tot); + BLI_threadpool_init(&threads, do_projectpaint_thread, ps->thread_tot); pool = BKE_image_pool_new(); @@ -4913,11 +4913,11 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po handles[a].pool = pool; if (ps->thread_tot > 1) - BLI_insert_thread(&threads, &handles[a]); + BLI_threadpool_insert(&threads, &handles[a]); } if (ps->thread_tot > 1) /* wait for everything to be done */ - BLI_end_threads(&threads); + BLI_threadpool_end(&threads); else do_projectpaint_thread(&handles[0]); diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 3d9021480d9..c304ed1f02f 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -896,7 +896,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoNode *unode; /* list is manipulated by multiple threads, so we lock */ - BLI_lock_thread(LOCK_CUSTOM1); + BLI_thread_lock(LOCK_CUSTOM1); if (ss->bm || ELEM(type, @@ -906,17 +906,17 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, /* Dynamic topology stores only one undo node per stroke, * regardless of the number of PBVH nodes modified */ unode = sculpt_undo_bmesh_push(ob, node, type); - BLI_unlock_thread(LOCK_CUSTOM1); + BLI_thread_unlock(LOCK_CUSTOM1); return unode; } else if ((unode = sculpt_undo_get_node(node))) { - BLI_unlock_thread(LOCK_CUSTOM1); + BLI_thread_unlock(LOCK_CUSTOM1); return unode; } unode = sculpt_undo_alloc_node(ob, node, type); - BLI_unlock_thread(LOCK_CUSTOM1); + BLI_thread_unlock(LOCK_CUSTOM1); /* copy threaded, hopefully this is the performance critical part */ diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index cea0a3b4828..43d5348da3e 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -792,7 +792,7 @@ void draw_image_main(const bContext *C, ARegion *ar) * other images are not modifying in such a way so they does not require * lock (sergey) */ - BLI_lock_thread(LOCK_DRAW_IMAGE); + BLI_thread_lock(LOCK_DRAW_IMAGE); } if (show_stereo3d) { @@ -836,7 +836,7 @@ void draw_image_main(const bContext *C, ARegion *ar) draw_image_paint_helpers(C, ar, scene, zoomx, zoomy); if (show_viewer) { - BLI_unlock_thread(LOCK_DRAW_IMAGE); + BLI_thread_unlock(LOCK_DRAW_IMAGE); } /* render info */ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index aa6120942d8..c66d588c50d 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -803,14 +803,14 @@ static void image_main_region_draw(const bContext *C, ARegion *ar) /* ED_space_image_get* will acquire image buffer which requires * lock here by the same reason why lock is needed in draw_image_main */ - BLI_lock_thread(LOCK_DRAW_IMAGE); + BLI_thread_lock(LOCK_DRAW_IMAGE); } ED_space_image_get_size(sima, &width, &height); ED_space_image_get_aspect(sima, &aspx, &aspy); if (show_viewer) - BLI_unlock_thread(LOCK_DRAW_IMAGE); + BLI_thread_unlock(LOCK_DRAW_IMAGE); ED_mask_draw_region(mask, ar, sima->mask_info.draw_flag, diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 3fdc938aec2..a41b133a189 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -268,28 +268,28 @@ static void view3d_stereo3d_setup( data = (Camera *)v3d->camera->data; shiftx = data->shiftx; - BLI_lock_thread(LOCK_VIEW3D); + BLI_thread_lock(LOCK_VIEW3D); data->shiftx = BKE_camera_multiview_shift_x(&scene->r, v3d->camera, viewname); BKE_camera_multiview_view_matrix(&scene->r, v3d->camera, is_left, viewmat); view3d_main_region_setup_view(eval_ctx, scene, v3d, ar, viewmat, NULL, rect); data->shiftx = shiftx; - BLI_unlock_thread(LOCK_VIEW3D); + BLI_thread_unlock(LOCK_VIEW3D); } else { /* SCE_VIEWS_FORMAT_MULTIVIEW */ float viewmat[4][4]; Object *view_ob = v3d->camera; Object *camera = BKE_camera_multiview_render(scene, v3d->camera, viewname); - BLI_lock_thread(LOCK_VIEW3D); + BLI_thread_lock(LOCK_VIEW3D); v3d->camera = camera; BKE_camera_multiview_view_matrix(&scene->r, camera, false, viewmat); view3d_main_region_setup_view(eval_ctx, scene, v3d, ar, viewmat, NULL, rect); v3d->camera = view_ob; - BLI_unlock_thread(LOCK_VIEW3D); + BLI_thread_unlock(LOCK_VIEW3D); } } |