<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 2:27 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
tests/all.py | 3 ++-<br>
tests/general/lineloop.c | 36 +++++++++++++++++++++++++++++++-----<br>
2 files changed, 33 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/tests/all.py b/tests/all.py<br>
index 95c5c61..4f03dd0 100644<br>
--- a/tests/all.py<br>
+++ b/tests/all.py<br>
@@ -874,7 +874,8 @@ with profile.group_manager(<br>
g(['infinite-spot-light'], run_concurrent=False)<br>
g(['line-aa-width'], run_concurrent=False)<br>
g(['line-flat-clip-color'])<br>
- g(['lineloop'], run_concurrent=False)<br>
+ g(['lineloop'], 'lineloop', run_concurrent=False)<br></blockquote><div><br></div><div><br></div><div>JFYI, if a name is not provided for a test then the arguments will be joined with spaces, so the explicit name is redundant. But it really doesn't matter to me if you prefer it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ g(['lineloop', '-dlist'], 'lineloop-dlist', run_concurrent=False)<br>
g(['linestipple'], run_concurrent=False)<br>
g(['longprim'], run_concurrent=False)<br>
g(['masked-clear'])<br>
diff --git a/tests/general/lineloop.c b/tests/general/lineloop.c<br>
index a612987..0111267 100644<br>
--- a/tests/general/lineloop.c<br>
+++ b/tests/general/lineloop.c<br>
@@ -43,16 +43,21 @@ PIGLIT_GL_TEST_CONFIG_END<br>
<br>
static const char *TestName = "lineloop";<br>
static int vert_count = 10000;<br>
+static bool use_dlist = false;<br>
+static GLuint dlist;<br>
+<br>
<br>
static void<br>
-draw(GLuint numVerts)<br>
+draw(GLuint numVerts, float radius)<br>
{<br>
GLuint i;<br>
<br>
glColor3f(1,0,1);<br>
glBegin(GL_LINE_LOOP);<br>
for (i = 0; i < numVerts; i++) {<br>
- glVertex3f(sin(i*M_PI*2/numVerts), cos(i*M_PI*2/numVerts),0);<br>
+ float x = radius * sin(i*M_PI*2/numVerts);<br>
+ float y = radius * cos(i*M_PI*2/numVerts);<br>
+ glVertex3f(x, y, 0);<br>
}<br>
glEnd();<br>
}<br>
@@ -62,8 +67,14 @@ test_prims(void)<br>
{<br>
if (!piglit_automatic)<br>
printf("%s: %u vertices\n", TestName, vert_count);<br>
+<br>
glClear(GL_COLOR_BUFFER_BIT);<br>
- draw(vert_count);<br>
+<br>
+ if (use_dlist) {<br>
+ glCallList(dlist);<br>
+ } else {<br>
+ draw(vert_count, 1.0);<br>
+ }<br>
piglit_present_results();<br>
}<br>
<br>
@@ -87,13 +98,28 @@ piglit_init(int argc, char**argv)<br>
{<br>
int i;<br>
for (i = 1; i < argc; ++i) {<br>
- if (i + 1 < argc) {<br>
+ if (i < argc) {<br>
if (strcmp(argv[i], "-count") == 0) {<br>
- vert_count = strtoul(argv[++i], NULL, 0);<br>
+ i++;<br>
+ if (i == argc) {<br>
+ printf("please specify vertex count\n");<br>
+ piglit_report_result(PIGLIT_FAIL);<br>
+ }<br>
+ vert_count = strtoul(argv[i], NULL, 0);<br>
+ }<br>
+ else if (strcmp(argv[i], "-dlist") == 0) {<br>
+ use_dlist = true;<br>
}<br>
}<br>
}<br>
<br>
glViewport(0,0, WSIZE, WSIZE);<br>
glOrtho(-1,1,-1,1,-1,1);<br>
+<br>
+ if (use_dlist) {<br>
+ dlist = glGenLists(1);<br>
+ glNewList(dlist, GL_COMPILE);<br>
+ draw(vert_count, 1.0);<br>
+ glEndList();<br>
+ }<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>