Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_draw.c
| Show First 20 Lines • Show All 2,359 Lines • ▼ Show 20 Lines | draw_cache_view_batch( | ||||
| userdata.composite_vbo, userdata.composite_vert_count, 1.0f, 0.6f, 0.0f, 0.4f); | userdata.composite_vbo, userdata.composite_vert_count, 1.0f, 0.6f, 0.0f, 0.4f); | ||||
| draw_cache_view_batch( | draw_cache_view_batch( | ||||
| userdata.final_out_vbo, userdata.final_out_vert_count, 1.0f, 0.4f, 0.2f, 0.4f); | userdata.final_out_vbo, userdata.final_out_vert_count, 1.0f, 0.4f, 0.2f, 0.4f); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| /* Draw sequencer timeline. */ | /* Draw sequencer timeline. */ | ||||
| static void draw_overlap_frame_indicator(const struct Scene *scene, const View2D *v2d) | |||||
| { | |||||
| int overlap_frame = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? | |||||
| scene->ed->over_cfra : | |||||
| scene->r.cfra + scene->ed->over_ofs; | |||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); | |||||
| float viewport_size[4]; | |||||
| GPU_viewport_size_get_f(viewport_size); | |||||
| immUniform2f("viewport_size", viewport_size[2], viewport_size[3]); | |||||
| /* Shader may have color set from past usage - reset it. */ | |||||
| immUniform1i("colors_len", 0); | |||||
| immUniform1f("dash_width", 20.0f * U.pixelsize); | |||||
| immUniform1f("dash_factor", 0.5f); | |||||
| immUniformThemeColor(TH_CFRAME); | |||||
| immBegin(GPU_PRIM_LINES, 2); | |||||
| immVertex2f(pos, overlap_frame, v2d->cur.ymin); | |||||
| immVertex2f(pos, overlap_frame, v2d->cur.ymax); | |||||
| immEnd(); | |||||
| immUnbindProgram(); | |||||
| } | |||||
| void draw_timeline_seq(const bContext *C, ARegion *region) | void draw_timeline_seq(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Editing *ed = SEQ_editing_get(scene, false); | Editing *ed = SEQ_editing_get(scene, false); | ||||
| SpaceSeq *sseq = CTX_wm_space_seq(C); | SpaceSeq *sseq = CTX_wm_space_seq(C); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| short cfra_flag = 0; | short cfra_flag = 0; | ||||
| float col[3]; | float col[3]; | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | if (ed) { | ||||
| UI_view2d_text_cache_draw(region); | UI_view2d_text_cache_draw(region); | ||||
| } | } | ||||
| UI_view2d_view_ortho(v2d); | UI_view2d_view_ortho(v2d); | ||||
| if ((sseq->flag & SEQ_DRAWFRAMES) == 0) { | if ((sseq->flag & SEQ_DRAWFRAMES) == 0) { | ||||
| cfra_flag |= DRAWCFRA_UNIT_SECONDS; | cfra_flag |= DRAWCFRA_UNIT_SECONDS; | ||||
| } | } | ||||
| /* Draw overlap frame frame indicator. */ | |||||
| if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) { | |||||
| int overlap_frame = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? | |||||
| scene->ed->over_cfra : | |||||
| scene->r.cfra + scene->ed->over_ofs; | |||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); | |||||
| float viewport_size[4]; | |||||
| GPU_viewport_size_get_f(viewport_size); | |||||
| immUniform2f("viewport_size", viewport_size[2], viewport_size[3]); | |||||
| /* Shader may have color set from past usage - reset it. */ | |||||
| immUniform1i("colors_len", 0); | |||||
| immUniform1f("dash_width", 20.0f * U.pixelsize); | |||||
| immUniform1f("dash_factor", 0.5f); | |||||
| immUniformThemeColor(TH_CFRAME); | |||||
| immBegin(GPU_PRIM_LINES, 2); | |||||
| immVertex2f(pos, overlap_frame, v2d->cur.ymin); | |||||
| immVertex2f(pos, overlap_frame, v2d->cur.ymax); | |||||
| immEnd(); | |||||
| immUnbindProgram(); | |||||
| } | |||||
| UI_view2d_view_orthoSpecial(region, v2d, 1); | UI_view2d_view_orthoSpecial(region, v2d, 1); | ||||
| int marker_draw_flag = DRAW_MARKERS_MARGIN; | int marker_draw_flag = DRAW_MARKERS_MARGIN; | ||||
| if (sseq->flag & SEQ_SHOW_MARKERS) { | if (sseq->flag & SEQ_SHOW_MARKERS) { | ||||
| ED_markers_draw(C, marker_draw_flag); | ED_markers_draw(C, marker_draw_flag); | ||||
| } | } | ||||
| UI_view2d_view_ortho(v2d); | UI_view2d_view_ortho(v2d); | ||||
| if (ed) { | // if (ed) { | ||||
jbakker: remove these lines | |||||
| draw_cache_view(C); | // draw_cache_view(C); | ||||
| } | // } | ||||
ISSUnsubmitted Not Done Inline ActionsThis is normally hidden for users, but I sometimes need view cache state for debugging. Why did you disable it? ISS: This is normally hidden for users, but I sometimes need view cache state for debugging. Why did… | |||||
| ANIM_draw_previewrange(C, v2d, 1); | ANIM_draw_previewrange(C, v2d, 1); | ||||
| /* Draw registered callbacks. */ | /* Draw registered callbacks. */ | ||||
| GPU_framebuffer_bind(framebuffer_overlay); | GPU_framebuffer_bind(framebuffer_overlay); | ||||
| ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW); | ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW); | ||||
| GPU_framebuffer_bind_no_srgb(framebuffer_overlay); | GPU_framebuffer_bind_no_srgb(framebuffer_overlay); | ||||
| Show All 10 Lines | |||||
| } | } | ||||
| void draw_timeline_seq_display(const bContext *C, ARegion *region) | void draw_timeline_seq_display(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| const Scene *scene = CTX_data_scene(C); | const Scene *scene = CTX_data_scene(C); | ||||
| const SpaceSeq *sseq = CTX_wm_space_seq(C); | const SpaceSeq *sseq = CTX_wm_space_seq(C); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) { | |||||
| UI_view2d_view_ortho(v2d); | |||||
| draw_cache_view(C); | |||||
| draw_overlap_frame_indicator(scene, v2d); | |||||
| UI_view2d_view_restore(C); | |||||
| } | |||||
| ED_time_scrub_draw_current_frame(region, scene, !(sseq->flag & SEQ_DRAWFRAMES), true); | ED_time_scrub_draw_current_frame(region, scene, !(sseq->flag & SEQ_DRAWFRAMES), true); | ||||
| UI_view2d_scrollers_draw(v2d, NULL); | UI_view2d_scrollers_draw(v2d, NULL); | ||||
| } | } | ||||
remove these lines