Compare commits

..

52 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes
fe96596a19 Release v4.0-rc6 2019-01-13 10:46:08 +11:00
Alistair Leslie-Hughes
929bc28ac8 Updated user32-msgbox-Support-WM_COPY-mesg patchset 2019-01-11 09:28:10 +11:00
Alistair Leslie-Hughes
a7ad40c135 Rebase against 807e5fc04af7a7ea563af1e7da6ebe6662536e6b 2019-01-10 11:08:38 +11:00
Alistair Leslie-Hughes
4d4e02e26b Release v4.0-rc5 2019-01-05 18:15:30 +11:00
Alistair Leslie-Hughes
40821d91e2 Rebase against 40c5184a90a6e14f3e49dd60daaba636308b7f83 2019-01-04 10:09:38 +11:00
Alistair Leslie-Hughes
9256515a12 Rebase against dc80a0032927421d61b95659af570c21439e4a76 2019-01-03 09:38:03 +11:00
Alistair Leslie-Hughes
ae1f954ed1 Release 4.0-rc4 2018-12-29 15:45:37 +11:00
Alistair Leslie-Hughes
ccad76f64a Rebase against 2058505cebc7bb069e1e2d0d738353336e943b7b 2018-12-28 19:56:47 +11:00
Alistair Leslie-Hughes
b1066c7064 Release 4.0-rc3 2018-12-22 14:09:01 +11:00
Alistair Leslie-Hughes
b636153ec4 Added mf-MFCreateSequencerSource patchset 2018-12-21 08:56:45 +11:00
Alistair Leslie-Hughes
f8064b4dbe Rebase against f6896e062d30d6d5d6d94a34e3a622c83aa9d3f1 2018-12-21 08:16:38 +11:00
Zebediah Figura
b7a4aade29 user32-minimized_windows: Add patch set. 2018-12-20 12:40:39 -06:00
Alistair Leslie-Hughes
9e8d000f35 Rebase against 5a8e430b96ab429a85f82f26ba9d2de4729954c2 2018-12-18 11:02:25 +11:00
Alistair Leslie-Hughes
42b756066b Added winex11-ime-check-thread-data patchset 2018-12-18 08:44:19 +11:00
Alistair Leslie-Hughes
ee381d1ad0 Added imm32-message_on_focus patchset 2018-12-18 08:37:38 +11:00
Alistair Leslie-Hughes
9a858d4f4c Added wined3d-WINED3D_TEXF_ANISOTROPIC patchset 2018-12-17 16:26:32 +11:00
Alistair Leslie-Hughes
3878c8eb1b Updated uianimation-stubs patchset 2018-12-17 16:10:10 +11:00
Alistair Leslie-Hughes
5020088406 Added mfplat-MFGetSystemTime patchset 2018-12-17 11:36:45 +11:00
Alistair Leslie-Hughes
c119ae9eeb Release v4.0rc2 2018-12-16 13:15:30 +11:00
Zebediah Figura
476caa4a5f ucrtbase-_o_: Add patch set. 2018-12-15 10:15:17 -06:00
Zebediah Figura
9982d2e0ee dwmapi-DwmGetTransportAttributes: Add patch set. 2018-12-15 10:10:07 -06:00
Zebediah Figura
2b2bf8ac06 user32-dialog_focus: Update patch. 2018-12-15 09:49:32 -06:00
Zebediah Figura
088524a29e newupdate.py: Fix path. 2018-12-15 09:46:36 -06:00
Zebediah Figura
31d525e567 newupdate.py: Also regenerate patchinstall.sh. 2018-12-13 19:03:58 -06:00
Zebediah Figura
7d26828643 krnl386.exe16-_lclose16: Remove.
This was fixed by 414c73feabb6d33be969f3927f8b3e8a8075bcd4.
2018-12-13 18:58:44 -06:00
Alistair Leslie-Hughes
3dc3c4e0e2 Updated winex11-key_translation patchset
Fixed Russian layout.
2018-12-13 08:41:49 +11:00
Alistair Leslie-Hughes
154875b4e9 Remove dinput-map_dik_codes patchset
This was pointed out this patchset isn't required.
The right approach is the correctly map the keyboard correctly
eg. winex11-key_translation patchset
2018-12-13 08:37:37 +11:00
Alistair Leslie-Hughes
66148cb9b2 Updated wintab32-improvements patchset 2018-12-11 13:43:44 +11:00
Alistair Leslie-Hughes
cfbf5f7b86 Added winex11-key_translation patchset 2018-12-11 13:43:44 +11:00
Alistair Leslie-Hughes
6f1b2ab35a Added dinput-map_dik_codes patchset 2018-12-11 13:43:44 +11:00
Zebediah Figura
550e67b8a2 Rebase against 76bc23d8c6c1b2857cb7a4d14c5931094a12a82a. 2018-12-10 19:53:30 -06:00
Zebediah Figura
e45211698d wow64cpu-Wow64Transition: Load wow64cpu.dll after kernel32.dll.
Fixes bug 46251.
2018-12-10 19:48:41 -06:00
Alistair Leslie-Hughes
6be0dfd008 Release 4.0-rc1 2018-12-08 16:35:46 +11:00
Zebediah Figura
0121326c5a user32-dialog_focus: Add patchset. 2018-12-07 19:59:29 -06:00
Zebediah Figura
4912f27424 Rebase against ae5e029d2227b3a8024f597591f76fe0f37d52e3. 2018-12-07 19:39:19 -06:00
Alistair Leslie-Hughes
7a69c317fc Rebase against 5cc5b102c1b0a66aa63b66f43f2da9a1a9d15ab6 2018-12-07 12:34:46 +11:00
Alistair Leslie-Hughes
c9b23fb803 Rebase against cda846b8cbc39c07ce360a6660a1c8b2e2aca24b 2018-12-06 09:17:51 +11:00
Alistair Leslie-Hughes
c214f34a3d Rebase against e9231beb865da13941d19eca016a6ccac07cb3f4. (try 2) 2018-12-05 13:45:00 +11:00
Zebediah Figura
08623c69c9 Rebase against e9231beb865da13941d19eca016a6ccac07cb3f4. 2018-12-04 20:17:06 -06:00
Alistair Leslie-Hughes
6fb7d85916 Rebase against 0cc6233e2077c1ef679ecb8bd815d31484868294 2018-12-04 09:08:05 +11:00
Alistair Leslie-Hughes
178c0f6d74 Added shell32-IconCache patchset 2018-12-03 09:00:11 +11:00
Alistair Leslie-Hughes
735aa272dc Updated ddraw-Rendering_Targets patchset 2018-12-03 08:44:13 +11:00
Alistair Leslie-Hughes
ce62e30ee2 Rebase against 400dd1596ab7946e68278b3f8dc7c87b898c7e9f try 2 2018-12-01 16:47:16 +11:00
Zebediah Figura
f828952b4b Rebase against 400dd1596ab7946e68278b3f8dc7c87b898c7e9f. 2018-11-30 20:00:04 -06:00
Alistair Leslie-Hughes
4e9b9940d2 Rebease against 20e5920135476cc4e380823a694537fca7fdf7e1 2018-11-30 08:57:39 +11:00
Alistair Leslie-Hughes
3fe5e9d97b Rebase against 1582ae6b045bb1658f6d5bc83efc5f6ce042c06e 2018-11-29 08:49:50 +11:00
Alistair Leslie-Hughes
d792ec8a45 Updated winepulse-PulseAudio_Support patchset 2018-11-28 09:20:45 +11:00
Alistair Leslie-Hughes
c30bad1531 Rebase against 00b08fad99745db326ef060627c3e9dc668a734a 2018-11-28 09:19:40 +11:00
Zebediah Figura
7d49250016 dwrite-FontFallback: Restore.
By request from Nikolay Sivov.
2018-11-26 19:23:08 -06:00
Zebediah Figura
52ea1ee7af qwave-QOSCreateHandle: Update spec file. 2018-11-26 19:13:16 -06:00
Zebediah Figura
bfff924f04 Rebase against 92f38bc8790cbfb31badf97a211ed890ac00c1db. 2018-11-26 18:45:43 -06:00
Zebediah Figura
c45c01449e staging: New rebase script.
Got tired of finding bugs in the old one and being completely confused by its code, so here is a new one.
It doesn't have a fancy progress bar, but at least it actually tells you what patches break.
2018-11-26 18:43:09 -06:00
162 changed files with 6857 additions and 8031 deletions

