Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_subwindow.c
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | if (partialrct->xmin == partialrct->xmax) { | ||||
| scissor_pad = true; | scissor_pad = true; | ||||
| } | } | ||||
| else { | else { | ||||
| /* Partial redraw, clipped to region. */ | /* Partial redraw, clipped to region. */ | ||||
| BLI_rcti_isect(winrct, partialrct, drawrct); | BLI_rcti_isect(winrct, partialrct, drawrct); | ||||
| scissor_pad = false; | scissor_pad = false; | ||||
| } | } | ||||
| int x = drawrct->xmin - winrct->xmin; | |||||
| int y = drawrct->ymin - winrct->ymin; | |||||
| int width = BLI_rcti_size_x(winrct) + 1; | int width = BLI_rcti_size_x(winrct) + 1; | ||||
| int height = BLI_rcti_size_y(winrct) + 1; | int height = BLI_rcti_size_y(winrct) + 1; | ||||
| int scissor_width = BLI_rcti_size_x(drawrct); | int scissor_width = BLI_rcti_size_x(drawrct); | ||||
| int scissor_height = BLI_rcti_size_y(drawrct); | int scissor_height = BLI_rcti_size_y(drawrct); | ||||
| /* Partial redraw rect uses different convention than region rect, | /* Partial redraw rect uses different convention than region rect, | ||||
| * so compensate for that here. One pixel offset is noticeable with | * so compensate for that here. One pixel offset is noticeable with | ||||
| * viewport border render. */ | * viewport border render. */ | ||||
| if (scissor_pad) { | if (scissor_pad) { | ||||
| scissor_width += 1; | scissor_width += 1; | ||||
| scissor_height += 1; | scissor_height += 1; | ||||
| } | } | ||||
| glViewport(winrct->xmin, winrct->ymin, width, height); | glViewport(0, 0, width, height); | ||||
| glScissor(drawrct->xmin, drawrct->ymin, scissor_width, scissor_height); | glScissor(x, y, scissor_width, scissor_height); | ||||
| wmOrtho2_pixelspace(width, height); | wmOrtho2_pixelspace(width, height); | ||||
| gpuLoadIdentity(); | gpuLoadIdentity(); | ||||
| } | } | ||||
| void wmWindowViewport(wmWindow *win) | void wmWindowViewport(wmWindow *win) | ||||
| { | { | ||||
| int width = WM_window_pixels_x(win); | int width = WM_window_pixels_x(win); | ||||
| Show All 40 Lines | |||||