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:
authorClément Foucault <foucault.clem@gmail.com>2020-08-16 16:38:34 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:10 +0300
commitbf1b622dd962416fef94ccb2f47878eced31e20d (patch)
tree8622462ebdfbc6e347975d1b875b817356e4e84a /source/blender/windowmanager
parent10558d6973be8fc461a4b8aad734ba0881d18e85 (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/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c4
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c6
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c14
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
-rw-r--r--source/blender/windowmanager/intern/wm_playanim.c6
5 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index ec18a401fa4..37ed9f89bc7 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -401,7 +401,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
}
/* XXX todo, multiline drag draws... but maybe not, more types mixed wont work well */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
for (drag = wm->drags.first; drag; drag = drag->next) {
const uchar text_col[] = {255, 255, 255, 255};
int iconsize = UI_DPI_ICON_SIZE;
@@ -495,5 +495,5 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
}
}
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 14f6ad420b5..d5e175b8cb4 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -577,8 +577,8 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend)
if (blend) {
/* GL_ONE because regions drawn offscreen have premultiplied alpha. */
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA_PREMULT);
}
/* setup actual texture */
@@ -603,7 +603,7 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend)
GPU_texture_unbind(texture);
if (blend) {
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
}
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 633c6b53ecd..d73da935626 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -236,7 +236,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
uint shdr_pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
@@ -245,7 +245,7 @@ static void wm_gesture_draw_rect(wmGesture *gt)
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -274,7 +274,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
{
rcti *rect = (rcti *)gt->customdata;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
const uint shdr_pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -286,7 +286,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -353,8 +353,8 @@ static void draw_filled_lasso(wmGesture *gt)
draw_filled_lasso_px_cb,
&lasso_fill_data);
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ADDITIVE);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ADDITIVE);
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
GPU_shader_bind(state.shader);
@@ -368,7 +368,7 @@ static void draw_filled_lasso(wmGesture *gt)
MEM_freeN(pixel_buf);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
MEM_freeN(mcoords);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 8e6b139ca7d..9b25d660ff6 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2393,7 +2393,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void
}
GPU_matrix_translate_2f((float)x, (float)y);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
/* apply zoom if available */
@@ -2472,7 +2472,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void
BLF_position(fontid, -0.5f * strwidth, -0.5f * strheight, 0.0f);
BLF_draw(fontid, str, strdrawlen);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_line_smooth(false);
}
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index b75d9db1c38..2f949142eb7 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -315,8 +315,8 @@ static void playanim_toscreen(
/* 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_ex(offs_x,
offs_y,
@@ -341,7 +341,7 @@ static void playanim_toscreen(
((ps->draw_flip[1] ? -1.0f : 1.0f)) * (ps->zoom / (float)ps->win_y),
NULL);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
pupdate_time();