Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/time_scrub_ui.c
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| static int get_centered_text_y(const rcti *rect) | static int get_centered_text_y(const rcti *rect) | ||||
| { | { | ||||
| return BLI_rcti_cent_y(rect) - UI_DPI_FAC * 4; | return BLI_rcti_cent_y(rect) - UI_DPI_FAC * 4; | ||||
| } | } | ||||
| static void draw_background(const rcti *rect) | static void draw_background(const rcti *rect) | ||||
| { | { | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColor(TH_TIME_SCRUB_BACKGROUND); | immUniformThemeColor(TH_TIME_SCRUB_BACKGROUND); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); | immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| Show All 32 Lines | static void draw_current_frame(const Scene *scene, | ||||
| UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color); | UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color); | ||||
| /* Draw vertical line from the bottom of the current frame box to the bottom of the screen. */ | /* Draw vertical line from the bottom of the current frame box to the bottom of the screen. */ | ||||
| const float subframe_x = UI_view2d_view_to_region_x(v2d, BKE_scene_ctime_get(scene)); | const float subframe_x = UI_view2d_view_to_region_x(v2d, BKE_scene_ctime_get(scene)); | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* Outline. */ | /* Outline. */ | ||||
| immUniformThemeColorShadeAlpha(TH_BACK, -25, -100); | immUniformThemeColorShadeAlpha(TH_BACK, -25, -100); | ||||
| immRectf(pos, | immRectf(pos, | ||||
| subframe_x - (line_outline + U.pixelsize), | subframe_x - (line_outline + U.pixelsize), | ||||
| scrub_region_rect->ymax - box_padding, | scrub_region_rect->ymax - box_padding, | ||||
| subframe_x + (line_outline + U.pixelsize), | subframe_x + (line_outline + U.pixelsize), | ||||
| 0.0f); | 0.0f); | ||||
| ▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet) | ||||
| rcti rect; | rcti rect; | ||||
| rect.xmin = 0; | rect.xmin = 0; | ||||
| rect.xmax = region->winx; | rect.xmax = region->winx; | ||||
| rect.ymin = region->winy - UI_TIME_SCRUB_MARGIN_Y; | rect.ymin = region->winy - UI_TIME_SCRUB_MARGIN_Y; | ||||
| rect.ymax = region->winy; | rect.ymax = region->winy; | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColor(TH_BACK); | immUniformThemeColor(TH_BACK); | ||||
| immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); | immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| RNA_pointer_create(&CTX_wm_screen(C)->id, &RNA_DopeSheet, dopesheet, &ptr); | RNA_pointer_create(&CTX_wm_screen(C)->id, &RNA_DopeSheet, dopesheet, &ptr); | ||||
| const uiStyle *style = UI_style_get_dpi(); | const uiStyle *style = UI_style_get_dpi(); | ||||
| Show All 30 Lines | |||||