[PATCH 3/5] ddraw: Disallow clipped blits in ddraw_surface7_BltFast().
Henri Verbeet
hverbeet at codeweavers.com
Wed Jan 4 16:34:54 CST 2012
---
dlls/ddraw/surface.c | 15 ++++++++++++++-
dlls/ddraw/tests/ddraw1.c | 2 +-
dlls/ddraw/tests/ddraw2.c | 2 +-
dlls/ddraw/tests/ddraw4.c | 2 +-
dlls/ddraw/tests/ddraw7.c | 2 +-
5 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 04e8c52..0b9248c 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -3869,7 +3869,20 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d
flags |= WINEDDBLT_DONOTWAIT;
wined3d_mutex_lock();
- hr = ddraw_surface_blt_clipped(This, &dst_rect, src, rsrc, flags, NULL, WINED3DTEXF_POINT);
+ if (This->clipper)
+ {
+ wined3d_mutex_unlock();
+ WARN("Destination surface has a clipper set, returning DDERR_BLTFASTCANTCLIP.\n");
+ return DDERR_BLTFASTCANTCLIP;
+ }
+
+ if (src->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
+ hr = ddraw_surface_update_frontbuffer(src, rsrc, TRUE);
+ if (SUCCEEDED(hr))
+ hr = wined3d_surface_blt(This->wined3d_surface, &dst_rect,
+ src->wined3d_surface, rsrc, flags, NULL, WINED3DTEXF_POINT);
+ if (SUCCEEDED(hr) && (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER))
+ hr = ddraw_surface_update_frontbuffer(This, &dst_rect, FALSE);
wined3d_mutex_unlock();
switch(hr)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 3ef4182..720ee58 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -332,7 +332,7 @@ static void test_clipper_blt(void)
}
hr = IDirectDrawSurface_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT);
- todo_wine ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface_Release(dst_surface);
IDirectDrawSurface_Release(src_surface);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 5e8a019..5b18bf4 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -339,7 +339,7 @@ static void test_clipper_blt(void)
}
hr = IDirectDrawSurface_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT);
- todo_wine ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_BLTFASTCANTCLIP || broken(hr == E_NOTIMPL /* NT4 */), "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface_Release(dst_surface);
IDirectDrawSurface_Release(src_surface);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 30928fa..1c0bd69 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -634,7 +634,7 @@ static void test_clipper_blt(void)
}
hr = IDirectDrawSurface4_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT);
- todo_wine ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface4_Release(dst_surface);
IDirectDrawSurface4_Release(src_surface);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 941b5cc..31de233 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -627,7 +627,7 @@ static void test_clipper_blt(void)
}
hr = IDirectDrawSurface7_BltFast(dst_surface, 0, 0, src_surface, NULL, DDBLTFAST_WAIT);
- todo_wine ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_BLTFASTCANTCLIP, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface7_Release(dst_surface);
IDirectDrawSurface7_Release(src_surface);
--
1.7.3.4
More information about the wine-patches
mailing list