ddraw/tests: WinXP drivers don't necessarily set dib.dsBm.bmBits.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ad279073c6
commit
b6904bb618
|
@ -9805,7 +9805,7 @@ static void test_getdc(void)
|
||||||
DDSURFACEDESC surface_desc, map_desc;
|
DDSURFACEDESC surface_desc, map_desc;
|
||||||
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
||||||
IDirectDraw *ddraw;
|
IDirectDraw *ddraw;
|
||||||
unsigned int i;
|
unsigned int i, screen_bpp;
|
||||||
HWND window;
|
HWND window;
|
||||||
HDC dc, dc2;
|
HDC dc, dc2;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -9869,6 +9869,11 @@ static void test_getdc(void)
|
||||||
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
surface_desc.dwSize = sizeof(surface_desc);
|
||||||
|
hr = IDirectDraw_GetDisplayMode(ddraw, &surface_desc);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr);
|
||||||
|
screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
||||||
{
|
{
|
||||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||||
|
@ -9927,8 +9932,11 @@ static void test_getdc(void)
|
||||||
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
||||||
"Got unexpected bit count %d for format %s.\n",
|
"Got unexpected bit count %d for format %s.\n",
|
||||||
dib.dsBm.bmBitsPixel, test_data[i].name);
|
dib.dsBm.bmBitsPixel, test_data[i].name);
|
||||||
ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n",
|
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
|
||||||
dib.dsBm.bmBits, test_data[i].name);
|
* suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access
|
||||||
|
* to ddraw surfaces themselves instead of going through a sysmem DIB section. */
|
||||||
|
ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp),
|
||||||
|
"Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
|
||||||
|
|
||||||
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
||||||
dib.dsBmih.biSize, test_data[i].name);
|
dib.dsBmih.biSize, test_data[i].name);
|
||||||
|
|
|
@ -10507,7 +10507,7 @@ static void test_getdc(void)
|
||||||
DDSURFACEDESC surface_desc, map_desc;
|
DDSURFACEDESC surface_desc, map_desc;
|
||||||
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
DDSCAPS caps = {DDSCAPS_COMPLEX};
|
||||||
IDirectDraw2 *ddraw;
|
IDirectDraw2 *ddraw;
|
||||||
unsigned int i;
|
unsigned int i, screen_bpp;
|
||||||
HWND window;
|
HWND window;
|
||||||
HDC dc, dc2;
|
HDC dc, dc2;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -10571,6 +10571,11 @@ static void test_getdc(void)
|
||||||
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
surface_desc.dwSize = sizeof(surface_desc);
|
||||||
|
hr = IDirectDraw2_GetDisplayMode(ddraw, &surface_desc);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr);
|
||||||
|
screen_bpp = U1(surface_desc.ddpfPixelFormat).dwRGBBitCount;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
||||||
{
|
{
|
||||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||||
|
@ -10629,8 +10634,11 @@ static void test_getdc(void)
|
||||||
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
||||||
"Got unexpected bit count %d for format %s.\n",
|
"Got unexpected bit count %d for format %s.\n",
|
||||||
dib.dsBm.bmBitsPixel, test_data[i].name);
|
dib.dsBm.bmBitsPixel, test_data[i].name);
|
||||||
ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n",
|
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
|
||||||
dib.dsBm.bmBits, test_data[i].name);
|
* suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access
|
||||||
|
* to ddraw surfaces themselves instead of going through a sysmem DIB section. */
|
||||||
|
ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp),
|
||||||
|
"Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
|
||||||
|
|
||||||
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
||||||
dib.dsBmih.biSize, test_data[i].name);
|
dib.dsBmih.biSize, test_data[i].name);
|
||||||
|
|
|
@ -12488,7 +12488,7 @@ static void test_getdc(void)
|
||||||
IDirectDrawSurface4 *surface, *surface2, *tmp;
|
IDirectDrawSurface4 *surface, *surface2, *tmp;
|
||||||
DDSURFACEDESC2 surface_desc, map_desc;
|
DDSURFACEDESC2 surface_desc, map_desc;
|
||||||
IDirectDraw4 *ddraw;
|
IDirectDraw4 *ddraw;
|
||||||
unsigned int i;
|
unsigned int i, screen_bpp;
|
||||||
HWND window;
|
HWND window;
|
||||||
HDC dc, dc2;
|
HDC dc, dc2;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -12552,6 +12552,11 @@ static void test_getdc(void)
|
||||||
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
surface_desc.dwSize = sizeof(surface_desc);
|
||||||
|
hr = IDirectDraw4_GetDisplayMode(ddraw, &surface_desc);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr);
|
||||||
|
screen_bpp = U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
||||||
{
|
{
|
||||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||||
|
@ -12611,8 +12616,11 @@ static void test_getdc(void)
|
||||||
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
||||||
"Got unexpected bit count %d for format %s.\n",
|
"Got unexpected bit count %d for format %s.\n",
|
||||||
dib.dsBm.bmBitsPixel, test_data[i].name);
|
dib.dsBm.bmBitsPixel, test_data[i].name);
|
||||||
ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n",
|
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
|
||||||
dib.dsBm.bmBits, test_data[i].name);
|
* suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access
|
||||||
|
* to ddraw surfaces themselves instead of going through a sysmem DIB section. */
|
||||||
|
ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp),
|
||||||
|
"Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
|
||||||
|
|
||||||
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
||||||
dib.dsBmih.biSize, test_data[i].name);
|
dib.dsBmih.biSize, test_data[i].name);
|
||||||
|
|
|
@ -12476,7 +12476,7 @@ static void test_getdc(void)
|
||||||
IDirectDrawSurface7 *surface, *surface2, *tmp;
|
IDirectDrawSurface7 *surface, *surface2, *tmp;
|
||||||
DDSURFACEDESC2 surface_desc, map_desc;
|
DDSURFACEDESC2 surface_desc, map_desc;
|
||||||
IDirectDraw7 *ddraw;
|
IDirectDraw7 *ddraw;
|
||||||
unsigned int i;
|
unsigned int i, screen_bpp;
|
||||||
HWND window;
|
HWND window;
|
||||||
HDC dc, dc2;
|
HDC dc, dc2;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -12540,6 +12540,11 @@ static void test_getdc(void)
|
||||||
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
|
||||||
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
surface_desc.dwSize = sizeof(surface_desc);
|
||||||
|
hr = IDirectDraw7_GetDisplayMode(ddraw, &surface_desc);
|
||||||
|
ok(SUCCEEDED(hr), "Failed to get display mode, hr %#x.\n", hr);
|
||||||
|
screen_bpp = U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
for (i = 0; i < ARRAY_SIZE(test_data); ++i)
|
||||||
{
|
{
|
||||||
memset(&surface_desc, 0, sizeof(surface_desc));
|
memset(&surface_desc, 0, sizeof(surface_desc));
|
||||||
|
@ -12599,8 +12604,11 @@ static void test_getdc(void)
|
||||||
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
ok(dib.dsBm.bmBitsPixel == U1(test_data[i].format).dwRGBBitCount,
|
||||||
"Got unexpected bit count %d for format %s.\n",
|
"Got unexpected bit count %d for format %s.\n",
|
||||||
dib.dsBm.bmBitsPixel, test_data[i].name);
|
dib.dsBm.bmBitsPixel, test_data[i].name);
|
||||||
ok(!!dib.dsBm.bmBits, "Got unexpected bits %p for format %s.\n",
|
/* Windows XP sets bmBits == NULL for formats that match the screen at least on my r200 GPU. I
|
||||||
dib.dsBm.bmBits, test_data[i].name);
|
* suspect this applies to all HW accelerated pre-WDDM drivers because they can handle gdi access
|
||||||
|
* to ddraw surfaces themselves instead of going through a sysmem DIB section. */
|
||||||
|
ok(!!dib.dsBm.bmBits || broken(!pDwmIsCompositionEnabled && dib.dsBm.bmBitsPixel == screen_bpp),
|
||||||
|
"Got unexpected bits %p for format %s.\n", dib.dsBm.bmBits, test_data[i].name);
|
||||||
|
|
||||||
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
ok(dib.dsBmih.biSize == sizeof(dib.dsBmih), "Got unexpected size %u for format %s.\n",
|
||||||
dib.dsBmih.biSize, test_data[i].name);
|
dib.dsBmih.biSize, test_data[i].name);
|
||||||
|
|
Loading…
Reference in New Issue