diff options
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index a0f493d0011..c068fbdf7cb 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -30,6 +30,7 @@ #include "BLI_blenlib.h" #include "BLI_math.h" +#include "BLI_rand.h" #include "BLI_utildefines.h" #include "BLI_linklist_stack.h" @@ -55,13 +56,11 @@ #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" -#include "GPU_draw.h" #include "GPU_state.h" #include "GPU_framebuffer.h" #include "BLF_api.h" -#include "IMB_imbuf.h" #include "IMB_imbuf_types.h" #include "IMB_metadata.h" @@ -544,20 +543,20 @@ void ED_region_do_draw(bContext *C, ARegion *ar) region_draw_azones(sa, ar); /* for debugging unneeded area redraws and partial redraw */ -#if 0 - GPU_blend(true); - GPUVertFormat *format = immVertexFormat(); - uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); - immRectf(pos, - ar->drawrct.xmin - ar->winrct.xmin, - ar->drawrct.ymin - ar->winrct.ymin, - ar->drawrct.xmax - ar->winrct.xmin, - ar->drawrct.ymax - ar->winrct.ymin); - immUnbindProgram(); - GPU_blend(false); -#endif + if (G.debug_value == 888) { + GPU_blend(true); + GPUVertFormat *format = immVertexFormat(); + uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformColor4f(BLI_thread_frand(0), BLI_thread_frand(0), BLI_thread_frand(0), 0.1f); + immRectf(pos, + ar->drawrct.xmin - ar->winrct.xmin, + ar->drawrct.ymin - ar->winrct.ymin, + ar->drawrct.xmax - ar->winrct.xmin, + ar->drawrct.ymax - ar->winrct.ymin); + immUnbindProgram(); + GPU_blend(false); + } memset(&ar->drawrct, 0, sizeof(ar->drawrct)); @@ -813,7 +812,7 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea return; } - float coords[4][4] = { + const float coords[4][4] = { /* Bottom-left. */ {sa->totrct.xmin - U.pixelsize, sa->totrct.ymin - U.pixelsize, @@ -1265,9 +1264,6 @@ static void region_rect_recursive( else if (ED_area_is_global(sa)) { prefsizey = ED_region_global_size_y(); } - else if (ar->regiontype == RGN_TYPE_UI && sa->spacetype == SPACE_FILE) { - prefsizey = UI_UNIT_Y * 2 + (UI_UNIT_Y / 2); - } else { prefsizey = UI_DPI_FAC * (ar->sizey > 1 ? ar->sizey + 0.5f : ar->type->prefsizey); } @@ -1831,7 +1827,7 @@ void ED_region_cursor_set(wmWindow *win, ScrArea *sa, ARegion *ar) if (WM_cursor_set_from_tool(win, sa, ar)) { return; } - WM_cursor_set(win, CURSOR_STD); + WM_cursor_set(win, WM_CURSOR_DEFAULT); } } @@ -2438,7 +2434,7 @@ void ED_region_panels_layout_ex(const bContext *C, * instead they calculate offsets for the next panel to start drawing. */ Panel *panel = ar->panels.last; if (panel != NULL) { - int size_dyn[2] = { + const int size_dyn[2] = { UI_UNIT_X * ((panel->flag & PNL_CLOSED) ? 8 : 14) / UI_DPI_FAC, UI_panel_size_y(panel) / UI_DPI_FAC, }; |