render a triangle for a 3 vertice quad

fix issue 6214
fix triangle_fan size calculation

wasn't updated for the new primitive restart implementation
proper ogl primitive restart code
small cleanup suggested by neobrain