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/interface/interface_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/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index e7f5f1b49de..749fa2253f0 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -728,6 +728,8 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), /* LUMA (1 channel) */ glBlendFunc(GL_ONE, GL_ONE); glColor3f(alpha, alpha, alpha); + glPointSize(1.0); + if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA) { glBlendFunc(GL_ONE, GL_ONE); @@ -944,6 +946,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco glScalef(diam, diam, 0.f); glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope); + glPointSize(1.0); glDrawArrays(GL_POINTS, 0, scopes->waveform_tot); glDisableClientState(GL_VERTEX_ARRAY); @@ -1517,7 +1520,6 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti glVertex2fv(fac); } glEnd(); - glPointSize(1.0f); /* restore scissortest */ glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); |