diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 16:38:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | bf1b622dd962416fef94ccb2f47878eced31e20d (patch) | |
tree | 8622462ebdfbc6e347975d1b875b817356e4e84a /source/blender/editors/space_image | |
parent | 10558d6973be8fc461a4b8aad734ba0881d18e85 (diff) |
GPUState: GPU_blend final API renaming
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 7e6f92f37f1..6b79151da3f 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -175,8 +175,8 @@ void ED_image_draw_info(Scene *scene, float hue = 0, sat = 0, val = 0, lum = 0, u = 0, v = 0; float col[4], finalcol[4]; - 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_I32, 2, GPU_FETCH_INT_TO_FLOAT); @@ -188,7 +188,7 @@ void ED_image_draw_info(Scene *scene, immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); BLF_size(blf_mono_font, 11 * U.pixelsize, U.dpi); @@ -349,7 +349,7 @@ void ED_image_draw_info(Scene *scene, copy_v4_v4(finalcol, col); } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); dx += 0.25f * UI_UNIT_X; BLI_rcti_init(&color_rect, @@ -388,10 +388,10 @@ void ED_image_draw_info(Scene *scene, immRecti(pos, color_quater_x, color_quater_y, color_rect_half.xmax, color_rect_half.ymax); immRecti(pos, color_rect_half.xmin, color_rect_half.ymin, color_quater_x, color_quater_y); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); immUniformColor3fvAlpha(finalcol, fp ? fp[3] : (cp[3] / 255.0f)); immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } else { immUniformColor3fv(finalcol); @@ -539,8 +539,8 @@ static void draw_udim_label(ARegion *region, float fx, float fy, const char *lab int x, y; UI_view2d_view_to_region(®ion->v2d, fx, fy, &x, &y); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); int textwidth = BLF_width(blf_mono_font, label, strlen(label)) + 10; float stepx = BLI_rcti_size_x(®ion->v2d.mask) / BLI_rctf_size_x(®ion->v2d.cur); @@ -558,7 +558,7 @@ static void draw_udim_label(ARegion *region, float fx, float fy, const char *lab BLF_position(blf_mono_font, (int)(x + 10), (int)(y + 10), 0); BLF_draw_ascii(blf_mono_font, label, strlen(label)); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } static void draw_image_buffer(const bContext *C, @@ -600,8 +600,8 @@ static void draw_image_buffer(const bContext *C, if (sima_flag & SI_USE_ALPHA) { imm_draw_box_checker_2d(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); } /* If RGBA display with color management */ @@ -659,7 +659,7 @@ static void draw_image_buffer(const bContext *C, } if (sima_flag & SI_USE_ALPHA) { - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } } @@ -768,14 +768,14 @@ static void draw_image_paint_helpers( return; } - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR); immDrawPixelsTex( &state, x, y, ibuf->x, ibuf->y, GPU_RGBA8, false, display_buffer, zoomx, zoomy, col); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); BKE_image_release_ibuf(brush->clone.image, ibuf, NULL); IMB_display_buffer_release(cache_handle); @@ -1054,8 +1054,8 @@ void draw_image_cache(const bContext *C, ARegion *region) const rcti *rect_visible = ED_region_visible_rect(region); const int region_bottom = rect_visible->ymin; - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); /* Draw cache background. */ ED_region_cache_draw_background(region); @@ -1071,7 +1071,7 @@ void draw_image_cache(const bContext *C, ARegion *region) region, num_segments, points, sfra + sima->iuser.offset, efra + sima->iuser.offset); } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); /* Draw current frame. */ x = (cfra - sfra) / (efra - sfra + 1) * region->winx; |