From: Brian Date: Thu, 12 Jul 2007 17:50:52 +0000 (-0600) Subject: handle edge flags for GL_POLYGONs X-Git-Tag: 062012170305~17580^2~390^2~4703 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62f5f18b3e5b80b6d9592442dc3c994d590c782d;p=profile%2Fivi%2Fmesa.git handle edge flags for GL_POLYGONs --- diff --git a/src/mesa/pipe/draw/draw_vb.c b/src/mesa/pipe/draw/draw_vb.c index 905e465..67e1966 100644 --- a/src/mesa/pipe/draw/draw_vb.c +++ b/src/mesa/pipe/draw/draw_vb.c @@ -255,16 +255,28 @@ static void draw_indexed_prim( struct draw_context *draw, case GL_POLYGON: if (count >= 3) { + int e1save, e2save; prim.v[0] = 0; prim.v[1] = get_vertex( draw, elts[1] ); prim.v[2] = get_vertex( draw, elts[0] ); + e2save = prim.v[2]->edgeflag; for (i = 0; i+2 < count; i++) { prim.v[0] = prim.v[1]; prim.v[1] = get_vertex( draw, elts[i+2] ); + /* save v1 edge flag, and clear if not last triangle */ + e1save = prim.v[1]->edgeflag; + if (i + 3 < count) + prim.v[1]->edgeflag = 0; + + /* draw */ first->tri( first, &prim ); + + prim.v[1]->edgeflag = e1save; /* restore */ + prim.v[2]->edgeflag = 0; /* disable edge after 1st tri */ } + prim.v[2]->edgeflag = e2save; } break; @@ -399,16 +411,28 @@ static void draw_prim( struct draw_context *draw, case GL_POLYGON: if (count >= 3) { + int e1save, e2save; prim.v[0] = 0; prim.v[1] = get_vertex( draw, start + 1 ); prim.v[2] = get_vertex( draw, start + 0 ); - + e2save = prim.v[2]->edgeflag; + for (i = 0; i+2 < count; i++) { prim.v[0] = prim.v[1]; prim.v[1] = get_vertex( draw, start + i + 2 ); - + + /* save v1 edge flag, and clear if not last triangle */ + e1save = prim.v[1]->edgeflag; + if (i + 3 < count) + prim.v[1]->edgeflag = 0; + + /* draw */ first->tri( first, &prim ); + + prim.v[1]->edgeflag = e1save; /* restore */ + prim.v[2]->edgeflag = 0; /* disable edge after 1st tri */ } + prim.v[2]->edgeflag = e2save; } break;