Commit 01c59b3f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winex11.drv: Fix bit shifts in pixel format description for RGBA formats.

parent d70a652d
......@@ -288,7 +288,20 @@ static void test_choosepixelformat(void)
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
ok( test_pfd(&pfd, NULL), "Simple pfd failed\n" );
ok( test_pfd(&pfd, &ret_fmt), "Simple pfd failed\n" );
ok( ret_fmt.cColorBits == 32, "Got %u.\n", ret_fmt.cColorBits );
ok( !ret_fmt.cBlueShift, "Got %u.\n", ret_fmt.cBlueShift );
ok( ret_fmt.cBlueBits == 8, "Got %u.\n", ret_fmt.cBlueBits );
ok( ret_fmt.cRedBits == 8, "Got %u.\n", ret_fmt.cRedBits );
ok( ret_fmt.cGreenBits == 8, "Got %u.\n", ret_fmt.cGreenBits );
ok( ret_fmt.cGreenShift == 8, "Got %u.\n", ret_fmt.cGreenShift );
ok( ret_fmt.cRedShift == 16, "Got %u.\n", ret_fmt.cRedShift );
ok( !ret_fmt.cAlphaBits || ret_fmt.cAlphaBits == 8, "Got %u.\n", ret_fmt.cAlphaBits );
if (ret_fmt.cAlphaBits)
ok( ret_fmt.cAlphaShift == 24, "Got %u.\n", ret_fmt.cAlphaShift );
else
ok( !ret_fmt.cAlphaShift, "Got %u.\n", ret_fmt.cAlphaShift );
pfd.dwFlags |= PFD_DOUBLEBUFFER_DONTCARE;
ok( test_pfd(&pfd, NULL), "PFD_DOUBLEBUFFER_DONTCARE failed\n" );
pfd.dwFlags |= PFD_STEREO_DONTCARE;
......
......@@ -1601,14 +1601,17 @@ static int describe_pixel_format( int iPixelFormat, PIXELFORMATDESCRIPTOR *ppfd,
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_BLUE_SIZE, &bb);
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_ALPHA_SIZE, &ab);
ppfd->cRedBits = rb;
ppfd->cRedShift = gb + bb + ab;
ppfd->cBlueBits = bb;
ppfd->cBlueShift = ab;
ppfd->cBlueShift = 0;
ppfd->cGreenBits = gb;
ppfd->cGreenShift = bb + ab;
ppfd->cGreenShift = bb;
ppfd->cRedBits = rb;
ppfd->cRedShift = gb + bb;
ppfd->cAlphaBits = ab;
ppfd->cAlphaShift = 0;
if (ab)
ppfd->cAlphaShift = rb + gb + bb;
else
ppfd->cAlphaShift = 0;
} else {
ppfd->cRedBits = 0;
ppfd->cRedShift = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment