From: Paul Gofman <pgofman@codeweavers.com> --- dlls/ddraw/surface.c | 18 +++++++++--------- dlls/ddraw/tests/ddraw1.c | 4 ++-- dlls/ddraw/tests/ddraw2.c | 4 ++-- dlls/ddraw/tests/ddraw4.c | 4 ++-- dlls/ddraw/tests/ddraw7.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index e6ed79afccf..139bf45921d 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1647,7 +1647,14 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons SetRectEmpty(&src_rect); } - if (!dst_surface->clipper) + if (dst_surface->clipper && !ddraw_clipper_is_valid(dst_surface->clipper)) + { + FIXME("Attempting to blit with an invalid clipper.\n"); + return DDERR_INVALIDPARAMS; + } + + if (!dst_surface->clipper || (dst_surface->ddraw->cooperative_level & DDSCL_EXCLUSIVE + && dst_surface->clipper->window)) { if (src_surface && src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(src_surface, &src_rect, TRUE, 0); @@ -1659,12 +1666,6 @@ static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, cons return hr; } - if (!ddraw_clipper_is_valid(dst_surface->clipper)) - { - FIXME("Attempting to blit with an invalid clipper.\n"); - return DDERR_INVALIDPARAMS; - } - scale_x = (float)(src_rect.right - src_rect.left) / (float)(dst_rect.right - dst_rect.left); scale_y = (float)(src_rect.bottom - src_rect.top) / (float)(dst_rect.bottom - dst_rect.top); @@ -4644,9 +4645,8 @@ static HRESULT WINAPI ddraw_surface7_SetClipper(IDirectDrawSurface7 *iface, if ((This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && This->ddraw->wined3d_swapchain) { clipWindow = NULL; - if(clipper) { + if (clipper && !(This->ddraw->cooperative_level & DDSCL_EXCLUSIVE)) IDirectDrawClipper_GetHWnd(iclipper, &clipWindow); - } if (clipWindow) { diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 594baee6ff9..1d9fd3842a7 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -16426,9 +16426,9 @@ static void check_surface_clipper(IDirectDrawSurface *surface, IDirectDrawClippe ok(hr == DD_OK, "got %#lx.\n", hr); c = get_surface_color(surface, window_rect->left + 1, window_rect->top + 1); - todo_wine_if(!(style & WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); c = get_surface_color(surface, 0, 0); - todo_wine_if((style & (WS_CHILD | WS_VISIBLE)) != (WS_CHILD | WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); hr = IDirectDrawSurface_SetClipper(surface, NULL); ok(hr == DD_OK, "got %#lx.\n", hr); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index fdf22191743..0e475c21e13 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -17497,9 +17497,9 @@ static void check_surface_clipper(IDirectDrawSurface *surface, IDirectDrawClippe ok(hr == DD_OK, "got %#lx.\n", hr); c = get_surface_color(surface, window_rect->left + 1, window_rect->top + 1); - todo_wine_if(!(style & WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); c = get_surface_color(surface, 0, 0); - todo_wine_if((style & (WS_CHILD | WS_VISIBLE)) != (WS_CHILD | WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); hr = IDirectDrawSurface_SetClipper(surface, NULL); ok(hr == DD_OK, "got %#lx.\n", hr); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index e2fa4738cbc..702a170c2a6 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -20596,9 +20596,9 @@ static void check_surface_clipper(IDirectDrawSurface4 *surface, IDirectDrawClipp ok(hr == DD_OK, "got %#lx.\n", hr); c = get_surface_color(surface, window_rect->left + 1, window_rect->top + 1); - todo_wine_if(!(style & WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); c = get_surface_color(surface, 0, 0); - todo_wine_if((style & (WS_CHILD | WS_VISIBLE)) != (WS_CHILD | WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); hr = IDirectDrawSurface4_SetClipper(surface, NULL); ok(hr == DD_OK, "got %#lx.\n", hr); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index eb35cfa6792..7062e419ca4 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -20994,9 +20994,9 @@ static void check_surface_clipper(IDirectDrawSurface7 *surface, IDirectDrawClipp ok(hr == DD_OK, "got %#lx.\n", hr); c = get_surface_color(surface, window_rect->left + 1, window_rect->top + 1); - todo_wine_if(!(style & WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); c = get_surface_color(surface, 0, 0); - todo_wine_if((style & (WS_CHILD | WS_VISIBLE)) != (WS_CHILD | WS_VISIBLE)) ok(c == 0x0000ff00, "got %#x.\n", c); + ok(c == 0x0000ff00, "got %#x.\n", c); hr = IDirectDrawSurface7_SetClipper(surface, NULL); ok(hr == DD_OK, "got %#lx.\n", hr); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10723