diff options
Diffstat (limited to 'source/blender/editors/space_image/space_image.c')
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 5e1a6882d56..b0571d47736 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -642,6 +642,8 @@ static void image_main_region_draw(const bContext *C, ARegion *region) Mask *mask = NULL; Scene *scene = CTX_data_scene(C); View2D *v2d = ®ion->v2d; + Image *image = ED_space_image(sima); + const bool show_viewer = (image && image->source == IMA_SRC_VIEWER); /* XXX not supported yet, disabling for now */ scene->r.scemode &= ~R_COMP_CROP; @@ -656,8 +658,14 @@ static void image_main_region_draw(const bContext *C, ARegion *region) mask = ED_space_image_get_mask(sima); } - /* we draw image in pixelspace */ + if (show_viewer) { + BLI_thread_lock(LOCK_DRAW_IMAGE); + } DRW_draw_view(C); + if (show_viewer) { + BLI_thread_unlock(LOCK_DRAW_IMAGE); + } + draw_image_main_helpers(C, region); /* Draw Meta data of the image isn't added to the DrawManager as it is @@ -685,12 +693,9 @@ static void image_main_region_draw(const bContext *C, ARegion *region) UI_view2d_view_restore(C); if (mask) { - Image *image = ED_space_image(sima); - int width, height, show_viewer; + int width, height; float aspx, aspy; - show_viewer = (image && image->source == IMA_SRC_VIEWER); - if (show_viewer) { /* ED_space_image_get* will acquire image buffer which requires * lock here by the same reason why lock is needed in draw_image_main |