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/editors/space_graph
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/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c26
-rw-r--r--source/blender/editors/space_graph/space_graph.c8
2 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 677707602b2..0be3d8665cf 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -290,7 +290,7 @@ static void draw_fcurve_vertices(ARegion *region,
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_program_point_size(true);
/* draw the two handles first (if they're shown, the curve doesn't
@@ -303,7 +303,7 @@ static void draw_fcurve_vertices(ARegion *region,
draw_fcurve_keyframe_vertices(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), pos);
GPU_program_point_size(false);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* Handles ---------------- */
@@ -344,7 +344,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu)
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(true);
}
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immBeginAtMost(GPU_PRIM_LINES, 4 * 2 * fcu->totvert);
@@ -421,7 +421,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu)
immEnd();
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(false);
}
@@ -474,7 +474,7 @@ static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu)
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(true);
}
- GPU_blend(true);
+ 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);
@@ -486,7 +486,7 @@ static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu)
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(false);
}
@@ -1002,7 +1002,7 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(true);
}
- 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);
@@ -1034,7 +1034,7 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(false);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* This is called twice from space_graph.c -> graph_main_region_draw()
@@ -1088,7 +1088,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, shor
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(true);
}
- 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);
@@ -1149,7 +1149,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, shor
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
GPU_line_smooth(false);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* 2) draw handles and vertices as appropriate based on active
@@ -1262,8 +1262,8 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
float ymax = ACHANNEL_FIRST_TOP(ac);
/* 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);
for (ale = anim_data.first; ale; ale = ale->next, ymax -= ACHANNEL_STEP(ac), channel_index++) {
float ymin = ymax - ACHANNEL_HEIGHT(ac);
@@ -1281,7 +1281,7 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
UI_block_end(C, block);
UI_block_draw(C, block);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* free tempolary channels */
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index a4f76384cc6..4e0f60544e6 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -249,7 +249,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
/* Draw a green line to indicate the cursor value */
immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_width(2.0);
immBegin(GPU_PRIM_LINES, 2);
@@ -257,7 +257,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
immVertex2f(pos, v2d->cur.xmax, y);
immEnd();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* current frame or vertical component of vertical component of the cursor */
@@ -268,7 +268,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
/* to help differentiate this from the current frame,
* draw slightly darker like the horizontal one */
immUniformThemeColorShadeAlpha(TH_CFRAME, -40, -50);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_width(2.0);
immBegin(GPU_PRIM_LINES, 2);
@@ -276,7 +276,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
immVertex2f(pos, x, v2d->cur.ymax);
immEnd();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
immUnbindProgram();