View File

@@ -1,25 +1,25 @@
From 2e1a505fedd43f0f03ba36e1a8413bf04f8afa83 Mon Sep 17 00:00:00 2001
From 05ca39b029f8f710ca53aeafc36384fd39fd6b89 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:53:46 +0200
Subject: winelib: Append '(Staging)' at the end of the version string.
Subject: [PATCH] winelib: Append '(Staging)' at the end of the version string.
---
libs/wine/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index 1b7fea8..780be10 100644
index 4833eb5..3cfa4f4 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -112,7 +112,7 @@ libwine_LDFLAGS = $(LIBWINE_LDFLAGS)
@@ -31,7 +31,7 @@ libwine_LDFLAGS = $(LIBWINE_LDFLAGS)
libwine_DEPS = $(LIBWINE_DEPENDS)
version.c: dummy
- version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
+ version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1 (Staging)";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
- version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
+ version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1 (Staging)";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
dummy:
.PHONY: dummy
--
2.6.2
1.9.1

View File

@@ -1,28 +1,23 @@
From b4a2543264f9eb91fc259a81dea872eee3c14aba Mon Sep 17 00:00:00 2001
From 07ca5e888c3265c57c88ef1758e6c47fbea4fb07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 27 Jun 2015 19:28:51 +0200
Subject: loader: Print library paths for --check-libs on Mac OS X.
---
loader/main.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
loader/main.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/loader/main.c b/loader/main.c
index 44804e1..4d9126e 100644
index a2dc40c51c..1642fb0965 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -48,6 +48,7 @@
#include "main.h"
@@ -50,6 +50,30 @@
/* the preloader will set this variable */
const struct wine_preload_info *wine_main_preload_info = NULL;
#ifdef __APPLE__
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
#ifndef __clang__
__asm__(".zerofill WINE_DOS, WINE_DOS, ___wine_dos, 0x40000000");
@@ -73,6 +74,26 @@ static inline void reserve_area( void *addr, size_t size )
wine_mmap_add_reserved_area( addr, size );
}
+
+static const char *get_macho_library_path( const char *libname )
+{
+ unsigned int path_len, libname_len = strlen( libname );
@@ -30,7 +25,7 @@ index 44804e1..4d9126e 100644
+
+ for (i = 0; i < count; i++)
+ {
+ const char *path = _dyld_get_image_name( i );
+ const char *path = _dyld_get_image_name( i );
+ if (!path) continue;
+
+ path_len = strlen( path );
@@ -42,11 +37,12 @@ index 44804e1..4d9126e 100644
+ }
+ return NULL;
+}
+#endif
+
#else /* __APPLE__ */
/* the preloader will set this variable */
@@ -181,7 +202,11 @@ static void check_command_line( int argc, char *argv[] )
/***********************************************************************
* check_command_line
*
@@ -146,7 +170,11 @@ static void check_command_line( int argc, char *argv[] )
else
#endif
{
@@ -60,5 +56,5 @@ index 44804e1..4d9126e 100644
wine_dlclose( lib_handle, NULL, 0 );
}
--
2.4.3
2.14.1

View File

@@ -1,4 +1,4 @@
From 53bf52b313245d965619802729ef59ada1806660 Mon Sep 17 00:00:00 2001
From 9774b93b25d11fe143fcf4ab7159135334916045 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 27 Aug 2014 00:31:23 +0200
Subject: configure: Also add the absolute RPATH when linking against libwine.
@@ -8,11 +8,11 @@ Subject: configure: Also add the absolute RPATH when linking against libwine.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index ff74f8d..529c209 100644
index 2222c687d9..513bdef795 100644
--- a/configure.ac
+++ b/configure.ac
@@ -966,10 +966,10 @@ ${wine_binary}_LDFLAGS = $LDEXECFLAGS -lwine \$(PTHREAD_LIBS)
[WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
@@ -943,10 +943,10 @@ case $host_os in
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000"
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
- [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
@@ -25,5 +25,5 @@ index ff74f8d..529c209 100644
WINE_TRY_CFLAGS([-Wl,--enable-new-dtags],
--
2.6.1
2.14.1

View File

@@ -1362,7 +1362,7 @@ index c930248..80f73de 100644
+ object->device = iface;
+ object->refcount = 1;
+
+ ID3D11Device_AddRef(iface);
+ ID3D11Device2_AddRef(iface);
+ wined3d_private_store_init(&object->private_store);
+
+ *context = &object->ID3D11DeviceContext_iface;

View File

@@ -1,4 +1,4 @@
From b8d301b085b39fba7f61409a0ebe17a4ff7b810a Mon Sep 17 00:00:00 2001
From 07c70b0b20919d9908b408322d65c62ad459f09e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 19 Jan 2017 16:56:56 +0100
Subject: [PATCH] d3d11: Initial implementation for deferred contexts.
@@ -8,7 +8,7 @@ Subject: [PATCH] d3d11: Initial implementation for deferred contexts.
1 file changed, 1040 insertions(+), 31 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 9127d01..94156e4 100644
index ebe8c03..791b959 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -19,12 +19,181 @@
@@ -725,7 +725,7 @@ index 9127d01..94156e4 100644
static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {}
static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops =
@@ -1217,7 +1908,20 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D
@@ -1221,7 +1912,20 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D
static void STDMETHODCALLTYPE d3d11_immediate_context_ExecuteCommandList(ID3D11DeviceContext1 *iface,
ID3D11CommandList *command_list, BOOL restore_state)
{
@@ -747,7 +747,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShaderResources(ID3D11DeviceContext1 *iface,
@@ -2972,6 +3676,7 @@ static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContex
@@ -2855,6 +3559,7 @@ static ULONG STDMETHODCALLTYPE d3d11_deferred_context_Release(ID3D11DeviceContex
if (!refcount)
{
@@ -755,7 +755,7 @@ index 9127d01..94156e4 100644
wined3d_private_store_cleanup(&context->private_store);
ID3D11Device_Release(context->device);
HeapFree(GetProcessHeap(), 0, context);
@@ -3023,43 +3728,86 @@ static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateDataInterface(
@@ -2906,43 +3611,86 @@ static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_SetPrivateDataInterface(
static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetConstantBuffers(ID3D11DeviceContext *iface,
UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
{
@@ -848,7 +848,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *iface,
@@ -3072,53 +3820,169 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *i
@@ -2955,53 +3703,169 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *i
static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_Map(ID3D11DeviceContext *iface, ID3D11Resource *resource,
UINT subresource_idx, D3D11_MAP map_type, UINT map_flags, D3D11_MAPPED_SUBRESOURCE *mapped_subresource)
{
@@ -1027,7 +1027,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface,
@@ -3147,7 +4011,16 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceCon
@@ -3030,7 +3894,16 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceCon
static void STDMETHODCALLTYPE d3d11_deferred_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface,
D3D11_PRIMITIVE_TOPOLOGY topology)
{
@@ -1045,7 +1045,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11DeviceContext *iface,
@@ -3207,8 +4080,28 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11De
@@ -3090,8 +3963,28 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11De
UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views,
ID3D11DepthStencilView *depth_stencil_view)
{
@@ -1075,7 +1075,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorderedAccessViews(
@@ -3228,15 +4121,44 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorde
@@ -3111,15 +4004,44 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargetsAndUnorde
static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetBlendState(ID3D11DeviceContext *iface,
ID3D11BlendState *blend_state, const float blend_factor[4], UINT sample_mask)
{
@@ -1122,7 +1122,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_SOSetTargets(ID3D11DeviceContext *iface, UINT buffer_count,
@@ -3278,13 +4200,34 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_DispatchIndirect(ID3D11Devi
@@ -3161,13 +4083,34 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_DispatchIndirect(ID3D11Devi
static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetState(ID3D11DeviceContext *iface,
ID3D11RasterizerState *rasterizer_state)
{
@@ -1159,7 +1159,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_RSSetScissorRects(ID3D11DeviceContext *iface,
@@ -3399,8 +4342,18 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShaderResources(ID3D11
@@ -3282,8 +4225,18 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShaderResources(ID3D11
static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetShader(ID3D11DeviceContext *iface,
ID3D11HullShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
{
@@ -1179,7 +1179,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceContext *iface,
@@ -3413,36 +4366,62 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceC
@@ -3296,36 +4249,62 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetSamplers(ID3D11DeviceC
static void STDMETHODCALLTYPE d3d11_deferred_context_HSSetConstantBuffers(ID3D11DeviceContext *iface,
UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
{
@@ -1247,7 +1247,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetShaderResources(ID3D11DeviceContext *iface,
@@ -3743,7 +4722,15 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetConstantBuffers(ID3D11
@@ -3626,7 +4605,15 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSGetConstantBuffers(ID3D11
static void STDMETHODCALLTYPE d3d11_deferred_context_ClearState(ID3D11DeviceContext *iface)
{
@@ -1264,7 +1264,7 @@ index 9127d01..94156e4 100644
}
static void STDMETHODCALLTYPE d3d11_deferred_context_Flush(ID3D11DeviceContext *iface)
@@ -3768,9 +4755,29 @@ static UINT STDMETHODCALLTYPE d3d11_deferred_context_GetContextFlags(ID3D11Devic
@@ -3651,9 +4638,29 @@ static UINT STDMETHODCALLTYPE d3d11_deferred_context_GetContextFlags(ID3D11Devic
static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_FinishCommandList(ID3D11DeviceContext *iface,
BOOL restore, ID3D11CommandList **command_list)
{
@@ -1296,13 +1296,13 @@ index 9127d01..94156e4 100644
}
static const struct ID3D11DeviceContextVtbl d3d11_deferred_context_vtbl =
@@ -4385,6 +5392,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device
@@ -4268,6 +5275,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device
object->device = iface;
object->refcount = 1;
+ list_init(&object->commands);
+
ID3D11Device_AddRef(iface);
ID3D11Device2_AddRef(iface);
wined3d_private_store_init(&object->private_store);
--

View File

@@ -1,4 +1,4 @@
From 8397d7b777db5ef44825b639d4009f6e372ca9ad Mon Sep 17 00:00:00 2001
From 1b741a4b555ad98a769fdb9fa659134b83293a4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 4 Mar 2016 22:22:42 +0100
Subject: [PATCH] ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
@@ -12,10 +12,10 @@ Subject: [PATCH] ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
5 files changed, 106 insertions(+)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 8247214..d70f2e2 100644
index fad185e..ebf91b3 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1544,6 +1544,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
@@ -1543,6 +1543,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
caps.dwCaps |= DDCAPS_ALIGNSTRIDE;
caps.dwAlignStrideAlign = DDRAW_STRIDE_ALIGNMENT;
@@ -25,10 +25,10 @@ index 8247214..d70f2e2 100644
if(DriverCaps)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 1f93a97..9a862e1 100644
index 59d07b7..5d81abb 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -11543,6 +11543,31 @@ static void test_execute_data(void)
@@ -11581,6 +11581,31 @@ static void test_execute_data(void)
DestroyWindow(window);
}
@@ -60,7 +60,7 @@ index 1f93a97..9a862e1 100644
static void test_viewport(void)
{
static struct
@@ -12030,6 +12055,7 @@ START_TEST(ddraw1)
@@ -12068,6 +12093,7 @@ START_TEST(ddraw1)
test_depth_readback();
test_clear();
test_enum_surfaces();
@@ -69,10 +69,10 @@ index 1f93a97..9a862e1 100644
test_viewport();
test_find_device();
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 95cdf8b..d317cc1 100644
index 8b9b249..b9b964d 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -12805,6 +12805,31 @@ static void test_enum_surfaces(void)
@@ -12862,6 +12862,31 @@ static void test_enum_surfaces(void)
IDirectDraw2_Release(ddraw);
}
@@ -104,7 +104,7 @@ index 95cdf8b..d317cc1 100644
static void test_viewport(void)
{
static struct
@@ -13321,6 +13346,7 @@ START_TEST(ddraw2)
@@ -13378,6 +13403,7 @@ START_TEST(ddraw2)
test_depth_readback();
test_clear();
test_enum_surfaces();
@@ -113,11 +113,11 @@ index 95cdf8b..d317cc1 100644
test_find_device();
test_killfocus();
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index a62aaf0..e11ec0c 100644
index 1c48418..306f233 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -15318,6 +15318,31 @@ static void test_killfocus(void)
UnregisterClassA("ddraw_killfocus_wndproc_wc", GetModuleHandleA(NULL));
@@ -15472,6 +15472,31 @@ static void test_sysmem_draw(void)
DestroyWindow(window);
}
+static void test_caps(void)
@@ -148,7 +148,7 @@ index a62aaf0..e11ec0c 100644
START_TEST(ddraw4)
{
DDDEVICEIDENTIFIER identifier;
@@ -15443,6 +15468,7 @@ START_TEST(ddraw4)
@@ -15597,6 +15622,7 @@ START_TEST(ddraw4)
test_depth_readback();
test_clear();
test_enum_surfaces();
@@ -157,11 +157,11 @@ index a62aaf0..e11ec0c 100644
test_find_device();
test_killfocus();
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 04048d4..ad4f63d 100644
index a125200..da777d8 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -15106,6 +15106,31 @@ static void test_killfocus(void)
UnregisterClassA("ddraw_killfocus_wndproc_wc", GetModuleHandleA(NULL));
@@ -15198,6 +15198,31 @@ static void test_sysmem_draw(void)
DestroyWindow(window);
}
+static void test_caps(void)
@@ -192,14 +192,14 @@ index 04048d4..ad4f63d 100644
START_TEST(ddraw7)
{
DDDEVICEIDENTIFIER2 identifier;
@@ -15243,6 +15268,7 @@ START_TEST(ddraw7)
@@ -15335,6 +15360,7 @@ START_TEST(ddraw7)
test_enum_surfaces();
test_viewport();
test_device_load();
+ test_caps();
test_color_vertex();
test_killfocus();
}
test_sysmem_draw();
--
1.9.1

View File

@@ -1,4 +1,4 @@
From cf433894ff56fda93491753843e0f4f658f67c8c Mon Sep 17 00:00:00 2001
From 599d50340aaf37f2eb39a789a4034e677d52e92c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 29 Jul 2015 17:09:50 +0200
Subject: [PATCH] ddraw: Create rendering targets in video memory if possible.
@@ -12,10 +12,10 @@ Based on a patch by Henri Verbeet.
4 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 9a40bc9..6f3d058 100644
index 6b2abe3..dfd52a0 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4210,7 +4210,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
@@ -4209,7 +4209,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
@@ -24,7 +24,7 @@ index 9a40bc9..6f3d058 100644
{
*device = &object->IDirect3DDevice7_iface;
}
@@ -4239,7 +4239,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
@@ -4238,7 +4238,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
return CLASS_E_NOAGGREGATION;
wined3d_mutex_lock();
@@ -33,7 +33,7 @@ index 9a40bc9..6f3d058 100644
{
*device = &device_impl->IDirect3DDevice3_iface;
}
@@ -4265,7 +4265,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
@@ -4264,7 +4264,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
@@ -43,7 +43,7 @@ index 9a40bc9..6f3d058 100644
*device = &device_impl->IDirect3DDevice2_iface;
}
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index 495cb8b..4af638b 100644
index b035a7e..699f719 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -303,6 +303,7 @@ struct d3d_device
@@ -152,7 +152,7 @@ index 0d48c7d..2bef17d 100644
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(object);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 5ce1d85..e729348 100644
index 8190442..c73981b 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -226,7 +226,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
@@ -194,11 +194,11 @@ index 5ce1d85..e729348 100644
+ */
+ if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) &&
+ SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, WINED3DUSAGE_RENDERTARGET,
+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, 0,
+ bind_flags, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
+ {
+ FIXME("Application wants to create rendering target in system memory, using video memory instead\n");
+ wined3d_desc.usage |= WINED3DUSAGE_RENDERTARGET;
+ wined3d_desc.bind_flags = bind_flags;
+ }
+ else
+ wined3d_desc.access = WINED3D_RESOURCE_ACCESS_CPU

