[Piglit] window size issues on Windows

Brian Paul brianp at vmware.com
Tue Jun 21 15:05:31 PDT 2011


I was looking into some piglit failures on Windows today.

One thing common among the failing tests is an initial window size of 
100x100.

It looks like width=100 is too small for Win7 to draw the window title 
bar w/ buttons, etc. so Windows resizes the window to 116x100.

When this happens, the reshape() callback in piglit-framework.c is 
called and it updates the piglit_width and piglit_height vars and 
calls glViewport() with the new dimensions.

However, the ortho projection used by these tests isn't updated.

piglit_ortho_projection() is typically called in the test's 
piglit_init() function.  That happens before the resize so when we get 
to piglit_display() the ortho projection doesn't reflect the current 
window size.

I think there's two possible, easy fixes:

1. Call piglit_ortho_projection() in the piglit_display() function 
instead of in the piglit_init() function.

2. Use a larger initial window size.  Maybe define 
PIGLIT_DEFAULT_WIDTH=150 and PIGLIT_DEFAULT_HEIGHT=150 and use those 
values when initializing piglit_width/height.

I think I prefer (1) since it would allow the test to work properly if 
the user resizes the window.

I'll post an example patch which fixes this for dlist-clear.c

-Brian



More information about the Piglit mailing list