Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_draw.c
| Show First 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | void draw_image_cache(const bContext *C, ARegion *ar) | ||||
| if (!ED_space_image_show_cache(sima)) { | if (!ED_space_image_show_cache(sima)) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (sima->mode == SI_MODE_MASK) { | if (sima->mode == SI_MODE_MASK) { | ||||
| mask = ED_space_image_get_mask(sima); | mask = ED_space_image_get_mask(sima); | ||||
| } | } | ||||
| /* local coordinate visible rect inside region, to accommodate overlapping ui */ | |||||
sergey: Same as above. | |||||
| const rcti *rect_visible = ED_region_visible_rect(ar); | |||||
| const int region_bottom = rect_visible->ymin; | |||||
| GPU_blend(true); | GPU_blend(true); | ||||
| GPU_blend_set_func_separate( | GPU_blend_set_func_separate( | ||||
| GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); | GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); | ||||
| /* Draw cache background. */ | /* Draw cache background. */ | ||||
| ED_region_cache_draw_background(ar); | ED_region_cache_draw_background(ar); | ||||
| /* Draw cached segments. */ | /* Draw cached segments. */ | ||||
| Show All 11 Lines | void draw_image_cache(const bContext *C, ARegion *ar) | ||||
| /* Draw current frame. */ | /* Draw current frame. */ | ||||
| x = (cfra - sfra) / (efra - sfra + 1) * ar->winx; | x = (cfra - sfra) / (efra - sfra + 1) * ar->winx; | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| immUniformThemeColor(TH_CFRAME); | immUniformThemeColor(TH_CFRAME); | ||||
| immRecti(pos, x, 0, x + ceilf(framelen), 8 * UI_DPI_FAC); | immRecti(pos, x, region_bottom, x + ceilf(framelen), region_bottom + 8 * UI_DPI_FAC); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ED_region_cache_draw_curfra_label(cfra, x, 8.0f * UI_DPI_FAC); | ED_region_cache_draw_curfra_label(cfra, x, region_bottom + 8.0f * UI_DPI_FAC); | ||||
| if (mask != NULL) { | if (mask != NULL) { | ||||
| ED_mask_draw_frames(mask, ar, cfra, sfra, efra); | ED_mask_draw_frames(mask, ar, cfra, sfra, efra); | ||||
| } | } | ||||
| } | } | ||||
Same as above.