View File

@@ -1,2 +1 @@
Fixes: [34906] Use video memory for rendering targets if possible
Disabled: True

View File

@@ -1,4 +1,4 @@
From a259cb0c3a69913d6656ef3043a263ec5ad3ea05 Mon Sep 17 00:00:00 2001
From f02dd0110ae95771a6e44a608c724d964fab7f68 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 28 Mar 2015 08:18:10 +0100
Subject: dsound: Apply filters before sound is multiplied to speakers.
@@ -7,24 +7,24 @@ Based on a patch by Mark Harmstone.
---
dlls/dsound/dsound.c | 2 +
dlls/dsound/dsound_private.h | 4 +-
dlls/dsound/mixer.c | 110 ++++++++++++++++++++++++++++++-------------
dlls/dsound/mixer.c | 110 ++++++++++++++++++++++++-----------
3 files changed, 81 insertions(+), 35 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 68902d723af..449830ae83f 100644
index 71ede7d8..cc8b4444 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -234,6 +234,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
IAudioStreamVolume_Release(device->volume);
@@ -233,6 +233,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
if(device->mmdevice)
IMMDevice_Release(device->mmdevice);
CloseHandle(device->sleepev);
+
+ HeapFree(GetProcessHeap(), 0, device->dsp_buffer);
HeapFree(GetProcessHeap(), 0, device->tmp_buffer);
HeapFree(GetProcessHeap(), 0, device->cp_buffer);
HeapFree(GetProcessHeap(), 0, device->buffer);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 985a7a2526b..45232cbd729 100644
index c9ae7fd7..371cc5fb 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -90,8 +90,8 @@ struct DirectSoundDevice
@@ -39,7 +39,7 @@ index 985a7a2526b..45232cbd729 100644
DSVOLUMEPAN volpan;
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index 23e5bbcf7c7..e5211deaeeb 100644
index 1643e7d4..d4dbdc15 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -278,23 +278,22 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
@@ -231,5 +231,5 @@ index 23e5bbcf7c7..e5211deaeeb 100644
static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames)
--
2.13.1
2.19.1

