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:
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c78
-rw-r--r--source/blender/editors/space_graph/space_graph.c6
2 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 16658c0d8db..ad9af8cb948 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -86,7 +86,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
const float fac = 0.05f * BLI_rctf_size_x(&v2d->cur);
int i;
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
GPU_line_width(1.0f);
@@ -103,7 +103,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
/* draw two black lines showing the standard reference levels */
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(shdr_pos, v2d->cur.xmin, env->midval + env->min);
immVertex2f(shdr_pos, v2d->cur.xmax, env->midval + env->min);
@@ -122,7 +122,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
/* for now, point color is fixed, and is white */
immUniformColor3f(1.0f, 1.0f, 1.0f);
- immBeginAtMost(GWN_PRIM_POINTS, env->totvert * 2);
+ immBeginAtMost(GPU_PRIM_POINTS, env->totvert * 2);
for (i = 0, fed = env->data; i < env->totvert; i++, fed++) {
/* only draw if visible
@@ -178,7 +178,7 @@ static void draw_fcurve_selected_keyframe_vertices(FCurve *fcu, View2D *v2d, boo
set_fcurve_vertex_color(fcu, sel);
- immBeginAtMost(GWN_PRIM_POINTS, fcu->totvert);
+ immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert);
BezTriple *bezt = fcu->bezt;
for (int i = 0; i < fcu->totvert; i++, bezt++) {
@@ -230,7 +230,7 @@ static void draw_fcurve_selected_handle_vertices(FCurve *fcu, View2D *v2d, bool
immUniform4f("outlineColor", hcolor[0], hcolor[1], hcolor[2], 1.0f);
immUniformColor3fvAlpha(hcolor, 0.01f); /* almost invisible - only keep for smoothness */
- immBeginAtMost(GWN_PRIM_POINTS, fcu->totvert * 2);
+ immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert * 2);
BezTriple *bezt = fcu->bezt;
BezTriple *prevbezt = NULL;
@@ -286,7 +286,7 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool
* - draw handles before keyframes, so that keyframes will overlap handles (keyframes are more important for users)
*/
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
GPU_blend(true);
GPU_enable_program_point_size();
@@ -330,12 +330,12 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
{
int sel, b;
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+ uint color = GPU_vertformat_attr_add(format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBeginAtMost(GWN_PRIM_LINES, 4 * 2 * fcu->totvert);
+ immBeginAtMost(GPU_PRIM_LINES, 4 * 2 * fcu->totvert);
/* slightly hacky, but we want to draw unselected points before selected ones
* so that selected points are clearly visible
@@ -422,12 +422,12 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu)
static void draw_fcurve_sample_control(float x, float y, float xscale, float yscale, float hsize, unsigned int pos)
{
/* adjust view transform before starting */
- gpuPushMatrix();
- gpuTranslate2f(x, y);
- gpuScale2f(1.0f / xscale * hsize, 1.0f / yscale * hsize);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(x, y);
+ GPU_matrix_scale_2f(1.0f / xscale * hsize, 1.0f / yscale * hsize);
/* draw X shape */
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, -0.7f, -0.7f);
immVertex2f(pos, +0.7f, +0.7f);
@@ -436,7 +436,7 @@ static void draw_fcurve_sample_control(float x, float y, float xscale, float ysc
immEnd();
/* restore view transform */
- gpuPopMatrix();
+ GPU_matrix_pop();
}
/* helper func - draw keyframe vertices only for an F-Curve */
@@ -459,7 +459,7 @@ static void draw_fcurve_samples(SpaceIpo *sipo, ARegion *ar, FCurve *fcu)
if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) GPU_line_smooth(true);
GPU_blend(true);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT);
@@ -551,7 +551,7 @@ static void draw_fcurve_curve(bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d
n = (etime - stime) / samplefreq + 0.5f;
if (n > 0) {
- immBegin(GWN_PRIM_LINE_STRIP, (n + 1));
+ immBegin(GPU_PRIM_LINE_STRIP, (n + 1));
for (i = 0; i <= n; i++) {
float ctime = stime + i * samplefreq;
@@ -585,12 +585,12 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, ID *id, FCurve *fcu, Vie
}
/* apply unit mapping */
- gpuPushMatrix();
+ GPU_matrix_push();
unit_scale = ANIM_unit_mapping_get_factor(ac->scene, id, fcu, mapping_flag, &offset);
- gpuScale2f(1.0f, unit_scale);
- gpuTranslate2f(0.0f, offset);
+ GPU_matrix_scale_2f(1.0f, unit_scale);
+ GPU_matrix_translate_2f(0.0f, offset);
- immBegin(GWN_PRIM_LINE_STRIP, count);
+ immBegin(GPU_PRIM_LINE_STRIP, count);
/* extrapolate to left? - left-side of view comes before first keyframe? */
if (prevfpt->vec[0] > v2d->cur.xmin) {
@@ -645,7 +645,7 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, ID *id, FCurve *fcu, Vie
immEnd();
- gpuPopMatrix();
+ GPU_matrix_pop();
}
/* helper func - check if the F-Curve only contains easily drawable segments
@@ -679,15 +679,15 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2
short mapping_flag = ANIM_get_normalization_flags(ac);
/* apply unit mapping */
- gpuPushMatrix();
+ GPU_matrix_push();
unit_scale = ANIM_unit_mapping_get_factor(ac->scene, id, fcu, mapping_flag, &offset);
- gpuScale2f(1.0f, unit_scale);
- gpuTranslate2f(0.0f, offset);
+ GPU_matrix_scale_2f(1.0f, unit_scale);
+ GPU_matrix_translate_2f(0.0f, offset);
/* For now, this assumes the worst case scenario, where all the keyframes have
* bezier interpolation, and are drawn at full res.
* This is tricky to optimize, but maybe can be improved at some point... */
- immBeginAtMost(GWN_PRIM_LINE_STRIP, (b * 32 + 3));
+ immBeginAtMost(GPU_PRIM_LINE_STRIP, (b * 32 + 3));
/* extrapolate to left? */
if (prevbezt->vec[1][0] > v2d->cur.xmin) {
@@ -827,7 +827,7 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2
immEnd();
- gpuPopMatrix();
+ GPU_matrix_pop();
}
/* Debugging -------------------------------- */
@@ -849,7 +849,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
//if ((driver->flag & DRIVER_FLAG_SHOWDEBUG) == 0)
// return;
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
float viewport_size[4];
@@ -874,7 +874,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
/* draw 1-1 line, stretching just past the screen limits
* NOTE: we need to scale the y-values to be valid for the units
*/
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
t = v2d->cur.xmin;
immVertex2f(shdr_pos, t, (t + offset) * unitfac);
@@ -900,7 +900,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
immUniform1f("dash_width", 10.0f);
immUniform1f("dash_factor", 0.5f);
- immBegin(GWN_PRIM_LINES, (y >= v2d->cur.ymin) ? 4 : 2);
+ immBegin(GPU_PRIM_LINES, (y >= v2d->cur.ymin) ? 4 : 2);
/* x-axis lookup */
co[0] = x;
@@ -926,7 +926,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
immUnbindProgram();
- /* GWN_PRIM_POINTS do not survive dashed line geometry shader... */
+ /* GPU_PRIM_POINTS do not survive dashed line geometry shader... */
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* x marks the spot .................................................... */
@@ -934,7 +934,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
immUniformColor3f(0.9f, 0.9f, 0.9f);
GPU_point_size(7.0);
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
immVertex2f(shdr_pos, x, y);
immEnd();
@@ -942,7 +942,7 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu)
immUniformColor3f(0.9f, 0.0f, 0.0f);
GPU_point_size(3.0);
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
immVertex2f(shdr_pos, x, y);
immEnd();
}
@@ -969,7 +969,7 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
}
GPU_blend(true);
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -1055,7 +1055,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
}
GPU_blend(true);
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -1136,9 +1136,9 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, fcu, mapping_flag, &offset);
/* apply unit-scaling to all values via OpenGL */
- gpuPushMatrix();
- gpuScale2f(1.0f, unit_scale);
- gpuTranslate2f(0.0f, offset);
+ GPU_matrix_push();
+ GPU_matrix_scale_2f(1.0f, unit_scale);
+ GPU_matrix_translate_2f(0.0f, offset);
/* set this once and for all - all handles and handle-verts should use the same thickness */
GPU_line_width(1.0);
@@ -1160,7 +1160,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
draw_fcurve_samples(sipo, ar, fcu);
}
- gpuPopMatrix();
+ GPU_matrix_pop();
}
}
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 699dc29ff47..fa57df0393a 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -279,7 +279,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
UI_view2d_grid_free(grid);
if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) {
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -292,7 +292,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
GPU_blend(true);
GPU_line_width(2.0);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2f(pos, v2d->cur.xmin, y);
immVertex2f(pos, v2d->cur.xmax, y);
immEnd();
@@ -310,7 +310,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
GPU_blend(true);
GPU_line_width(2.0);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2f(pos, x, v2d->cur.ymin);
immVertex2f(pos, x, v2d->cur.ymax);
immEnd();