Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dalai@blender.org>2021-09-23 16:53:38 +0300
committerDalai Felinto <dalai@blender.org>2021-09-23 18:41:11 +0300
commitd0493796a6f40db8dcdd4a9058b98a69282d4759 (patch)
tree7f9e26a80147fc473d2c6a705cfa89a87302bd97 /source/blender/editors/animation
parentf11bcb5a80eb106560678c8c60be32ad997d6641 (diff)
Cleanup: Remove hardcoded values and rename keyframe shape shaders
No functional change. The shader is complicated by itself, having hardcoded values makes it even more cryptic. I also renamed the shader because the shader is not for the keyfarme diamond only, but for all the keyframe shapes. Differential Revision: https://developer.blender.org/D12615
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframes_draw.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index ac7db9f4f46..e3ea8f0ab21 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -146,31 +146,31 @@ void draw_keyframe_shape(float x,
/* Handle type to outline shape. */
switch (handle_type) {
case KEYFRAME_HANDLE_AUTO_CLAMP:
- flags = 0x2;
+ flags = GPU_KEYFRAME_SHAPE_CIRCLE;
break; /* circle */
case KEYFRAME_HANDLE_AUTO:
- flags = 0x12;
+ flags = GPU_KEYFRAME_SHAPE_CIRCLE | GPU_KEYFRAME_SHAPE_INNER_DOT;
break; /* circle with dot */
case KEYFRAME_HANDLE_VECTOR:
- flags = 0xC;
+ flags = GPU_KEYFRAME_SHAPE_SQUARE;
break; /* square */
case KEYFRAME_HANDLE_ALIGNED:
- flags = 0x5;
+ flags = GPU_KEYFRAME_SHAPE_DIAMOND | GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL;
break; /* clipped diamond */
case KEYFRAME_HANDLE_FREE:
default:
- flags = 1; /* diamond */
+ flags = GPU_KEYFRAME_SHAPE_DIAMOND; /* diamond */
}
/* Extreme type to arrow-like shading. */
if (extreme_type & KEYFRAME_EXTREME_MAX) {
- flags |= 0x100;
+ flags |= GPU_KEYFRAME_SHAPE_ARROW_END_MAX;
}
if (extreme_type & KEYFRAME_EXTREME_MIN) {
- flags |= 0x200;
+ flags |= GPU_KEYFRAME_SHAPE_ARROW_END_MIN;
}
- if (extreme_type & KEYFRAME_EXTREME_MIXED) {
+ if (extreme_type & GPU_KEYFRAME_SHAPE_ARROW_END_MIXED) {
flags |= 0x400;
}
}
@@ -584,7 +584,7 @@ static void ED_keylist_draw_list_draw_keys(AnimKeylistDrawList *draw_list, View2
sh_bindings.flags_id = GPU_vertformat_attr_add(format, "flags", GPU_COMP_U32, 1, GPU_FETCH_INT);
GPU_program_point_size(true);
- immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
+ immBindBuiltinProgram(GPU_SHADER_KEYFRAME_SHAPE);
immUniform1f("outline_scale", 1.0f);
immUniform2f("ViewportSize", BLI_rcti_size_x(&v2d->mask) + 1, BLI_rcti_size_y(&v2d->mask) + 1);
immBegin(GPU_PRIM_POINTS, visible_key_len);