View File

@@ -0,0 +1,43 @@
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Subject: [PATCH 1/2] dwmapi: return DWM_E_COMPOSITIONDISABLED instead of E_NOTIMPL in DwmGetTransportAttributes
Message-Id: <20181205121826.2124-1-xerox.xerox2000x@gmail.com>
Date: Wed, 5 Dec 2018 13:18:25 +0100
This versioh is with tests;
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
---
dlls/dwmapi/dwmapi_main.c | 2 +-
include/winerror.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/dwmapi/dwmapi_main.c b/dlls/dwmapi/dwmapi_main.c
index c1ee067122..eb06d15507 100644
--- a/dlls/dwmapi/dwmapi_main.c
+++ b/dlls/dwmapi/dwmapi_main.c
@@ -146,7 +146,7 @@ HRESULT WINAPI DwmGetTransportAttributes(BOOL *pfIsRemoting, BOOL *pfIsConnected
{
FIXME("(%p, %p, %p) stub\n", pfIsRemoting, pfIsConnected, pDwGeneration);
- return E_NOTIMPL;
+ return DWM_E_COMPOSITIONDISABLED;
}
/**********************************************************************
diff --git a/include/winerror.h b/include/winerror.h
index d78c91e84e..a97b405c34 100644
--- a/include/winerror.h
+++ b/include/winerror.h
@@ -3090,6 +3090,8 @@ static inline HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define WININET_E_LOGIN_FAILURE_DISPLAY_ENTITY_BODY _HRESULT_TYPEDEF_(0x80072f8e)
#define WININET_E_DECODING_FAILED _HRESULT_TYPEDEF_(0x80072f8f)
+#define DWM_E_COMPOSITIONDISABLED _HRESULT_TYPEDEF_(0x80263001)
+
#define D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS _HRESULT_TYPEDEF_(0x887c0001)
#define D3D11_ERROR_FILE_NOT_FOUND _HRESULT_TYPEDEF_(0x887c0002)
#define D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS _HRESULT_TYPEDEF_(0x887c0003)
--
2.17.1

View File

@@ -0,0 +1,185 @@
From: Louis Lenders <xerox.xerox2000x@gmail.com>
Subject: [PATCH 2/2] dwampi: add initial tests
Message-Id: <20181205121826.2124-2-xerox.xerox2000x@gmail.com>
Date: Wed, 5 Dec 2018 13:18:26 +0100
In-Reply-To: <20181205121826.2124-1-xerox.xerox2000x@gmail.com>
References: <20181205121826.2124-1-xerox.xerox2000x@gmail.com>
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
---
configure | 1 +
configure.ac | 1 +
dlls/dwmapi/tests/Makefile.in | 5 ++
dlls/dwmapi/tests/dwmapi.c | 108 ++++++++++++++++++++++++++++++++++
include/dwmapi.h | 3 +
5 files changed, 118 insertions(+)
create mode 100644 dlls/dwmapi/tests/Makefile.in
create mode 100644 dlls/dwmapi/tests/dwmapi.c
diff --git a/configure b/configure
index d00057ba2f..e1dde1813b 100755
--- a/configure
+++ b/configure
@@ -19392,6 +19392,7 @@ wine_fn_config_makefile dlls/dssenh/tests enable_tests
wine_fn_config_makefile dlls/dswave enable_dswave
wine_fn_config_makefile dlls/dswave/tests enable_tests
wine_fn_config_makefile dlls/dwmapi enable_dwmapi
+wine_fn_config_makefile dlls/dwmapi/tests enable_tests
wine_fn_config_makefile dlls/dwrite enable_dwrite
wine_fn_config_makefile dlls/dwrite/tests enable_tests
wine_fn_config_makefile dlls/dx8vb enable_dx8vb
diff --git a/configure.ac b/configure.ac
index 50cf9a0bd0..607a46f5a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3255,6 +3255,7 @@ WINE_CONFIG_MAKEFILE(dlls/dssenh/tests)
WINE_CONFIG_MAKEFILE(dlls/dswave)
WINE_CONFIG_MAKEFILE(dlls/dswave/tests)
WINE_CONFIG_MAKEFILE(dlls/dwmapi)
+WINE_CONFIG_MAKEFILE(dlls/dwmapi/tests)
WINE_CONFIG_MAKEFILE(dlls/dwrite)
WINE_CONFIG_MAKEFILE(dlls/dwrite/tests)
WINE_CONFIG_MAKEFILE(dlls/dx8vb)
diff --git a/dlls/dwmapi/tests/Makefile.in b/dlls/dwmapi/tests/Makefile.in
new file mode 100644
index 0000000000..f365f96c72
--- /dev/null
+++ b/dlls/dwmapi/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = dwmapi.dll
+IMPORTS = dwmapi
+
+C_SRCS = \
+ dwmapi.c
diff --git a/dlls/dwmapi/tests/dwmapi.c b/dlls/dwmapi/tests/dwmapi.c
new file mode 100644
index 0000000000..fe5ee33996
--- /dev/null
+++ b/dlls/dwmapi/tests/dwmapi.c
@@ -0,0 +1,108 @@
+/*
+ * Unit tests for dwmapi
+ *
+ * Copyright 2018 Louis Lenders
+ *
+ * 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 "dwmapi.h"
+
+#include "wine/test.h"
+
+static HRESULT (WINAPI *pDwmIsCompositionEnabled)(BOOL*);
+static HRESULT (WINAPI *pDwmEnableComposition)(UINT);
+static HRESULT (WINAPI *pDwmGetTransportAttributes)(BOOL*,BOOL*,DWORD*);
+
+BOOL dwmenabled;
+
+static void test_isdwmenabled(void)
+{
+ HRESULT res;
+ BOOL ret;
+
+ ret = -1;
+ res = pDwmIsCompositionEnabled(&ret);
+ ok((res == S_OK && ret == TRUE) || (res == S_OK && ret == FALSE), "got %x and %d\n", res, ret);
+
+ if (res == S_OK && ret == TRUE)
+ dwmenabled = TRUE;
+ else
+ dwmenabled = FALSE;
+ /*tested on win7 by enabling/disabling DWM service via services.msc*/
+ if (dwmenabled)
+ {
+ res = pDwmEnableComposition(DWM_EC_DISABLECOMPOSITION); /* try disable and reenable dwm*/
+ ok(res == S_OK, "got %x expected S_OK\n", res);
+
+ ret = -1;
+ res = pDwmIsCompositionEnabled(&ret);
+ ok((res == S_OK && ret == FALSE) /*wvista win7*/ || (res == S_OK && ret == TRUE) /*>win7*/, "got %x and %d\n", res, ret);
+
+ res = pDwmEnableComposition(DWM_EC_ENABLECOMPOSITION);
+ ok(res == S_OK, "got %x\n", res);
+
+ ret = -1;
+ res = pDwmIsCompositionEnabled(&ret);
+ todo_wine ok(res == S_OK && ret == TRUE, "got %x and %d\n", res, ret);
+ }
+ else
+ {
+ res = pDwmEnableComposition(DWM_EC_ENABLECOMPOSITION); /*cannot enable DWM composition this way*/
+ ok(res == S_OK /*win7 testbot*/ || res == DWM_E_COMPOSITIONDISABLED /*win7 laptop*/, "got %x\n", res);
+ if (winetest_debug > 1)
+ trace("returning %x\n", res);
+
+ ret = -1;
+ res = pDwmIsCompositionEnabled(&ret);
+ ok(res == S_OK && ret == FALSE, "got %x and %d\n", res, ret);
+ }
+}
+
+static void test_dwm_get_transport_attributes(void)
+{
+ BOOL isremoting, isconnected;
+ DWORD generation;
+ HRESULT res;
+
+ res = pDwmGetTransportAttributes(&isremoting, &isconnected, &generation);
+ if (dwmenabled)
+ ok(res == S_OK, "got %x\n", res);
+ else
+ {
+ ok(res == S_OK /*win7 testbot*/ || res == DWM_E_COMPOSITIONDISABLED /*win7 laptop*/, "got %x\n", res);
+ if (winetest_debug > 1)
+ trace("returning %x\n", res);
+ }
+}
+
+START_TEST(dwmapi)
+{
+ HMODULE hmod = LoadLibraryA("dwmapi.dll");
+
+ if (!hmod)
+ {
+ trace("dwmapi not found, skipping tests\n");
+ return;
+ }
+
+ pDwmIsCompositionEnabled = (void *)GetProcAddress(hmod, "DwmIsCompositionEnabled");
+ pDwmEnableComposition = (void *)GetProcAddress(hmod, "DwmEnableComposition");
+ pDwmGetTransportAttributes = (void *)GetProcAddress(hmod, "DwmGetTransportAttributes");
+
+ test_isdwmenabled();
+ test_dwm_get_transport_attributes();
+}
diff --git a/include/dwmapi.h b/include/dwmapi.h
index b2f39deae5..12527aee62 100644
--- a/include/dwmapi.h
+++ b/include/dwmapi.h
@@ -101,6 +101,9 @@ typedef struct _MilMatrix3x2D
DOUBLE DY;
} MilMatrix3x2D;
+#define DWM_EC_DISABLECOMPOSITION 0
+#define DWM_EC_ENABLECOMPOSITION 1
+
#define DWM_BB_ENABLE 0x00000001
#define DWM_BB_BLURREGION 0x00000002
#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004
--
2.17.1

