From bf1b622dd962416fef94ccb2f47878eced31e20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 16 Aug 2020 15:38:34 +0200 Subject: GPUState: GPU_blend final API renaming We now use GPU_blend for enabling / disabling blending and explicitly set the blend equation. --- source/blender/editors/animation/anim_channels_defines.c | 6 +++--- source/blender/editors/animation/anim_draw.c | 12 ++++++------ source/blender/editors/animation/anim_markers.c | 12 ++++++------ source/blender/editors/animation/keyframes_draw.c | 4 ++-- source/blender/editors/animation/time_scrub_ui.c | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index aa5dffffe36..656ff844948 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4386,8 +4386,8 @@ void ANIM_channel_draw( } /* set blending again, as may not be set in previous step */ - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); /* step 1) draw backdrop ........................................... */ if (acf->draw_backdrop) { @@ -4436,7 +4436,7 @@ void ANIM_channel_draw( } /* turn off blending, since not needed anymore... */ - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); /* icon is drawn as widget now... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) { diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 16c6638b6d9..0bebc25863b 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -98,8 +98,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width) /* only draw this if preview range is set */ if (PRVRANGEON) { - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -120,7 +120,7 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width) immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } } @@ -132,8 +132,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width) void ANIM_draw_framerange(Scene *scene, View2D *v2d) { /* draw darkened area outside of active timeline frame range */ - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -149,7 +149,7 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d) immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); /* thin lines where the actual frames are */ immUniformThemeColorShade(TH_BACK, -60); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4e4e6b38342..5f755b9f4d9 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -499,15 +499,15 @@ static void draw_marker( marker_color_get(marker, text_color, line_color); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); draw_marker_line(line_color, xpos, UI_DPI_FAC * 20, region_height); int icon_id = marker_get_icon_id(marker, flag); UI_icon_draw(xpos - 0.55f * UI_DPI_ICON_SIZE, UI_DPI_FAC * 18, icon_id); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); float name_y = UI_DPI_FAC * 18; /* Give an offset to the marker name when selected, @@ -528,12 +528,12 @@ static void draw_markers_background(rctf *rect) immUniformColor4ubv(shade); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); immUnbindProgram(); } diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index c69f3ce3e3a..4d6d7fa3ad5 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -692,7 +692,7 @@ static void draw_keylist(View2D *v2d, const float smaller_sz = 0.35f * icon_sz; const float ipo_sz = 0.1f * icon_sz; - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); /* locked channels are less strongly shown, as feedback for locked channels in DopeSheet */ /* TODO: allow this opacity factor to be themed? */ @@ -848,7 +848,7 @@ static void draw_keylist(View2D *v2d, } } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } /* *************************** Channel Drawing Funcs *************************** */ diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index 8c2c01c60de..1690c9e3bba 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -66,12 +66,12 @@ static void draw_background(const rcti *rect) immUniformThemeColor(TH_TIME_SCRUB_BACKGROUND); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); immUnbindProgram(); } -- cgit v1.2.3