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. --- .../blender/editors/space_clip/clip_dopesheet_draw.c | 8 ++++---- source/blender/editors/space_clip/clip_draw.c | 18 +++++++++--------- source/blender/editors/space_clip/clip_graph_draw.c | 4 ++-- source/blender/editors/space_clip/clip_utils.c | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index c7328ae9f8f..8aaf3faffec 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -142,7 +142,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene) strip[3] = 0.5f; selected_strip[3] = 1.0f; - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); clip_draw_dopesheet_background(region, clip, pos_id); @@ -288,7 +288,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene) immUnbindProgram(); } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } } @@ -389,7 +389,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region) PropertyRNA *chan_prop_lock = RNA_struct_type_find_property(&RNA_MovieTrackingTrack, "lock"); BLI_assert(chan_prop_lock); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); for (channel = dopesheet->channels.first; channel; channel = channel->next) { float yminc = (float)(y - CHANNEL_HEIGHT_HALF); float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF); @@ -426,7 +426,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region) /* adjust y-position for next one */ y -= CHANNEL_STEP; } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); UI_block_end(C, block); UI_block_draw(C, block); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index d17041737e4..38c668acd37 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -153,8 +153,8 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip MovieTrackingPlaneTrack *act_plane_track = BKE_tracking_plane_track_get_active(&clip->tracking); MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); /* cache background */ ED_region_cache_draw_background(region); @@ -244,7 +244,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip } } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); /* current frame */ x = (sc->user.framenr - sfra) / (efra - sfra + 1) * region->winx; @@ -329,8 +329,8 @@ static void draw_movieclip_buffer(const bContext *C, /* checkerboard for case alpha */ if (ibuf->planes == 32) { - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); imm_draw_box_checker_2d(x, y, x + zoomx * ibuf->x, y + zoomy * ibuf->y); } @@ -344,7 +344,7 @@ static void draw_movieclip_buffer(const bContext *C, ED_draw_imbuf_ctx(C, ibuf, x, y, use_filter, zoomx * width / ibuf->x, zoomy * height / ibuf->y); if (ibuf->planes == 32) { - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } if (sc->flag & SC_SHOW_METADATA) { @@ -1210,8 +1210,8 @@ static void draw_plane_marker_image(Scene *scene, if (plane_track->image_opacity != 1.0f || ibuf->planes == 32) { transparent = true; - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); } GPUTexture *texture = GPU_texture_create_nD(ibuf->x, @@ -1263,7 +1263,7 @@ static void draw_plane_marker_image(Scene *scene, GPU_texture_free(texture); if (transparent) { - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } } diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 277930495bd..4cf3e3e0798 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -192,7 +192,7 @@ static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, uint } /* Draw graph lines. */ - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); clip_graph_tracking_values_iterate(sc, (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, @@ -200,7 +200,7 @@ static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, uint tracking_segment_point_cb, tracking_segment_start_cb, tracking_segment_end_cb); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); /* Selected knot handles on top of curves. */ if (draw_knots) { diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 8e50c3f6774..0de1497a1af 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -415,8 +415,8 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) UI_view2d_view_ortho(v2d); /* currently clip editor supposes that editing clip length is equal to scene frame range */ - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -425,7 +425,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax); immRectf(pos, (float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); immUniformThemeColorShade(TH_BACK, -60); -- cgit v1.2.3