[Piglit] window size issues on Windows

Jose Fonseca jfonseca at vmware.com
Wed Jun 22 05:14:25 PDT 2011



----- Original Message -----
> 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.
> 
> I'd object to 2).  We've already got too many tests that take up
> gratuitous amounts of screen real estate for people testing on their
> development systems.  While I like the visible results of tests that
> we
> do for debugging, giant 100x100 green isn't better visualization than
> 30x30 green for most tests.

I also think we should do the tests more robust against window sizes is possible. If that proves to be a loosing battle then we should make the necessary bugfixes to freeglut/mesaglut to force Windows to obbey the sizes.

> I'd love to see us dump glut for window-system-specific code, which
> should let you tell Windows to knock it off, for example, but that's
> a
> way bigger project.

FWIW, apitrace includes some very straightforward code (named glws*) for this, that supports Windows and GLX. But proper MacOSX support is PITA, because the only way to support recent 64bit MacOSX is to have Objective C... :(

Jose


More information about the Piglit mailing list