Module: wine
Branch: master
Commit: f97565191cd07d5dee5210066bd1a08fb14cacf2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f97565191cd07d5dee5210066…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Tue Feb 16 09:50:39 2010 +0100
wined3d: Drop buffer objects from the stream info as well when PreLoad drops them.
---
dlls/wined3d/device.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f10348c..578d8e4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -179,8 +179,6 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
{
/* We need to deal with frequency data! */
IWineD3DVertexDeclarationImpl *declaration = (IWineD3DVertexDeclarationImpl *)This->stateBlock->vertexDecl;
- UINT stream_count = This->stateBlock->streamIsUP ? 0 : declaration->num_streams;
- const DWORD *streams = declaration->streams;
unsigned int i;
stream_info->use_map = 0;
@@ -307,17 +305,29 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
}
}
- /* Now call PreLoad on all the vertex buffers. In the very rare case
- * that the buffers stopps converting PreLoad will dirtify the VDECL again.
- * The vertex buffer can now use the strided structure in the device instead of finding its
- * own again.
- *
- * NULL streams won't be recorded in the array, UP streams won't be either. A stream is only
- * once in there. */
- for (i = 0; i < stream_count; ++i)
+ if (!This->stateBlock->streamIsUP)
{
- IWineD3DBuffer *vb = This->stateBlock->streamSource[streams[i]];
- if (vb) IWineD3DBuffer_PreLoad(vb);
+ WORD map = stream_info->use_map;
+
+ /* PreLoad all the vertex buffers. */
+ for (i = 0; map; map >>= 1, ++i)
+ {
+ struct wined3d_stream_info_element *element;
+ struct wined3d_buffer *buffer;
+
+ if (!(map & 1)) continue;
+
+ element = &stream_info->elements[i];
+ buffer = (struct wined3d_buffer *)This->stateBlock->streamSource[element->stream_idx];
+ IWineD3DBuffer_PreLoad((IWineD3DBuffer *)buffer);
+
+ /* If PreLoad dropped the buffer object, update the stream info. */
+ if (buffer->buffer_object != element->buffer_object)
+ {
+ element->buffer_object = 0;
+ element->data = buffer_get_sysmem(buffer) + (ptrdiff_t)element->data;
+ }
+ }
}
}
Module: wine
Branch: master
Commit: f45b648634ed713dde2ceea71d1b8f6da79d2e41
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f45b648634ed713dde2ceea71…
Author: Vincent Povirk <vincent(a)codeweavers.com>
Date: Mon Feb 15 14:13:44 2010 -0600
comdlg32: Add a minimal test for the font dialog.
---
dlls/comdlg32/tests/Makefile.in | 1 +
dlls/comdlg32/tests/fontdlg.c | 75 +++++++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/dlls/comdlg32/tests/Makefile.in b/dlls/comdlg32/tests/Makefile.in
index 11ee930..969ad6b 100644
--- a/dlls/comdlg32/tests/Makefile.in
+++ b/dlls/comdlg32/tests/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS = comdlg32 user32 gdi32 kernel32
CTESTS = \
filedlg.c \
+ fontdlg.c \
printdlg.c
RC_SRCS = rsrc.rc
diff --git a/dlls/comdlg32/tests/fontdlg.c b/dlls/comdlg32/tests/fontdlg.c
new file mode 100644
index 0000000..422bf8d
--- /dev/null
+++ b/dlls/comdlg32/tests/fontdlg.c
@@ -0,0 +1,75 @@
+/*
+ * Unit test suite for comdlg32 API functions: font dialogs
+ *
+ * Copyright 2009 Vincent Povirk for CodeWeavers
+ *
+ * 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
+ *
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "objbase.h"
+
+#include "commdlg.h"
+
+#include "wine/test.h"
+
+static UINT_PTR CALLBACK CFHookProcOK(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ PostMessageA(hdlg, WM_COMMAND, IDOK, FALSE);
+ return 0;
+ default:
+ return 0;
+ }
+}
+
+static void test_ChooseFontA(void)
+{
+ LOGFONTA lfa;
+ CHOOSEFONTA cfa;
+ BOOL ret;
+
+ memset(&lfa, 0, sizeof(LOGFONTA));
+ lfa.lfHeight = -16;
+ lfa.lfWeight = FW_NORMAL;
+ strcpy(lfa.lfFaceName, "Tahoma");
+
+ memset(&cfa, 0, sizeof(CHOOSEFONTA));
+ cfa.lStructSize = sizeof(cfa);
+ cfa.lpLogFont = &lfa;
+ cfa.Flags = CF_ENABLEHOOK|CF_INITTOLOGFONTSTRUCT|CF_SCREENFONTS;
+ cfa.lpfnHook = CFHookProcOK;
+
+ ret = ChooseFontA(&cfa);
+
+ ok(ret == TRUE, "ChooseFontA returned FALSE\n");
+ ok(lfa.lfHeight == -16, "Expected -16, got %i\n", lfa.lfHeight);
+ ok(lfa.lfWeight == FW_NORMAL, "Expected FW_NORMAL, got %i\n", lfa.lfWeight);
+ ok(strcmp(lfa.lfFaceName, "Tahoma") == 0, "Expected Arial, got %s\n", lfa.lfFaceName);
+}
+
+START_TEST(fontdlg)
+{
+ test_ChooseFontA();
+}