diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-16 05:45:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-16 05:46:04 +0300 |
commit | 1b462e5a51458e36df886838ee272b4bb18ed4da (patch) | |
tree | dd74f29b57df23219ad68d2579a6271c21e1eddb /source/blender/windowmanager/manipulators | |
parent | b68b26c265d0984da08773196c0d673881fd6c13 (diff) |
Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.
Also use const to prevent unexpected modifications.
This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
Diffstat (limited to 'source/blender/windowmanager/manipulators')
-rw-r--r-- | source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c index 366996a2e03..4273bc75cc9 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c @@ -50,6 +50,8 @@ #include "WM_types.h" #include "wm_event_system.h" +#include "DEG_depsgraph.h" + /* own includes */ #include "wm_manipulator_wmapi.h" #include "wm_manipulator_intern.h" @@ -462,6 +464,7 @@ static int manipulator_find_intersected_3d_intern( ListBase *visible_manipulators, const bContext *C, const int co[2], const int hotspot) { + EvaluationContext eval_ctx; ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); View3D *v3d = sa->spacedata.first; @@ -473,7 +476,9 @@ static int manipulator_find_intersected_3d_intern( BLI_rcti_init_pt_radius(&rect, co, hotspot); - ED_view3d_draw_setup_view(CTX_wm_window(C), C, CTX_data_scene(C), ar, v3d, NULL, NULL, &rect); + CTX_data_eval_ctx(C, &eval_ctx); + + ED_view3d_draw_setup_view(CTX_wm_window(C), &eval_ctx, CTX_data_scene(C), ar, v3d, NULL, NULL, &rect); if (do_passes) GPU_select_begin(buffer, ARRAY_SIZE(buffer), &rect, GPU_SELECT_NEAREST_FIRST_PASS, 0); @@ -490,7 +495,7 @@ static int manipulator_find_intersected_3d_intern( GPU_select_end(); } - ED_view3d_draw_setup_view(CTX_wm_window(C), C, CTX_data_scene(C), ar, v3d, NULL, NULL, NULL); + ED_view3d_draw_setup_view(CTX_wm_window(C), &eval_ctx, CTX_data_scene(C), ar, v3d, NULL, NULL, NULL); const GLuint *hit_near = GPU_select_buffer_near(buffer, hits); |