Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_draw.c
| Show First 20 Lines • Show All 955 Lines • ▼ Show 20 Lines | static void draw_seq_strip(const bContext *C, | ||||
| imm_draw_box_wire_2d(pos, x1, y1, x2, y2); /* outline */ | imm_draw_box_wire_2d(pos, x1, y1, x2, y2); /* outline */ | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| /* calculate if seq is long enough to print a name */ | /* calculate if seq is long enough to print a name */ | ||||
| x1 = seq->startdisp + handsize_clamped; | x1 = seq->startdisp + handsize_clamped; | ||||
| x2 = seq->enddisp - handsize_clamped; | x2 = seq->enddisp - handsize_clamped; | ||||
| float scroller_vert_xoffs = (V2D_SCROLL_WIDTH_TEXT + SEQ_SCROLLER_TEXT_OFFSET) * pixelx; | float scroller_vert_xoffs = (V2D_SCROLL_WIDTH_HANDLES + SEQ_SCROLLER_TEXT_OFFSET) * pixelx; | ||||
| /* info text on the strip */ | /* info text on the strip */ | ||||
| if (x1 < v2d->cur.xmin + scroller_vert_xoffs) { | if (x1 < v2d->cur.xmin + scroller_vert_xoffs) { | ||||
| x1 = v2d->cur.xmin + scroller_vert_xoffs; | x1 = v2d->cur.xmin + scroller_vert_xoffs; | ||||
| } | } | ||||
| else if (x1 > v2d->cur.xmax) { | else if (x1 > v2d->cur.xmax) { | ||||
| x1 = v2d->cur.xmax; | x1 = v2d->cur.xmax; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | static bool draw_cache_view_cb( | ||||
| switch (cache_type) { | switch (cache_type) { | ||||
| case SEQ_CACHE_STORE_FINAL_OUT: | case SEQ_CACHE_STORE_FINAL_OUT: | ||||
| if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) { | if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) { | ||||
| color[0] = 1.0f; | color[0] = 1.0f; | ||||
| color[1] = 0.4f; | color[1] = 0.4f; | ||||
| color[2] = 0.2f; | color[2] = 0.2f; | ||||
| stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * U.pixelsize) - | stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * U.pixelsize) - | ||||
| v2d->cur.ymin; | v2d->cur.ymin; | ||||
| stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HEIGHT_TEXT); | stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HEIGHT_HANDLES); | ||||
| stripe_top = stripe_bot + stripe_ht; | stripe_top = stripe_bot + stripe_ht; | ||||
| break; | break; | ||||
| } | } | ||||
| else { | else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| case SEQ_CACHE_STORE_RAW: | case SEQ_CACHE_STORE_RAW: | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | static void draw_cache_view(const bContext *C) | ||||
| 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_2D_UNIFORM_COLOR); | ||||
| float stripe_bot, stripe_top, stripe_offs; | float stripe_bot, stripe_top, stripe_offs; | ||||
| 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; | ||||
| if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) { | if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) { | ||||
| stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HEIGHT_TEXT); | stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HEIGHT_HANDLES); | ||||
| stripe_top = stripe_bot + stripe_ht; | stripe_top = stripe_bot + stripe_ht; | ||||
| float bg_color[4] = {1.0f, 0.4f, 0.2f, 0.1f}; | float bg_color[4] = {1.0f, 0.4f, 0.2f, 0.1f}; | ||||
| immUniformColor4f(bg_color[0], bg_color[1], bg_color[2], bg_color[3]); | immUniformColor4f(bg_color[0], bg_color[1], bg_color[2], bg_color[3]); | ||||
| immRectf(pos, scene->r.sfra, stripe_bot, scene->r.efra, stripe_top); | immRectf(pos, scene->r.sfra, stripe_bot, scene->r.efra, stripe_top); | ||||
| } | } | ||||
| for (Sequence *seq = scene->ed->seqbasep->first; seq != NULL; seq = seq->next) { | for (Sequence *seq = scene->ed->seqbasep->first; seq != NULL; seq = seq->next) { | ||||
| ▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | void draw_timeline_seq(const bContext *C, ARegion *ar) | ||||
| ED_scrubbing_draw(ar, scene, !(sseq->flag & SEQ_DRAWFRAMES), true); | ED_scrubbing_draw(ar, scene, !(sseq->flag & SEQ_DRAWFRAMES), true); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | scrollers = UI_view2d_scrollers_calc(v2d, NULL); | ||||
| UI_view2d_scrollers_draw(v2d, scrollers); | UI_view2d_scrollers_draw(v2d, scrollers); | ||||
| UI_view2d_scrollers_free(scrollers); | UI_view2d_scrollers_free(scrollers); | ||||
| /* channel numbers */ | /* channel numbers */ | ||||
| UI_view2d_draw_scale_y__block(ar, v2d, &v2d->vert, TH_SCROLL_TEXT); | { | ||||
| rcti rect; | |||||
| BLI_rcti_init(&rect, | |||||
| 0, | |||||
| 15 * UI_DPI_FAC, | |||||
| 15 * UI_DPI_FAC, | |||||
| UI_DPI_FAC * ar->sizey - UI_SCRUBBING_MARGIN_Y); | |||||
| UI_view2d_draw_scale_y__block(ar, v2d, &rect, TH_SCROLL_TEXT); | |||||
| } | |||||
| } | } | ||||