ddraw: Implement ddraw7_FlipToGDISurface().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2019-01-23 18:17:22 +03:30 committed by Alexandre Julliard
parent 69ca517e6d
commit 3bd8b710c3
5 changed files with 33 additions and 10 deletions

View File

@ -2063,9 +2063,32 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
*****************************************************************************/
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
{
FIXME("iface %p stub!\n", iface);
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
IDirectDrawSurface7 *gdi_surface;
struct ddraw_surface *gdi_impl;
HRESULT hr;
return DD_OK;
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
if (FAILED(hr = IDirectDraw7_GetGDISurface(iface, &gdi_surface)))
{
WARN("Failed to retrieve GDI surface, hr %#x.\n", hr);
wined3d_mutex_unlock();
return hr;
}
gdi_impl = impl_from_IDirectDrawSurface7(gdi_surface);
if (gdi_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
hr = DD_OK;
else
hr = IDirectDrawSurface7_Flip(&ddraw->primary->IDirectDrawSurface7_iface, gdi_surface, DDFLIP_WAIT);
IDirectDrawSurface7_Release(gdi_surface);
wined3d_mutex_unlock();
return hr;
}
static HRESULT WINAPI ddraw4_FlipToGDISurface(IDirectDraw4 *iface)

View File

@ -12036,7 +12036,7 @@ static void test_gdi_surface(void)
ok(!gdi_surface, "Got unexpected surface %p.\n", gdi_surface);
hr = IDirectDraw_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@ -12053,7 +12053,7 @@ static void test_gdi_surface(void)
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr = IDirectDraw_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface_Release(primary);

View File

@ -13337,7 +13337,7 @@ static void test_gdi_surface(void)
ok(!gdi_surface, "Got unexpected surface %p.\n", gdi_surface);
hr = IDirectDraw2_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@ -13354,7 +13354,7 @@ static void test_gdi_surface(void)
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr = IDirectDraw2_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface_Release(primary);

View File

@ -15542,7 +15542,7 @@ static void test_gdi_surface(void)
ok(!gdi_surface, "Got unexpected surface %p.\n", gdi_surface);
hr = IDirectDraw4_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@ -15559,7 +15559,7 @@ static void test_gdi_surface(void)
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr = IDirectDraw4_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface4_Release(primary);

View File

@ -15250,7 +15250,7 @@ static void test_gdi_surface(void)
ok(!gdi_surface, "Got unexpected surface %p.\n", gdi_surface);
hr = IDirectDraw7_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr);
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
@ -15267,7 +15267,7 @@ static void test_gdi_surface(void)
/* Flipping to the GDI surface requires the primary surface to be
* flippable. */
hr = IDirectDraw7_FlipToGDISurface(ddraw);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface7_Release(primary);