diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-01-23 08:58:32 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-01-23 08:58:51 +0300 |
commit | e25ba162c0b62b19cf367f0f29e29d0c0960978d (patch) | |
tree | 6f274502a6fb22b1679decca4b944e09fab29137 /source/blender/editors/space_graph | |
parent | 90293a8da375b785fa58d3f56de1b286072107c1 (diff) |
OpenGL: call glLineWidth less often
Each LINES draw call is now responsible for its own line width. No need
to set it back to its 1.0 default after every draw.
This eliminates half our calls to glLineWidth , similar to last week’s
work on glPointSize.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index b5b308f1b83..c441bdd5813 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -85,6 +85,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d) /* draw two black lines showing the standard reference levels */ glColor3f(0.0f, 0.0f, 0.0f); + glLineWidth(1); setlinestyle(5); glBegin(GL_LINES); @@ -93,7 +94,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d) glVertex2f(v2d->cur.xmin, env->midval + env->max); glVertex2f(v2d->cur.xmax, env->midval + env->max); - glEnd(); /* GL_LINES */ + glEnd(); setlinestyle(0); /* set size of vertices (non-adjustable for now) */ @@ -852,7 +853,6 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu) /* cleanup line drawing */ setlinestyle(0); - glLineWidth(1.0f); } /* draw driver only if actually functional */ @@ -946,7 +946,6 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) /* restore settings */ setlinestyle(0); - glLineWidth(1.0f); if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); @@ -1036,7 +1035,6 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid /* restore settings */ setlinestyle(0); - glLineWidth(1.0); if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 6d040546929..c6a8a9753d1 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -280,7 +280,6 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) glVertex2f(v2d->cur.xmax, y); glEnd(); - glLineWidth(1.0); glDisable(GL_BLEND); } @@ -299,7 +298,6 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) glVertex2f(x, v2d->cur.ymax); glEnd(); - glLineWidth(1.0); glDisable(GL_BLEND); } else { |