Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_draw.c
| Show First 20 Lines • Show All 801 Lines • ▼ Show 20 Lines | #endif | ||||
| /* Draw overlays and paint cursors. */ | /* Draw overlays and paint cursors. */ | ||||
| ED_screen_areas_iter (win, screen, area) { | ED_screen_areas_iter (win, screen, area) { | ||||
| LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | ||||
| if (!region->visible) { | if (!region->visible) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| const bool do_paint_cursor = (wm->paintcursors.first && region == screen->active_region); | const bool do_paint_cursor = (wm->paintcursors.first && region == screen->active_region); | ||||
| const bool do_draw_drags = (wm->drags.first && region == screen->active_region); | |||||
| const bool do_draw_overlay = (region->type && region->type->draw_overlay); | const bool do_draw_overlay = (region->type && region->type->draw_overlay); | ||||
| if (!(do_paint_cursor || do_draw_overlay)) { | if (!(do_paint_cursor || do_draw_drags || do_draw_overlay)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| CTX_wm_area_set(C, area); | CTX_wm_area_set(C, area); | ||||
| CTX_wm_region_set(C, region); | CTX_wm_region_set(C, region); | ||||
| if (do_draw_overlay) { | if (do_draw_overlay) { | ||||
| wm_region_draw_overlay(C, area, region); | wm_region_draw_overlay(C, area, region); | ||||
| } | } | ||||
| if (do_paint_cursor) { | if (do_paint_cursor) { | ||||
| wm_paintcursor_draw(C, area, region); | wm_paintcursor_draw(C, area, region); | ||||
| } | } | ||||
| if (do_draw_drags) { | |||||
| wm_drags_draw(C, win); | |||||
| } | |||||
| CTX_wm_region_set(C, NULL); | CTX_wm_region_set(C, NULL); | ||||
| CTX_wm_area_set(C, NULL); | CTX_wm_area_set(C, NULL); | ||||
| } | } | ||||
| } | } | ||||
| wmWindowViewport(win); | wmWindowViewport(win); | ||||
| /* Blend in overlapping area regions */ | /* Blend in overlapping area regions */ | ||||
| ED_screen_areas_iter (win, screen, area) { | ED_screen_areas_iter (win, screen, area) { | ||||
| Show All 20 Lines | LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { | ||||
| wm_draw_region_blend(region, 0, true); | wm_draw_region_blend(region, 0, true); | ||||
| } | } | ||||
| /* always draw, not only when screen tagged */ | /* always draw, not only when screen tagged */ | ||||
| if (win->gesture.first) { | if (win->gesture.first) { | ||||
| wm_gesture_draw(win); | wm_gesture_draw(win); | ||||
| } | } | ||||
| /* needs pixel coords in screen */ | |||||
| if (wm->drags.first) { | |||||
| wm_drags_draw(C, win, NULL); | |||||
| } | |||||
| GPU_debug_group_end(); | GPU_debug_group_end(); | ||||
| } | } | ||||
| static void wm_draw_window(bContext *C, wmWindow *win) | static void wm_draw_window(bContext *C, wmWindow *win) | ||||
| { | { | ||||
| bScreen *screen = WM_window_get_active_screen(win); | bScreen *screen = WM_window_get_active_screen(win); | ||||
| bool stereo = WM_stereo3d_enabled(win, false); | bool stereo = WM_stereo3d_enabled(win, false); | ||||
| ▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines | |||||