View File

@@ -0,0 +1 @@
Fixes: [31350] T-Online Mediencenter Assistent (.NET 3.5 WPF app) installer fails ('dwmapi.dll' stubs insufficient in Vista/Win7 mode)

View File

@@ -0,0 +1,77 @@
From e2978c13fca913a14991e286c463ede69f61831d Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Sun, 20 May 2018 21:40:39 -0700
Subject: [PATCH 1/6] dwrite: Test IDWriteTextFormat with nonexistent font
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/tests/layout.c | 46 ++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 652f6b78ac..4198b8a1b1 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -30,6 +30,7 @@
#include "wine/test.h"
static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
+static const WCHAR nonExistentFontW[] = {'B','l','a','h','!',0};
static const WCHAR enusW[] = {'e','n','-','u','s',0};
struct testanalysissink
@@ -3292,6 +3293,51 @@ todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
+ IDWriteTextFormat_Release(format);
+
+ /* nonexistent font */
+ hr = IDWriteFactory_CreateTextFormat(factory, nonExistentFontW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ count = 0;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+todo_wine
+ ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth);
+todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+
+ IDWriteTextLayout_Release(layout);
+
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
}
--
2.18.0

View File

@@ -0,0 +1,323 @@
From 22fd0a86b6be3d2e203beee7a0b55f717f32436b Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 00:01:42 -0700
Subject: [PATCH 2/6] dwrite: Test GetMetrics with custom fontcollection
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/tests/layout.c | 278 +++++++++++++++++++++++++++++++++++++
1 file changed, 278 insertions(+)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 4198b8a1b1..7542cad8d7 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -4489,6 +4489,7 @@ static void test_SetWordWrapping(void)
/* Collection dedicated to fallback testing */
static const WCHAR g_blahfontW[] = {'B','l','a','h',0};
+static const WCHAR g_fontNotInCollectionW[] = {'n','o','t','B','l','a','h',0};
static HRESULT WINAPI fontcollection_QI(IDWriteFontCollection *iface, REFIID riid, void **obj)
{
if (IsEqualIID(riid, &IID_IDWriteFontCollection) || IsEqualIID(riid, &IID_IUnknown)) {
@@ -4548,6 +4549,9 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
*index = 123456;
*exists = TRUE;
return S_OK;
+ } else if (!lstrcmpW(name, g_fontNotInCollectionW)) {
+ *exists = FALSE;
+ return S_OK;
}
ok(0, "unexpected call, name %s\n", wine_dbgstr_w(name));
return E_NOTIMPL;
@@ -5568,6 +5572,279 @@ static void test_GetOverhangMetrics(void)
IDWriteFactory_Release(factory);
}
+static void test_GetMetrics_with_custom_fontcollection(void)
+{
+ static const WCHAR emptystringW[] = {0};
+ static const WCHAR mappedW[] = {'a','b','c','d',0};
+ static const WCHAR notmappedW[] = {'a',0xffff,'b',0}; // u+ffff = not a unicode character
+ DWRITE_CLUSTER_METRICS clusters[4];
+ DWRITE_TEXT_METRICS metrics;
+ IDWriteTextFormat *format;
+ IDWriteTextLayout *layout;
+ IDWriteFactory *factory;
+ UINT32 count, i;
+ FLOAT width;
+ HRESULT hr;
+
+ factory = create_factory();
+
+ /* font is in font collection */
+ hr = IDWriteFactory_CreateTextFormat(factory, g_blahfontW, &fallbackcollection,
+ DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ /* text is mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, mappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* text is not mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, notmappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* zero-length empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 0, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 0, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ IDWriteTextFormat_Release(format);
+
+ /* font not in font collection */
+ hr = IDWriteFactory_CreateTextFormat(factory, g_fontNotInCollectionW, &fallbackcollection,
+ DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ /* text is mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, mappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* text is not mapped by fontfallback */
+ hr = IDWriteFactory_CreateTextLayout(factory, notmappedW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 4, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ /* zero-length empty string */
+ hr = IDWriteFactory_CreateTextLayout(factory, emptystringW, 0, format, 1000.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ count = 9999;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(count == 0, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+ todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+ todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+ todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+ todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+ todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+ todo_wine
+ ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
+ todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+ todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+ todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+ IDWriteTextLayout_Release(layout);
+
+ IDWriteTextFormat_Release(format);
+
+ IDWriteFactory_Release(factory);
+}
+
START_TEST(layout)
{
IDWriteFactory *factory;
@@ -5601,6 +5878,7 @@ START_TEST(layout)
test_SetFontStretch();
test_SetStrikethrough();
test_GetMetrics();
+ test_GetMetrics_with_custom_fontcollection();
test_SetFlowDirection();
test_SetDrawingEffect();
test_GetLineMetrics();
--
2.18.0

View File

@@ -0,0 +1,352 @@
From add69d1d24330592891222674844dccf104d6d73 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Mon, 21 May 2018 18:13:00 -0700
Subject: [PATCH 4/6] dwrite: Use font fallback when mapping characters
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/analyzer.c | 77 +++++++++++++++++++++++-------
dlls/dwrite/layout.c | 6 +++
dlls/dwrite/tests/layout.c | 97 +++++++++++++-------------------------
3 files changed, 98 insertions(+), 82 deletions(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index 8d553c6d56..21da783fe6 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -2078,6 +2078,7 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
IDWriteFont **mapped_font)
{
const struct fallback_mapping *mapping;
+ IDWriteFontCollection *collection;
HRESULT hr;
UINT32 i;
@@ -2089,9 +2090,15 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
return E_FAIL;
}
+ if (mapping->collection) {
+ collection = mapping->collection;
+ } else {
+ collection = (IDWriteFontCollection *)fallback->systemcollection;
+ }
+
/* Now let's see what fallback can handle. Pick first font that could be created. */
for (i = 0; i < mapping->families_count; i++) {
- hr = create_matching_font((IDWriteFontCollection *)fallback->systemcollection, mapping->families[i],
+ hr = create_matching_font(collection, mapping->families[i],
weight, style, stretch, mapped_font);
if (hr == S_OK) {
TRACE("Created fallback font using family %s.\n", debugstr_w(mapping->families[i]));
@@ -2148,32 +2155,66 @@ static HRESULT WINAPI fontfallback_MapCharacters(IDWriteFontFallback *iface, IDW
if (basefamily && *basefamily) {
hr = create_matching_font(basecollection, basefamily, weight, style, stretch, ret_font);
- if (FAILED(hr))
- goto done;
-
- hr = fallback_map_characters(*ret_font, text, length, mapped_length);
- if (FAILED(hr))
- goto done;
+ if (SUCCEEDED(hr)) {
+ hr = fallback_map_characters(*ret_font, text, length, mapped_length);
+ if (FAILED(hr)) {
+ IDWriteFont_Release(*ret_font);
+ *ret_font = NULL;
+ WARN("Mapping with requested family %s failed, hr %#x.\n", debugstr_w(basefamily), hr);
+ }
+ }
}
if (!*mapped_length) {
- IDWriteFont *mapped_font;
+ if (*ret_font) {
+ IDWriteFont_Release(*ret_font);
+ *ret_font = NULL;
+ }
- hr = fallback_get_fallback_font(fallback, text, length, weight, style, stretch, mapped_length, &mapped_font);
+ hr = fallback_get_fallback_font(fallback, text, length, weight, style, stretch, mapped_length, ret_font);
if (FAILED(hr)) {
- /* fallback wasn't found, keep base font if any, so we can get at least some visual output */
- if (*ret_font) {
- *mapped_length = length;
- hr = S_OK;
- }
+ WARN("Mapping with fallback families failed, hr %#x.\n", hr);
}
- else {
- if (*ret_font)
- IDWriteFont_Release(*ret_font);
- *ret_font = mapped_font;
+ }
+
+ /**
+ * This is a rough hack. We search the system font collection because
+ * the system fontfallback, which would have been searched above, is not
+ * fully implemented as it isn't populated with any system fonts. Once
+ * implemented, the block below can be removed.
+ * */
+ if (!*mapped_length) {
+ IDWriteFontFamily *family;
+ IDWriteFont *font;
+ UINT32 i, count = IDWriteFontCollection_GetFontFamilyCount((IDWriteFontCollection *)fallback->systemcollection);
+ for (i = 0; i < count; i++) {
+ hr = IDWriteFontCollection_GetFontFamily((IDWriteFontCollection *)fallback->systemcollection, i, &family);
+ if (FAILED(hr)) {
+ ERR("Failed to get font family.\n");
+ continue;
+ }
+
+ hr = IDWriteFontFamily_GetFirstMatchingFont(family, weight, stretch, style, &font);
+ IDWriteFontFamily_Release(family);
+ if (FAILED(hr)) {
+ continue;
+ }
+
+ hr = fallback_map_characters(font, text, length, mapped_length);
+ if (SUCCEEDED(hr) && mapped_length > 0) {
+ *ret_font = font;
+ break;
+ }
+
+ IDWriteFont_Release(font);
}
}
+ if (!*mapped_length) {
+ *mapped_length = length == 0 ? 0 : 1;
+ hr = S_OK;
+ }
+
done:
heap_free(buff);
return hr;
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 65e0a57678..df3f3beabb 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -878,6 +878,12 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
goto fatal;
}
+ if (!font) {
+ hr = E_FAIL;
+ WARN("Failed to create font face, hr %#x.\n", hr);
+ goto fatal;
+ }
+
hr = IDWriteFont_CreateFontFace(font, &run->run.fontFace);
IDWriteFont_Release(font);
if (FAILED(hr)) {
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index c8f3f5a00f..430bb1f0eb 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3310,35 +3310,23 @@ todo_wine
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
-todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
-todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
-todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
-todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
-todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
-todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
-todo_wine
ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth);
-todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
-todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
-todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
@@ -4637,16 +4625,13 @@ static void test_MapCharacters(void)
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
-todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
- IDWriteFont_Release(font);
-}
+ if (font) {
+ IDWriteFont_Release(font);
+ }
/* same latin text, full length */
g_source = strW;
mappedlength = 0;
@@ -4654,16 +4639,13 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(mappedlength == 3, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
-todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
- IDWriteFont_Release(font);
-}
+ if (font) {
+ IDWriteFont_Release(font);
+ }
/* string 'a\x3058b' */
g_source = str2W;
mappedlength = 0;
@@ -4671,38 +4653,32 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
-todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
- IDWriteFont_Release(font);
-}
+ if (font) {
+ IDWriteFont_Release(font);
+ }
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
-todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
- /* font returned for Hiragana character, check if it supports Latin too */
- exists = FALSE;
- hr = IDWriteFont_HasCharacter(font, 'b', &exists);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(exists, "got %d\n", exists);
+ if (font) {
+ /* font returned for Hiragana character, check if it supports Latin too */
+ exists = FALSE;
+ hr = IDWriteFont_HasCharacter(font, 'b', &exists);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(exists, "got %d\n", exists);
- IDWriteFont_Release(font);
-}
+ IDWriteFont_Release(font);
+ }
/* Try with explicit collection, Tahoma will be forced. */
/* 1. Latin part */
g_source = str2W;
@@ -4725,7 +4701,10 @@ if (font) {
IDWriteLocalizedStrings_Release(strings);
IDWriteFont_Release(font);
- /* 2. Hiragana character, force Tahoma font does not support Japanese */
+ /**
+ * 2. Hiragana character. Tahoma is requested, but it doesn't support
+ * Japanese. A NULL font is returned if there is no fallback for Japanese.
+ */
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
@@ -4735,17 +4714,19 @@ if (font) {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
- ok(font != NULL, "got %p\n", font);
- exists = FALSE;
- hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
- ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
- hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
- ok(hr == S_OK, "got 0x%08x\n", hr);
-todo_wine
- ok(lstrcmpW(buffW, tahomaW), "%s\n", wine_dbgstr_w(buffW));
- IDWriteLocalizedStrings_Release(strings);
- IDWriteFont_Release(font);
+ if (!font) {
+ skip("Missing system font for Japanese.\n");
+ } else {
+ exists = FALSE;
+ hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
+ ok(hr == S_OK && exists, "got 0x%08x, exists %d\n", hr, exists);
+ hr = IDWriteLocalizedStrings_GetString(strings, 0, buffW, ARRAY_SIZE(buffW));
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(lstrcmpW(buffW, tahomaW), "%s\n", wine_dbgstr_w(buffW));
+ IDWriteLocalizedStrings_Release(strings);
+ IDWriteFont_Release(font);
+ }
IDWriteFontFallback_Release(fallback);
IDWriteFactory2_Release(factory2);
@@ -5708,34 +5689,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
--
2.18.0

View File

@@ -0,0 +1,128 @@
From 838b8a5edeca6c06c20bdc301f4d5d658e835cc9 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 05:59:20 -0700
Subject: [PATCH 5/6] dwrite: Use MapCharacters for non-visual characters
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/layout.c | 22 +++++++++++++++-------
dlls/dwrite/tests/layout.c | 24 ------------------------
2 files changed, 15 insertions(+), 31 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index df3f3beabb..5d06bf9348 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -822,7 +822,8 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
LIST_FOR_EACH_ENTRY(r, &layout->runs, struct layout_run, entry) {
struct regular_layout_run *run = &r->u.regular;
IDWriteFont *font;
- UINT32 length;
+ UINT32 length, mapped_length;
+ FLOAT scale;
if (r->kind == LAYOUT_RUN_INLINE)
continue;
@@ -830,12 +831,19 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
range = get_layout_range_by_pos(layout, run->descr.textPosition);
if (run->sa.shapes == DWRITE_SCRIPT_SHAPES_NO_VISUAL) {
- IDWriteFontCollection *collection;
-
- collection = range->collection ? range->collection : sys_collection;
-
- if (FAILED(hr = create_matching_font(collection, range->fontfamily, range->weight, range->style,
- range->stretch, &font))) {
+ hr = IDWriteFontFallback_MapCharacters(fallback,
+ (IDWriteTextAnalysisSource *)&layout->IDWriteTextAnalysisSource1_iface,
+ run->descr.textPosition,
+ run->descr.stringLength,
+ range->collection,
+ range->fontfamily,
+ range->weight,
+ range->style,
+ range->stretch,
+ &mapped_length,
+ &font,
+ &scale);
+ if (FAILED(hr)) {
WARN("%s: failed to create matching font for non visual run, family %s, collection %p\n",
debugstr_rundescr(&run->descr), debugstr_w(range->fontfamily), range->collection);
break;
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 430bb1f0eb..cf1d5d7060 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -5713,34 +5713,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
@@ -5749,34 +5737,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(count == 4, "got %u\n", count);
for (i = 0, width = 0.0; i < count; i++)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
- todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
- todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
--
2.18.0

View File

@@ -0,0 +1,96 @@
From a0f4bde380003f7a8e3b713028215bf985dbb3c0 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 07:03:44 -0700
Subject: [PATCH 6/6] dwrite: Use MapCharacters for dummy line metrics
Fixes: https://bugs.winehq.org/show_bug.cgi?id=44052
Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/layout.c | 29 +++++++++++++++++++++++++++++
dlls/dwrite/tests/layout.c | 8 --------
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 5d06bf9348..2213717f92 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -1808,8 +1808,11 @@ static HRESULT layout_set_dummy_line_metrics(struct dwrite_textlayout *layout, U
DWRITE_FONT_METRICS fontmetrics;
struct layout_range *range;
IDWriteFontFace *fontface;
+ IDWriteFontFallback *fallback;
IDWriteFont *font;
HRESULT hr;
+ UINT32 mapped_length;
+ FLOAT scale;
range = get_layout_range_by_pos(layout, pos);
hr = create_matching_font(range->collection,
@@ -1818,8 +1821,34 @@ static HRESULT layout_set_dummy_line_metrics(struct dwrite_textlayout *layout, U
range->style,
range->stretch,
&font);
+
+ if (FAILED(hr)) {
+ if (layout->format.fallback) {
+ fallback = layout->format.fallback;
+ IDWriteFontFallback_AddRef(fallback);
+ } else if (FAILED(hr = IDWriteFactory5_GetSystemFontFallback(layout->factory, &fallback))) {
+ WARN("Failed to get system fallback, hr %#x.\n", hr);
+ return hr;
+ }
+
+ hr = IDWriteFontFallback_MapCharacters(fallback,
+ (IDWriteTextAnalysisSource *)&layout->IDWriteTextAnalysisSource1_iface,
+ pos,
+ layout->len,
+ range->collection,
+ range->fontfamily,
+ range->weight,
+ range->style,
+ range->stretch,
+ &mapped_length,
+ &font,
+ &scale);
+ IDWriteFontFallback_Release(fallback);
+ }
if (FAILED(hr))
return hr;
+ if (font == NULL)
+ return S_OK;
hr = IDWriteFont_CreateFontFace(font, &fontface);
IDWriteFont_Release(font);
if (FAILED(hr))
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index cf1d5d7060..6ed7b3c334 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -5767,24 +5767,16 @@ static void test_GetMetrics_with_custom_fontcollection(void)
width += clusters[i].width;
memset(&metrics, 0xcc, sizeof(metrics));
hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
- todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine
ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
- todo_wine
ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
- todo_wine
ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
- todo_wine
ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
metrics.widthIncludingTrailingWhitespace, width);
todo_wine
ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
- todo_wine
ok(metrics.layoutWidth == 1000.0, "got %.2f\n", metrics.layoutWidth);
- todo_wine
ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
- todo_wine
ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
--
2.18.0

View File

@@ -0,0 +1 @@
Fixes: [44052] - Support for font fallback.

View File

@@ -1,118 +0,0 @@
From c6530912db59318d93b77daa1cab061ff5afadaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 24 Jan 2017 01:37:29 +0100
Subject: [PATCH] dxgi: Implement setting and querying the gamma value of an
output.
---
dlls/dxgi/output.c | 17 ++++++++++++++--
dlls/dxgi/tests/dxgi.c | 45 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/dlls/dxgi/output.c b/dlls/dxgi/output.c
index 2b168fb627b..31bdf9a3805 100644
--- a/dlls/dxgi/output.c
+++ b/dlls/dxgi/output.c
@@ -293,9 +293,22 @@ static void STDMETHODCALLTYPE dxgi_output_ReleaseOwnership(IDXGIOutput4 *iface)
static HRESULT STDMETHODCALLTYPE dxgi_output_GetGammaControlCapabilities(IDXGIOutput4 *iface,
DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps)
{
- FIXME("iface %p, gamma_caps %p stub!\n", iface, gamma_caps);
+ int i;
- return E_NOTIMPL;
+ TRACE("iface %p, gamma_caps %p.\n", iface, gamma_caps);
+
+ if (!gamma_caps)
+ return E_INVALIDARG;
+
+ gamma_caps->ScaleAndOffsetSupported = FALSE;
+ gamma_caps->MaxConvertedValue = 1.0;
+ gamma_caps->MinConvertedValue = 0.0;
+ gamma_caps->NumGammaControlPoints = 256;
+
+ for (i = 0; i < 256; i++)
+ gamma_caps->ControlPointPositions[i] = i / 255.0f;
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_output_SetGammaControl(IDXGIOutput4 *iface,
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c
index 56065456eb0..6bd257c6190 100644
--- a/dlls/dxgi/tests/dxgi.c
+++ b/dlls/dxgi/tests/dxgi.c
@@ -2110,11 +2110,13 @@ static void test_swapchain_fullscreen_state(IDXGISwapChain *swapchain,
static void test_set_fullscreen(void)
{
struct swapchain_fullscreen_state initial_state;
+ DXGI_GAMMA_CONTROL_CAPABILITIES caps;
DXGI_SWAP_CHAIN_DESC swapchain_desc;
IDXGISwapChain *swapchain;
IDXGIFactory *factory;
IDXGIAdapter *adapter;
IDXGIDevice *device;
+ IDXGIOutput *output;
ULONG refcount;
HRESULT hr;
@@ -2130,6 +2132,17 @@ static void test_set_fullscreen(void)
hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory);
ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr);
+ hr = IDXGIAdapter_EnumOutputs(adapter, 0, &output);
+ if (SUCCEEDED(hr))
+ {
+ hr = IDXGIOutput_GetGammaControlCapabilities(output, &caps);
+ todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Expected DXGI_ERROR_INVALID_CALL, got %#x.\n", hr);
+
+ IDXGIOutput_Release(output);
+ }
+ else
+ skip("Failed to get output, skipping gamma test.\n");
+
swapchain_desc.BufferDesc.Width = 800;
swapchain_desc.BufferDesc.Height = 600;
swapchain_desc.BufferDesc.RefreshRate.Numerator = 60;
@@ -2160,6 +2173,38 @@ static void test_set_fullscreen(void)
skip("Could not change fullscreen state.\n");
goto done;
}
+
+ hr = IDXGISwapChain_GetContainingOutput(swapchain, &output);
+ if (SUCCEEDED(hr))
+ {
+ DXGI_GAMMA_CONTROL gamma;
+ int i;
+
+ memset(&caps, 0, sizeof(caps));
+ hr = IDXGIOutput_GetGammaControlCapabilities(output, &caps);
+ ok(hr == S_OK, "Expected S_OK, got %#x.\n", hr);
+
+ ok(caps.MaxConvertedValue > caps.MinConvertedValue,
+ "Expected max gamma value (%f) to be bigger than the min value (%f).\n",
+ caps.MaxConvertedValue, caps.MinConvertedValue);
+
+ for (i = 1; i < caps.NumGammaControlPoints; i++)
+ {
+ ok(caps.ControlPointPositions[i] > caps.ControlPointPositions[i-1],
+ "Expected control point positions to be strictly monotonically increasing (%f > %f).\n",
+ caps.ControlPointPositions[i], caps.ControlPointPositions[i-1]);
+ }
+
+ hr = IDXGIOutput_GetGammaControl(output, &gamma);
+ ok(hr == S_OK, "Expected S_OK, got %#x.\n", hr);
+ hr = IDXGIOutput_SetGammaControl(output, &gamma);
+ ok(hr == S_OK, "Expected S_OK, got %#x.\n", hr);
+
+ IDXGIOutput_Release(output);
+ }
+ else
+ skip("Failed to get output, skipping gamma test.\n");
+
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
refcount = IDXGISwapChain_Release(swapchain);
--
2.18.0

View File

@@ -1 +0,0 @@
Fixes: [43584] Implement DXGI GammaControl methods

Some files were not shown because too many files have changed in this diff Show More