Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mask/mask_draw.c
| Show All 32 Lines | |||||
| #include "DNA_mask_types.h" | #include "DNA_mask_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_object_types.h" /* SELECT */ | #include "DNA_object_types.h" /* SELECT */ | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "ED_clip.h" | #include "ED_clip.h" | ||||
| #include "ED_mask.h" /* own include */ | #include "ED_mask.h" /* own include */ | ||||
| #include "ED_screen.h" | |||||
| #include "ED_space_api.h" | #include "ED_space_api.h" | ||||
| #include "BIF_glutil.h" | #include "BIF_glutil.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "GPU_shader.h" | #include "GPU_shader.h" | ||||
| #include "GPU_matrix.h" | #include "GPU_matrix.h" | ||||
| #include "GPU_state.h" | #include "GPU_state.h" | ||||
| ▲ Show 20 Lines • Show All 748 Lines • ▼ Show 20 Lines | void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra, const int efra) | ||||
| const float framelen = ar->winx / (float)(efra - sfra + 1); | const float framelen = ar->winx / (float)(efra - sfra + 1); | ||||
| MaskLayer *masklay = BKE_mask_layer_active(mask); | MaskLayer *masklay = BKE_mask_layer_active(mask); | ||||
| if (masklay) { | if (masklay) { | ||||
| unsigned int num_lines = BLI_listbase_count(&masklay->splines_shapes); | unsigned int num_lines = BLI_listbase_count(&masklay->splines_shapes); | ||||
| if (num_lines > 0) { | if (num_lines > 0) { | ||||
| /* Local coordinate visible rect inside region, to accommodate overlapping ui. */ | |||||
sergey: Comment is a full sentence, starting with capital letter and ending with a fullstop. | |||||
| const rcti *rect_visible = ED_region_visible_rect(ar); | |||||
| const int region_bottom = rect_visible->ymin; | |||||
| 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); | ||||
| immUniformColor4ub(255, 175, 0, 255); | immUniformColor4ub(255, 175, 0, 255); | ||||
| immBegin(GPU_PRIM_LINES, 2 * num_lines); | immBegin(GPU_PRIM_LINES, 2 * num_lines); | ||||
| for (MaskLayerShape *masklay_shape = masklay->splines_shapes.first; masklay_shape; | for (MaskLayerShape *masklay_shape = masklay->splines_shapes.first; masklay_shape; | ||||
| masklay_shape = masklay_shape->next) { | masklay_shape = masklay_shape->next) { | ||||
| int frame = masklay_shape->frame; | int frame = masklay_shape->frame; | ||||
| /* draw_keyframe(i, CFRA, sfra, framelen, 1); */ | /* draw_keyframe(i, CFRA, sfra, framelen, 1); */ | ||||
| int height = (frame == cfra) ? 22 : 10; | int height = (frame == cfra) ? 22 : 10; | ||||
| int x = (frame - sfra) * framelen; | int x = (frame - sfra) * framelen; | ||||
| immVertex2i(pos, x, 0); | immVertex2i(pos, x, region_bottom); | ||||
| immVertex2i(pos, x, height); | immVertex2i(pos, x, region_bottom + height * UI_DPI_FAC); | ||||
| } | } | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
Comment is a full sentence, starting with capital letter and ending with a fullstop.