diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-03-21 08:32:25 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-03-21 08:32:25 +0300 |
commit | 54bed786a6304a1cb33980bcdf6ea8ccd73ff7e1 (patch) | |
tree | 2de70323be51a5bd3764fa7ea3aa92342830591c /source/blender/editors | |
parent | 231b5d96bbfd77253941dd37cc4929e4e119d706 (diff) |
OpenGL: convert to new matrix API (part 2 of x)
Part of T49450
For this batch I focused on usage of gpuMatrixUpdate_legacy.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_draw.c | 14 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 38 |
3 files changed, 20 insertions, 38 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 4117a15594c..a76731da9d5 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -583,7 +583,6 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT /* pattern and search outline */ gpuPushMatrix(); gpuTranslate2fv(marker_pos); - gpuMatrixUpdate_legacy(); /* remove */ if (sc->flag & SC_SHOW_MARKER_PATTERN) { immBegin(GL_LINE_LOOP, 4); @@ -605,7 +604,6 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT } gpuPopMatrix(); - gpuMatrixUpdate_legacy(); /* remove */ } static void track_colors(MovieTrackingTrack *track, int act, float col[3], float scol[3]) @@ -712,7 +710,6 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra /* pattern */ gpuPushMatrix(); gpuTranslate2fv(marker_pos); - gpuMatrixUpdate_legacy(); /* remove */ if (tiny) { setlinestyle(3); @@ -769,7 +766,6 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra } gpuPopMatrix(); - gpuMatrixUpdate_legacy(); /* remove */ } static float get_shortest_pattern_side(MovieTrackingMarker *marker) @@ -846,7 +842,6 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo gpuPushMatrix(); gpuTranslate2fv(marker_pos); - gpuMatrixUpdate_legacy(); /* remove */ dx = 6.0f / width / sc->zoom; dy = 6.0f / height / sc->zoom; @@ -906,7 +901,6 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo } gpuPopMatrix(); - gpuMatrixUpdate_legacy(); /* remove */ } static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 7afa2ae8145..a9d02018f49 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -119,14 +119,13 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track, if (sel == data->sel) { immUniformThemeColor(sel ? TH_HANDLE_VERTEX_SELECT : TH_HANDLE_VERTEX); - glPushMatrix(); - glTranslatef(scene_framenr, val, 0.0f); - glScalef(1.0f / data->xscale * data->hsize, 1.0f / data->yscale * data->hsize, 1.0f); - gpuMatrixUpdate_legacy(); + gpuPushMatrix(); + gpuTranslate2f(scene_framenr, val); + gpuScale2f(1.0f / data->xscale * data->hsize, 1.0f / data->yscale * data->hsize); imm_draw_lined_circle(data->pos, 0, 0, 0.7, 8); - glPopMatrix(); + gpuPopMatrix(); } } @@ -153,9 +152,6 @@ static void draw_tracks_motion_curves(View2D *v2d, SpaceClip *sc, unsigned int p (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, tracking_segment_knot_cb, NULL, NULL); - - gpuMatrixUpdate_legacy(); - /* draw graph lines */ glEnable(GL_BLEND); clip_graph_tracking_values_iterate(sc, @@ -171,8 +167,6 @@ static void draw_tracks_motion_curves(View2D *v2d, SpaceClip *sc, unsigned int p (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, tracking_segment_knot_cb, NULL, NULL); - - gpuMatrixUpdate_legacy(); } typedef struct TrackErrorCurveUserData { diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index c8f692e45ce..e382c2dbd29 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -405,9 +405,9 @@ 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 */ - glTranslatef(x, y, 0.0f); - glScalef(1.0f / xscale * hsize, 1.0f / yscale * hsize, 1.0f); - gpuMatrixUpdate_legacy(); + gpuPushMatrix(); + gpuTranslate2f(x, y); + gpuScale2f(1.0f / xscale * hsize, 1.0f / yscale * hsize); /* draw X shape */ immBegin(GL_LINES, 4); @@ -419,9 +419,7 @@ static void draw_fcurve_sample_control(float x, float y, float xscale, float ysc immEnd(); /* restore view transform */ - glScalef(xscale / hsize, yscale / hsize, 1.0); - glTranslatef(-x, -y, 0.0f); - gpuMatrixUpdate_legacy(); + gpuPopMatrix(); } /* helper func - draw keyframe vertices only for an F-Curve */ @@ -570,11 +568,10 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, ID *id, FCurve *fcu, Vie } /* apply unit mapping */ - glPushMatrix(); + gpuPushMatrix(); unit_scale = ANIM_unit_mapping_get_factor(ac->scene, id, fcu, mapping_flag, &offset); - glScalef(1.0f, unit_scale, 1.0f); - glTranslatef(0.0f, offset, 0.0f); - gpuMatrixUpdate_legacy(); + gpuScale2f(1.0f, unit_scale); + gpuTranslate2f(0.0f, offset); immBegin(PRIM_LINE_STRIP, count); @@ -631,8 +628,7 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, ID *id, FCurve *fcu, Vie immEnd(); - glPopMatrix(); - gpuMatrixUpdate_legacy(); + gpuPopMatrix(); } /* helper func - check if the F-Curve only contains easily drawable segments @@ -666,11 +662,10 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2 short mapping_flag = ANIM_get_normalization_flags(ac); /* apply unit mapping */ - glPushMatrix(); + gpuPushMatrix(); unit_scale = ANIM_unit_mapping_get_factor(ac->scene, id, fcu, mapping_flag, &offset); - glScalef(1.0f, unit_scale, 1.0f); - glTranslatef(0.0f, offset, 0.0f); - gpuMatrixUpdate_legacy(); + gpuScale2f(1.0f, unit_scale); + gpuTranslate2f(0.0f, offset); /* For now, this assumes the worst case scenario, where all the keyframes have * bezier interpolation, and are drawn at full res. @@ -815,8 +810,7 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2 immEnd(); - glPopMatrix(); - gpuMatrixUpdate_legacy(); + gpuPopMatrix(); } /* Debugging -------------------------------- */ @@ -1096,9 +1090,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 */ - glPushMatrix(); - glScalef(1.0f, unit_scale, 1.0f); - glTranslatef(0.0f, offset, 0.0f); + gpuPushMatrix(); + gpuScale2f(1.0f, unit_scale); + gpuTranslate2f(0.0f, offset); /* set this once and for all - all handles and handle-verts should use the same thickness */ glLineWidth(1.0); @@ -1120,7 +1114,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid draw_fcurve_samples(sipo, ar, fcu); } - glPopMatrix(); + gpuPopMatrix(); } } |