Commit 25c58e68 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winex11.drv: Support _SHIFT_ARB attributes in X11DRV_wglGetPixelFormatAttribivARB().

parent a82b3eb0
......@@ -750,7 +750,8 @@ static void test_makecurrent(HDC winhdc)
static void test_colorbits(HDC hdc)
{
const int iAttribList[] = { WGL_COLOR_BITS_ARB, WGL_RED_BITS_ARB, WGL_GREEN_BITS_ARB,
WGL_BLUE_BITS_ARB, WGL_ALPHA_BITS_ARB };
WGL_BLUE_BITS_ARB, WGL_ALPHA_BITS_ARB, WGL_BLUE_SHIFT_ARB, WGL_GREEN_SHIFT_ARB,
WGL_RED_SHIFT_ARB, WGL_ALPHA_SHIFT_ARB, };
int iAttribRet[ARRAY_SIZE(iAttribList)];
const int iAttribs[] = { WGL_ALPHA_BITS_ARB, 1, 0 };
unsigned int nFormats;
......@@ -778,6 +779,11 @@ static void test_colorbits(HDC hdc)
skip("wglGetPixelFormatAttribivARB failed\n");
return;
}
ok(!iAttribRet[5], "got %d.\n", iAttribRet[5]);
ok(iAttribRet[6] == iAttribRet[3], "got %d.\n", iAttribRet[6]);
ok(iAttribRet[7] == iAttribRet[6] + iAttribRet[2], "got %d.\n", iAttribRet[7]);
ok(iAttribRet[8] == iAttribRet[7] + iAttribRet[1], "got %d.\n", iAttribRet[8]);
iAttribRet[1] += iAttribRet[2]+iAttribRet[3]+iAttribRet[4];
ok(iAttribRet[0] == iAttribRet[1], "WGL_COLOR_BITS_ARB (%d) does not equal R+G+B+A (%d)!\n",
iAttribRet[0], iAttribRet[1]);
......
......@@ -2691,6 +2691,7 @@ static BOOL X11DRV_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int
int hTest;
int tmp;
int curGLXAttr = 0;
PIXELFORMATDESCRIPTOR pfd;
TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues);
......@@ -2707,6 +2708,12 @@ static BOOL X11DRV_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int
WARN("Unable to convert iPixelFormat %d to a GLX one!\n", iPixelFormat);
}
if (!describe_pixel_format(iPixelFormat, &pfd))
{
WARN("describe_pixel_format failed.\n");
memset(&pfd, 0, sizeof(pfd));
}
for (i = 0; i < nAttributes; ++i) {
const int curWGLAttr = piAttributes[i];
TRACE("pAttr[%d] = %x\n", i, curWGLAttr);
......@@ -2808,6 +2815,23 @@ static BOOL X11DRV_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int
curGLXAttr = GLX_AUX_BUFFERS;
break;
case WGL_RED_SHIFT_ARB:
if (!pfd.nSize) goto pix_error;
piValues[i] = pfd.cRedShift;
continue;
case WGL_GREEN_SHIFT_ARB:
if (!pfd.nSize) goto pix_error;
piValues[i] = pfd.cGreenShift;
continue;
case WGL_BLUE_SHIFT_ARB:
if (!pfd.nSize) goto pix_error;
piValues[i] = pfd.cBlueShift;
continue;
case WGL_ALPHA_SHIFT_ARB:
if (!pfd.nSize) goto pix_error;
piValues[i] = pfd.cAlphaShift;
continue;
case WGL_SUPPORT_GDI_ARB:
if (!fmt) goto pix_error;
piValues[i] = (fmt->dwFlags & PFD_SUPPORT_GDI) != 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