[Piglit] window size issues on Windows

Brian Paul brianp at vmware.com
Tue Jun 21 17:03:01 PDT 2011


On 06/21/2011 05:20 PM, Eric Anholt wrote:
> On Tue, 21 Jun 2011 16:05:31 -0600, Brian Paul<brianp at vmware.com>  wrote:
>>
>> 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.
>
> Agreed on 1) where possible.  But you're going to get failures anyway
> because a lot of tests aren't actually ready for size changes even then.

Yeah, I think I found one or two.  I guess we can only ask test 
writers to keep in mind that the actual window size may not be the 
100x100 they expect and to try to take that into account.

I'll try to fix some of these issues as time permits.

-Brian


More information about the Piglit mailing list