Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_draw.c
| Show First 20 Lines • Show All 562 Lines • ▼ Show 20 Lines | static void drawmeta_contents(Scene *scene, | ||||
| } | } | ||||
| chan_range = (chan_max - chan_min) + 1; | chan_range = (chan_max - chan_min) + 1; | ||||
| draw_height = draw_range / chan_range; | draw_height = draw_range / chan_range; | ||||
| col[3] = 196; /* Alpha, used for all meta children. */ | col[3] = 196; /* Alpha, used for all meta children. */ | ||||
| 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); | ||||
| /* Draw only immediate children (1 level depth). */ | /* Draw only immediate children (1 level depth). */ | ||||
| for (seq = meta_seqbase->first; seq; seq = seq->next) { | for (seq = meta_seqbase->first; seq; seq = seq->next) { | ||||
| const int startdisp = SEQ_time_left_handle_frame_get(scene, seq) + offset; | const int startdisp = SEQ_time_left_handle_frame_get(scene, seq) + offset; | ||||
| const int enddisp = SEQ_time_right_handle_frame_get(scene, seq) + offset; | const int enddisp = SEQ_time_right_handle_frame_get(scene, seq) + offset; | ||||
| if ((startdisp > x2 || enddisp < x1) == 0) { | if ((startdisp > x2 || enddisp < x1) == 0) { | ||||
| float y_chan = (seq->machine - chan_min) / (float)(chan_range)*draw_range; | float y_chan = (seq->machine - chan_min) / (float)(chan_range)*draw_range; | ||||
| ▲ Show 20 Lines • Show All 573 Lines • ▼ Show 20 Lines | static void draw_seq_locked(float x1, float y1, float x2, float y2) | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| static void draw_seq_invalid(float x1, float x2, float y2, float text_margin_y) | static void draw_seq_invalid(float x1, float x2, float y2, float text_margin_y) | ||||
| { | { | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| 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); | ||||
| immUniformColor4f(1.0f, 0.0f, 0.0f, 0.9f); | immUniformColor4f(1.0f, 0.0f, 0.0f, 0.9f); | ||||
| immRectf(pos, x1, y2, x2, text_margin_y); | immRectf(pos, x1, y2, x2, text_margin_y); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| static void calculate_seq_text_offsets( | static void calculate_seq_text_offsets( | ||||
| ▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | for (int timeline_frame = eval_start; timeline_frame <= eval_end; | ||||
| } | } | ||||
| fcurve_batch_add_verts(vbo, y1, y2, y_height, timeline_frame, curve_val, &vert_count); | fcurve_batch_add_verts(vbo, y1, y2, y_height, timeline_frame, curve_val, &vert_count); | ||||
| prev_val = curve_val; | prev_val = curve_val; | ||||
| } | } | ||||
| GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO); | GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO); | ||||
| GPU_vertbuf_data_len_set(vbo, vert_count); | GPU_vertbuf_data_len_set(vbo, vert_count); | ||||
| GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_UNIFORM_COLOR); | GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_batch_uniform_4f(batch, "color", 0.0f, 0.0f, 0.0f, 0.15f); | GPU_batch_uniform_4f(batch, "color", 0.0f, 0.0f, 0.0f, 0.15f); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| if (vert_count > 0) { | if (vert_count > 0) { | ||||
| GPU_batch_draw(batch); | GPU_batch_draw(batch); | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if ((sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_NAME) || | ||||
| y_threshold = ((y2 - y1) / pixely) > 20 * U.dpi_fac; | y_threshold = ((y2 - y1) / pixely) > 20 * U.dpi_fac; | ||||
| } | } | ||||
| else { | else { | ||||
| text_margin_y = y2; | text_margin_y = y2; | ||||
| y_threshold = false; | y_threshold = false; | ||||
| } | } | ||||
| 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); | ||||
| draw_seq_background(scene, seq, pos, x1, x2, y1, y2, is_single_image, show_strip_color_tag); | draw_seq_background(scene, seq, pos, x1, x2, y1, y2, is_single_image, show_strip_color_tag); | ||||
| /* Draw a color band inside color strip. */ | /* Draw a color band inside color strip. */ | ||||
| if (seq->type == SEQ_TYPE_COLOR && y_threshold) { | if (seq->type == SEQ_TYPE_COLOR && y_threshold) { | ||||
| draw_color_strip_band(scene, channels, seq, pos, text_margin_y, y1); | draw_color_strip_band(scene, channels, seq, pos, text_margin_y, y1); | ||||
| } | } | ||||
| Show All 39 Lines | static void draw_seq_strip(const bContext *C, | ||||
| } | } | ||||
| /* Draw Red line on the top of invalid strip (Missing media). */ | /* Draw Red line on the top of invalid strip (Missing media). */ | ||||
| if (!SEQ_sequence_has_source(seq)) { | if (!SEQ_sequence_has_source(seq)) { | ||||
| draw_seq_invalid(x1, x2, y2, text_margin_y); | draw_seq_invalid(x1, x2, y2, text_margin_y); | ||||
| } | } | ||||
| pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | 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); | ||||
| if (!SEQ_transform_is_locked(channels, seq)) { | if (!SEQ_transform_is_locked(channels, seq)) { | ||||
| draw_seq_handle( | draw_seq_handle( | ||||
| scene, v2d, seq, handsize_clamped, SEQ_LEFTHANDLE, pos, seq_active, pixelx, y_threshold); | scene, v2d, seq, handsize_clamped, SEQ_LEFTHANDLE, pos, seq_active, pixelx, y_threshold); | ||||
| draw_seq_handle( | draw_seq_handle( | ||||
| scene, v2d, seq, handsize_clamped, SEQ_RIGHTHANDLE, pos, seq_active, pixelx, y_threshold); | scene, v2d, seq, handsize_clamped, SEQ_RIGHTHANDLE, pos, seq_active, pixelx, y_threshold); | ||||
| } | } | ||||
| Show All 25 Lines | |||||
| static void draw_effect_inputs_highlight(const Scene *scene, Sequence *seq) | static void draw_effect_inputs_highlight(const Scene *scene, Sequence *seq) | ||||
| { | { | ||||
| Sequence *seq1 = seq->seq1; | Sequence *seq1 = seq->seq1; | ||||
| Sequence *seq2 = seq->seq2; | Sequence *seq2 = seq->seq2; | ||||
| Sequence *seq3 = seq->seq3; | Sequence *seq3 = seq->seq3; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| 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); | ||||
| immUniformColor4ub(255, 255, 255, 48); | immUniformColor4ub(255, 255, 255, 48); | ||||
| immRectf(pos, | immRectf(pos, | ||||
| SEQ_time_left_handle_frame_get(scene, seq1), | SEQ_time_left_handle_frame_get(scene, seq1), | ||||
| seq1->machine + SEQ_STRIP_OFSBOTTOM, | seq1->machine + SEQ_STRIP_OFSBOTTOM, | ||||
| SEQ_time_right_handle_frame_get(scene, seq1), | SEQ_time_right_handle_frame_get(scene, seq1), | ||||
| seq1->machine + SEQ_STRIP_OFSTOP); | seq1->machine + SEQ_STRIP_OFSTOP); | ||||
| ▲ Show 20 Lines • Show All 650 Lines • ▼ Show 20 Lines | static void seq_draw_image_origin_and_outline(const bContext *C, Sequence *seq, bool is_active_seq) | ||||
| /* Outline. */ | /* Outline. */ | ||||
| float seq_image_quad[4][2]; | float seq_image_quad[4][2]; | ||||
| SEQ_image_transform_final_quad_get(CTX_data_scene(C), seq, seq_image_quad); | SEQ_image_transform_final_quad_get(CTX_data_scene(C), seq, seq_image_quad); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPU_line_width(2); | GPU_line_width(2); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| float col[3]; | float col[3]; | ||||
| if (is_active_seq) { | if (is_active_seq) { | ||||
| UI_GetThemeColor3fv(TH_SEQ_ACTIVE, col); | UI_GetThemeColor3fv(TH_SEQ_ACTIVE, col); | ||||
| } | } | ||||
| else { | else { | ||||
| UI_GetThemeColor3fv(TH_SEQ_SELECTED, col); | UI_GetThemeColor3fv(TH_SEQ_SELECTED, col); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | #endif | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| seq_prefetch_wm_notify(C, scene); | seq_prefetch_wm_notify(C, scene); | ||||
| } | } | ||||
| static void draw_seq_timeline_channels(View2D *v2d) | static void draw_seq_timeline_channels(View2D *v2d) | ||||
| { | { | ||||
| 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); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| immUniformThemeColor(TH_ROW_ALTERNATE); | immUniformThemeColor(TH_ROW_ALTERNATE); | ||||
| /* Alternating horizontal stripes. */ | /* Alternating horizontal stripes. */ | ||||
| int i = max_ii(1, ((int)v2d->cur.ymin) - 1); | int i = max_ii(1, ((int)v2d->cur.ymin) - 1); | ||||
| while (i < v2d->cur.ymax) { | while (i < v2d->cur.ymax) { | ||||
| if (i & 1) { | if (i & 1) { | ||||
| immRectf(pos, v2d->cur.xmin, i, v2d->cur.xmax, i + 1); | immRectf(pos, v2d->cur.xmin, i, v2d->cur.xmax, i + 1); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | if (last_seq && (last_seq->flag & SELECT)) { | ||||
| } | } | ||||
| /* When active is a Multi-cam strip, highlight its source channel. */ | /* When active is a Multi-cam strip, highlight its source channel. */ | ||||
| else if (last_seq->type == SEQ_TYPE_MULTICAM) { | else if (last_seq->type == SEQ_TYPE_MULTICAM) { | ||||
| int channel = last_seq->multicam_source; | int channel = last_seq->multicam_source; | ||||
| if (channel != 0) { | if (channel != 0) { | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor4ub(255, 255, 255, 48); | immUniformColor4ub(255, 255, 255, 48); | ||||
| immRectf(pos, v2d->cur.xmin, channel, v2d->cur.xmax, channel + 1); | immRectf(pos, v2d->cur.xmin, channel, v2d->cur.xmax, channel + 1); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Draw highlight if "solo preview" is used. */ | /* Draw highlight if "solo preview" is used. */ | ||||
| if (special_seq_update) { | if (special_seq_update) { | ||||
| const Sequence *seq = special_seq_update; | const Sequence *seq = special_seq_update; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| 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); | ||||
| immUniformColor4ub(255, 255, 255, 48); | immUniformColor4ub(255, 255, 255, 48); | ||||
| immRectf(pos, | immRectf(pos, | ||||
| SEQ_time_left_handle_frame_get(scene, seq), | SEQ_time_left_handle_frame_get(scene, seq), | ||||
| seq->machine + SEQ_STRIP_OFSBOTTOM, | seq->machine + SEQ_STRIP_OFSBOTTOM, | ||||
| SEQ_time_right_handle_frame_get(scene, seq), | SEQ_time_right_handle_frame_get(scene, seq), | ||||
| seq->machine + SEQ_STRIP_OFSTOP); | seq->machine + SEQ_STRIP_OFSTOP); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| } | } | ||||
| static void seq_draw_sfra_efra(const Scene *scene, View2D *v2d) | static void seq_draw_sfra_efra(const Scene *scene, View2D *v2d) | ||||
| { | { | ||||
| const Editing *ed = SEQ_editing_get(scene); | const Editing *ed = SEQ_editing_get(scene); | ||||
| const int frame_sta = scene->r.sfra; | const int frame_sta = scene->r.sfra; | ||||
| const int frame_end = scene->r.efra + 1; | const int frame_end = scene->r.efra + 1; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| 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); | ||||
| /* Draw overlay outside of frame range. */ | /* Draw overlay outside of frame range. */ | ||||
| immUniformThemeColorShadeAlpha(TH_BACK, -10, -100); | immUniformThemeColorShadeAlpha(TH_BACK, -10, -100); | ||||
| if (frame_sta < frame_end) { | if (frame_sta < frame_end) { | ||||
| immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)frame_sta, v2d->cur.ymax); | immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)frame_sta, v2d->cur.ymax); | ||||
| immRectf(pos, (float)frame_end, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | immRectf(pos, (float)frame_end, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | ||||
| } | } | ||||
| Show All 25 Lines | if (ed && !BLI_listbase_is_empty(&ed->metastack)) { | ||||
| immUniform4f("color2", 1.0f, 1.0f, 1.0f, 0.0f); | immUniform4f("color2", 1.0f, 1.0f, 1.0f, 0.0f); | ||||
| immUniform1i("size", 8); | immUniform1i("size", 8); | ||||
| immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, ms->disp_range[0], v2d->cur.ymax); | immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, ms->disp_range[0], v2d->cur.ymax); | ||||
| immRectf(pos, ms->disp_range[1], v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | immRectf(pos, ms->disp_range[1], v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColorShade(TH_BACK, -40); | immUniformThemeColorShade(TH_BACK, -40); | ||||
| immBegin(GPU_PRIM_LINES, 4); | immBegin(GPU_PRIM_LINES, 4); | ||||
| immVertex2f(pos, ms->disp_range[0], v2d->cur.ymin); | immVertex2f(pos, ms->disp_range[0], v2d->cur.ymin); | ||||
| immVertex2f(pos, ms->disp_range[0], v2d->cur.ymax); | immVertex2f(pos, ms->disp_range[0], v2d->cur.ymax); | ||||
| immVertex2f(pos, ms->disp_range[1], v2d->cur.ymin); | immVertex2f(pos, ms->disp_range[1], v2d->cur.ymin); | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void draw_cache_view_batch( | static void draw_cache_view_batch( | ||||
| GPUVertBuf *vbo, size_t vert_count, float col_r, float col_g, float col_b, float col_a) | GPUVertBuf *vbo, size_t vert_count, float col_r, float col_g, float col_b, float col_a) | ||||
| { | { | ||||
| GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO); | GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_TRIS, vbo, NULL, GPU_BATCH_OWNS_VBO); | ||||
| if (vert_count > 0) { | if (vert_count > 0) { | ||||
| GPU_vertbuf_data_len_set(vbo, vert_count); | GPU_vertbuf_data_len_set(vbo, vert_count); | ||||
| GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_UNIFORM_COLOR); | GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_batch_uniform_4f(batch, "color", col_r, col_g, col_b, col_a); | GPU_batch_uniform_4f(batch, "color", col_r, col_g, col_b, col_a); | ||||
| GPU_batch_draw(batch); | GPU_batch_draw(batch); | ||||
| } | } | ||||
| GPU_batch_discard(batch); | GPU_batch_discard(batch); | ||||
| } | } | ||||
| static void draw_cache_view(const bContext *C) | static void draw_cache_view(const bContext *C) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| struct View2D *v2d = ®ion->v2d; | struct View2D *v2d = ®ion->v2d; | ||||
| if ((scene->ed->cache_flag & SEQ_CACHE_VIEW_ENABLE) == 0) { | if ((scene->ed->cache_flag & SEQ_CACHE_VIEW_ENABLE) == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| 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); | ||||
| float stripe_bot, stripe_top; | float stripe_bot, stripe_top; | ||||
| float stripe_ofs_y = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin; | float stripe_ofs_y = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin; | ||||
| float stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * U.pixelsize) - | float stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * U.pixelsize) - | ||||
| v2d->cur.ymin; | v2d->cur.ymin; | ||||
| CLAMP_MAX(stripe_ht, 0.2f); | CLAMP_MAX(stripe_ht, 0.2f); | ||||
| CLAMP_MIN(stripe_ofs_y, stripe_ht / 2); | CLAMP_MIN(stripe_ofs_y, stripe_ht / 2); | ||||
| ▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines | |||||