Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_draw.c
| Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | if (screen->temp && BLI_listbase_is_single(&screen->areabase)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const int winsize_x = WM_window_pixels_x(win); | const int winsize_x = WM_window_pixels_x(win); | ||||
| const int winsize_y = WM_window_pixels_y(win); | const int winsize_y = WM_window_pixels_y(win); | ||||
| float col[4], corner_scale, edge_thickness; | float col[4], corner_scale, edge_thickness; | ||||
| int verts_per_corner = 0; | int verts_per_corner = 0; | ||||
| ScrArea *area; | |||||
| rcti scissor_rect; | rcti scissor_rect; | ||||
| BLI_rcti_init_minmax(&scissor_rect); | BLI_rcti_init_minmax(&scissor_rect); | ||||
| for (area = screen->areabase.first; area; area = area->next) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y}); | BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y}); | ||||
| BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y}); | BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y}); | ||||
| } | } | ||||
| if (GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_UNIX, GPU_DRIVER_ANY)) { | if (GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_UNIX, GPU_DRIVER_ANY)) { | ||||
| /* For some reason, on linux + Intel UHD Graphics 620 the driver | /* For some reason, on linux + Intel UHD Graphics 620 the driver | ||||
| * hangs if we don't flush before this. (See T57455) */ | * hangs if we don't flush before this. (See T57455) */ | ||||
| GPU_flush(); | GPU_flush(); | ||||
| Show All 18 Lines | void ED_screen_draw_edges(wmWindow *win) | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPUBatch *batch = batch_screen_edges_get(&verts_per_corner); | GPUBatch *batch = batch_screen_edges_get(&verts_per_corner); | ||||
| GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_AREA_EDGES); | GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_AREA_EDGES); | ||||
| GPU_batch_uniform_1i(batch, "cornerLen", verts_per_corner); | GPU_batch_uniform_1i(batch, "cornerLen", verts_per_corner); | ||||
| GPU_batch_uniform_1f(batch, "scale", corner_scale); | GPU_batch_uniform_1f(batch, "scale", corner_scale); | ||||
| GPU_batch_uniform_4fv(batch, "color", col); | GPU_batch_uniform_4fv(batch, "color", col); | ||||
| for (area = screen->areabase.first; area; area = area->next) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| drawscredge_area(area, winsize_x, winsize_y, edge_thickness); | drawscredge_area(area, winsize_x, winsize_y, edge_thickness); | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| if (U.pixelsize <= 1.0f) { | if (U.pixelsize <= 1.0f) { | ||||
| GPU_scissor_test(false); | GPU_scissor_test(false); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines | |||||