Module: wine
Branch: master
Commit: a9c72d8772b322eec5513c0d399148f7de5d8732
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a9c72d8772b322eec5513c0d3…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Oct 13 21:44:27 2011 +0200
ddraw/tests: Add a test for YV12 partial block locks and lock offsets.
---
dlls/ddraw/tests/overlay.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c
index 4f1ac92..6288be1 100644
--- a/dlls/ddraw/tests/overlay.c
+++ b/dlls/ddraw/tests/overlay.c
@@ -1,7 +1,7 @@
/*
* Unit tests for DirectDraw overlay functions
*
- * Copyright (C) 2008 Stefan Dösinger for CodeWeavers
+ * Copyright (C) 2008,2011 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -195,6 +195,9 @@ static void yv12_test(void)
HRESULT hr;
DDSURFACEDESC2 desc;
IDirectDrawSurface7 *surface;
+ char *base;
+ RECT rect = {13, 17, 14, 18};
+ unsigned int offset;
surface = create_overlay(256, 256, MAKEFOURCC('Y','V','1','2'));
if(!surface) {
@@ -217,6 +220,20 @@ static void yv12_test(void)
/* The overlay pitch seems to have 256 byte alignment */
ok((U1(desc).lPitch & 0xff) == 0, "Expected 256 byte aligned pitch, got %u\n", U1(desc).lPitch);
+ base = desc.lpSurface;
+
+ hr = IDirectDrawSurface7_Unlock(surface, NULL);
+ ok(hr == DD_OK, "IDirectDrawSurface7_Unlock returned 0x%08x, expected DD_OK\n", hr);
+
+ /* YV12 uses 2x2 blocks with 6 bytes per block(4*Y, 1*U, 1*V). Unlike other block-based formats like DXT
+ * the entire Y channel is stored in one big chunk of memory, followed by the chroma channels. So
+ * partial locks do not really make sense. Show that they are allowed nevertheless and the offset points
+ * into the luminance data */
+ hr = IDirectDrawSurface7_Lock(surface, &rect, &desc, 0, NULL);
+ ok(hr == DD_OK, "Partial lock of a YV12 surface returned 0x%08x, expected DD_OK\n", hr);
+ offset = ((const char *) desc.lpSurface - base);
+ ok(offset == rect.top * U1(desc).lPitch + rect.left, "Expected %u byte offset from partial lock, got %u\n",
+ rect.top * U1(desc).lPitch + rect.left, offset);
hr = IDirectDrawSurface7_Unlock(surface, NULL);
ok(hr == DD_OK, "IDirectDrawSurface7_Unlock returned 0x%08x, expected DD_OK\n", hr);
Module: wine
Branch: master
Commit: d1e85a0f1f76ff9048b74651f7c8adae16d93af3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d1e85a0f1f76ff9048b74651f…
Author: Francois Gouget <fgouget(a)free.fr>
Date: Mon Nov 14 10:03:20 2011 +0100
include: Move the DDE_xxx macros to dde.rh.
---
include/Makefile.in | 1 +
include/dde.h | 12 +-----------
include/dde.rh | 32 ++++++++++++++++++++++++++++++++
include/winresrc.h | 2 +-
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/include/Makefile.in b/include/Makefile.in
index ddc07ba..00e9cf4 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -203,6 +203,7 @@ SRCDIR_INCLUDES = \
dciddi.h \
dciman.h \
dde.h \
+ dde.rh \
ddeml.h \
ddk/compstui.h \
ddk/hidsdi.h \
diff --git a/include/dde.h b/include/dde.h
index 117b428..508c1ea 100644
--- a/include/dde.h
+++ b/include/dde.h
@@ -34,17 +34,7 @@ extern "C" {
#define WINUSERAPI DECLSPEC_IMPORT
#endif
-#define WM_DDE_INITIATE 0x3E0
-#define WM_DDE_TERMINATE 0x3E1
-#define WM_DDE_ADVISE 0x3E2
-#define WM_DDE_UNADVISE 0x3E3
-#define WM_DDE_ACK 0x3E4
-#define WM_DDE_DATA 0x3E5
-#define WM_DDE_REQUEST 0x3E6
-#define WM_DDE_POKE 0x3E7
-#define WM_DDE_EXECUTE 0x3E8
-#define WM_DDE_LAST WM_DDE_EXECUTE
-#define WM_DDE_FIRST WM_DDE_INITIATE
+#include <dde.rh>
/* DDEACK: wStatus in WM_DDE_ACK message */
typedef struct
diff --git a/include/dde.rh b/include/dde.rh
new file mode 100644
index 0000000..23076a8
--- /dev/null
+++ b/include/dde.rh
@@ -0,0 +1,32 @@
+/*
+ * Copyright 1995, Technion, Israel Institute of Technology
+ * Electrical Eng, Software Lab.
+ * Author: Michael Veksler.
+ * Purpose: dde declarations
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WM_DDE_INITIATE 0x3E0
+#define WM_DDE_TERMINATE 0x3E1
+#define WM_DDE_ADVISE 0x3E2
+#define WM_DDE_UNADVISE 0x3E3
+#define WM_DDE_ACK 0x3E4
+#define WM_DDE_DATA 0x3E5
+#define WM_DDE_REQUEST 0x3E6
+#define WM_DDE_POKE 0x3E7
+#define WM_DDE_EXECUTE 0x3E8
+#define WM_DDE_LAST WM_DDE_EXECUTE
+#define WM_DDE_FIRST WM_DDE_INITIATE
diff --git a/include/winresrc.h b/include/winresrc.h
index e179217..2f99661 100644
--- a/include/winresrc.h
+++ b/include/winresrc.h
@@ -37,7 +37,7 @@
#include <winuser.rh>
#include <commctrl.rh>
-/* FIXME: #include <dde.rh> */
+#include <dde.rh>
#include <winnt.rh>
#include <dlgs.h>
#include <winver.h>