diff options
author | Antonioya <blendergit@gmail.com> | 2019-07-23 10:46:29 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-07-23 10:46:29 +0300 |
commit | 2204bfcf9e1c3a38e60830bd97775dd72158f4d6 (patch) | |
tree | 4f9c827389a23a431f8771b4ca02f410860c0242 /source/blender/windowmanager/intern/wm_draw.c | |
parent | f64db794ee690f05905ace0a66d81d2e75549b90 (diff) | |
parent | 34ad6da4a06ef46cd19945f61cc5f968538546a8 (diff) |
Merge branch 'master' into temp-gpencil-drw-engine
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 56fc38160f0..fc669c9543e 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -188,6 +188,26 @@ static void wm_area_mark_invalid_backbuf(ScrArea *sa) } } +static void wm_region_test_gizmo_do_draw(ARegion *ar, bool tag_redraw) +{ + if (ar->gizmo_map == NULL) { + return; + } + + wmGizmoMap *gzmap = ar->gizmo_map; + for (wmGizmoGroup *gzgroup = WM_gizmomap_group_list(gzmap)->first; gzgroup; + gzgroup = gzgroup->next) { + for (wmGizmo *gz = gzgroup->gizmos.first; gz; gz = gz->next) { + if (gz->do_draw) { + if (tag_redraw) { + ED_region_tag_redraw_no_rebuild(ar); + } + gz->do_draw = false; + } + } + } +} + static void wm_region_test_render_do_draw(const Scene *scene, struct Depsgraph *depsgraph, ScrArea *sa, @@ -817,6 +837,7 @@ static bool wm_draw_update_test_window(wmWindow *win) ED_screen_areas_iter(win, screen, sa) { for (ar = sa->regionbase.first; ar; ar = ar->next) { + wm_region_test_gizmo_do_draw(ar, true); wm_region_test_render_do_draw(scene, depsgraph, sa, ar); if (ar->visible && ar->do_draw) { @@ -848,6 +869,24 @@ static bool wm_draw_update_test_window(wmWindow *win) return false; } +/* Clear drawing flags, after drawing is complete so any draw flags set during + * drawing don't cause any additional redraws. */ +static void wm_draw_update_clear_window(wmWindow *win) +{ + bScreen *screen = WM_window_get_active_screen(win); + + ED_screen_areas_iter(win, screen, sa) + { + for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { + wm_region_test_gizmo_do_draw(ar, false); + } + } + + screen->do_draw_gesture = false; + screen->do_draw_paintcursor = false; + screen->do_draw_drag = false; +} + void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *UNUSED(ar)) { if (win) { @@ -893,10 +932,7 @@ void wm_draw_update(bContext *C) ED_screen_ensure_updated(wm, win, screen); wm_draw_window(C, win); - - screen->do_draw_gesture = false; - screen->do_draw_paintcursor = false; - screen->do_draw_drag = false; + wm_draw_update_clear_window(win); wm_window_swap_buffers(win); |