st/nine: Allow lock coordinates outside range

This fixes wine test device.c test_lockrect_invalid()

Mimic WindowsXp behaviour and allow negative values in the rectangle passed.
Add comment to point out behaviour used.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Patrick Rudolph
2015-04-20 19:26:55 +02:00
committed by Axel Davy
parent bb1c2c2aa3
commit 9ba3f83592
+2 -6
View File
@@ -363,13 +363,9 @@ NineSurface9_LockRect( struct NineSurface9 *This,
usage |= PIPE_TRANSFER_DONTBLOCK;
if (pRect) {
/* Windows XP accepts invalid locking rectangles, Windows 7 rejects
* them. Use Windows XP behaviour for now. */
rect_to_pipe_box(&box, pRect);
if (u_box_clip_2d(&box, &box, This->desc.Width,
This->desc.Height) < 0) {
DBG("pRect clipped by Width=%u Height=%u\n",
This->desc.Width, This->desc.Height);
return D3DERR_INVALIDCALL;
}
} else {
u_box_origin_2d(This->desc.Width, This->desc.Height, &box);
}