Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_draw.c
| Show All 38 Lines | |||||
| #include "GPU_context.h" | #include "GPU_context.h" | ||||
| #include "GPU_debug.h" | #include "GPU_debug.h" | ||||
| #include "GPU_framebuffer.h" | #include "GPU_framebuffer.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "GPU_state.h" | #include "GPU_state.h" | ||||
| #include "GPU_texture.h" | #include "GPU_texture.h" | ||||
| #include "GPU_viewport.h" | #include "GPU_viewport.h" | ||||
| #include "BIF_glutil.h" | |||||
| #include "IMB_imbuf.h" | |||||
| #include "IMB_imbuf_types.h" | |||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_toolsystem.h" | #include "WM_toolsystem.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "wm.h" | #include "wm.h" | ||||
| #include "wm_draw.h" | #include "wm_draw.h" | ||||
| #include "wm_event_system.h" | #include "wm_event_system.h" | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| GPU_debug_group_end(); | GPU_debug_group_end(); | ||||
| region->do_draw = false; | region->do_draw = false; | ||||
| CTX_wm_menu_set(C, NULL); | CTX_wm_menu_set(C, NULL); | ||||
| } | } | ||||
| } | } | ||||
| static void wm_draw_scrim(wmWindow *win) | |||||
| { | |||||
| if (win->scrim) { | |||||
| const float col[4] = {1.0f, 1.0f, 1.0f, 1.0f}; | |||||
| IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_DESATURATE_COLOR); | |||||
| immUniform1f("factor", 0.5f); | |||||
| immDrawPixelsTexScaledFullSize(&state, | |||||
| 0.0f, | |||||
| 0.0f, | |||||
| win->scrim->x, | |||||
| win->scrim->y, | |||||
| GPU_RGBA8, | |||||
| true, | |||||
| win->scrim->rect, | |||||
| (float)win->sizex / (float)win->scrim->x, | |||||
| (float)win->sizey / (float)win->scrim->y, | |||||
| 1.0f, | |||||
| 1.0f, | |||||
| col); | |||||
| } | |||||
| } | |||||
| static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) | static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| bScreen *screen = WM_window_get_active_screen(win); | bScreen *screen = WM_window_get_active_screen(win); | ||||
| GPU_debug_group_begin("Window Redraw"); | GPU_debug_group_begin("Window Redraw"); | ||||
| /* Draw into the window framebuffer, in full window coordinates. */ | /* Draw into the window framebuffer, in full window coordinates. */ | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* After area regions so we can do area 'overlay' drawing. */ | /* After area regions so we can do area 'overlay' drawing. */ | ||||
| UI_SetTheme(0, 0); | UI_SetTheme(0, 0); | ||||
| ED_screen_draw_edges(win); | ED_screen_draw_edges(win); | ||||
| wm_draw_callbacks(win); | wm_draw_callbacks(win); | ||||
| wmWindowViewport(win); | wmWindowViewport(win); | ||||
| if (win->scrim) { | |||||
| wm_draw_scrim(win); | |||||
| } | |||||
| /* Blend in floating regions (menus). */ | /* Blend in floating regions (menus). */ | ||||
| LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { | LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { | ||||
| if (!region->visible) { | if (!region->visible) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| wm_draw_region_blend(region, 0, true); | wm_draw_region_blend(region, 0, true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||