From e25ba162c0b62b19cf367f0f29e29d0c0960978d Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Sat, 23 Jan 2016 00:58:32 -0500 Subject: OpenGL: call glLineWidth less often MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- source/blender/editors/gpencil/drawgpencil.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index d5c7c523ca8..66d86285470 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -145,9 +145,6 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn glVertex2iv(&pt->x); } glEnd(); - - /* reset for predictable OpenGL context */ - glLineWidth(1.0f); if (G.debug & G_DEBUG) setlinestyle(0); } @@ -1122,7 +1119,6 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, glDisable(GL_LINE_SMOOTH); // smooth lines /* restore initial gl conditions */ - glLineWidth(1.0); glColor4f(0, 0, 0, 1); } -- cgit v1.2.3