diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 06:59:42 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-01-16 07:51:29 +0300 |
commit | 2d71d13ea2cb7a7640e5139dc24341bd58416d57 (patch) | |
tree | 48061a6f98f4212de685e3dc8279270a5427e898 /source/blender/editors/space_graph/graph_draw.c | |
parent | 31375a1b21a98f5ce6abdd46a41a1e287d3d5050 (diff) |
OpenGL: fixes related to GL_POINTS
I put all usage of GL_POINTS under the microscope. Fixed problems &
optimized a couple of spots.
- reduce calls to glPointSize by about 50%
- draw selected & unselected vertices together for UV editor & EditMesh
- draw initial gpencil stroke point the proper size
- a few other smaller fixes
New policy: each GL_POINTS draw call needs to set its desired point
size. This eliminates half our calls to glPointSize (setting it back to
its 1.0 default after every draw).
Diffstat (limited to 'source/blender/editors/space_graph/graph_draw.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 5e1747692e1..b5b308f1b83 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -112,9 +112,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d) glVertex2f(fed->time, fed->max); } } - glEnd(); /* GL_POINTS */ - - glPointSize(1.0f); + glEnd(); } /* *************************** */ @@ -152,7 +150,7 @@ static void draw_fcurve_vertices_keyframes(FCurve *fcu, SpaceIpo *UNUSED(sipo), } } - glEnd(); /* GL_POINTS */ + glEnd(); } @@ -288,8 +286,6 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short set_fcurve_vertex_color(fcu, 1); draw_fcurve_vertices_keyframes(fcu, sipo, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); - - glPointSize(1.0f); } /* Handles ---------------- */ @@ -915,8 +911,6 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu) glBegin(GL_POINTS); glVertex2f(x, y); glEnd(); - - glPointSize(1.0f); } } } |