Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH 0/1] MR279: d3drm: IDirect3DRMMeshBuilder3 Optimize fake success
by Alistair Leslie-Hughes (ï¼ alesliehughes)
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/279
June 20, 2022
Re: [PATCH v3 1/6] comctl32/tests: Expand ownerdata listview tests.
by Angelo Haller
On 18/06/2022 21.34, Zhiyi Zhang wrote:
>
> On 6/19/22 01:24, Angelo Haller wrote:
>> On 17/06/2022 22.37, Marvin wrote:
>>> Hi,
>>>
>>> It looks like your patch introduced the new failures shown below.
>>> Please investigate and fix them before resubmitting your patch.
>>> If they are not new, fixing them anyway would help a lot. Otherwise
>>> please ask for the known failures list to be updated.
>>>
>>> The full results can be found at:
>>> https://testbot.winehq.org/JobDetails.pl?Key=117220
>>>
>>> Your paranoid android.
>>>
>>>
>>> === debian11 (32 bit report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit Arabic:Morocco report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit German report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit French report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit Hebrew:Israel report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit Hindi:India report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit Japanese:Japan report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit Chinese:China report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (32 bit WoW report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37148 bytes)
>>>
>>> === debian11 (64 bit WoW report) ===
>>>
>>> Report validation errors:
>>> comctl32:listview prints too much data (37388 bytes)
>> Is there anything I can or need to do about this? These seem like false positives.
>>
>>
> Currently TestBots have a 32k log size limit. Try to reduce the log messages a bit. You can submit your tests at https://testbot.winehq.org/ before submitting to the wine-devel mailing list
I see. How can I reduce log messages though? Short of removing tests?
As can be seen in the series, the test do start to succeed as of patch
5/6. So the failure is only introduced due to wine_todo sequences being
logged to the terminal. I am not generating any additional log messages.
June 19, 2022
Re: [PATCH 0/1] MR277: cmd: Handle lines with just spaces in bracket blocks.
by Bernhard Übelacker
Hello Eric, thanks for looking at it and sorry, I was not aware that there was already a patch submitted for this issue.
Could you please give some more details about this EOF handling? When WCMD_fgets returns NULL for EOF the loop is left by the break in line [2309](https://gitlab.winehq.org/wine/wine/-/blob/master/programs/cmd/wcmdma…
About the consecutive lines, those testbot runs [117281](https://testbot.winehq.org/JobDetails.pl?Key=117281) [117271](https://testbot.winehq.org/JobDetails.pl?Key=117271) have them, so I currently do not see an issue there, with both of our attempts to solve it?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/277#note_2328
June 19, 2022
[PATCH 9/9] d2d1/effect: Move effect instance creation to the device context.
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Creating new effects from effect context does not reuse calling context.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/device.c | 23 ++++++++++++++++++++---
dlls/d2d1/effect.c | 18 ++----------------
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 62eb98a94a1..be7b8f9f8e2 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -1947,18 +1947,35 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceCont
{
struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
struct d2d_effect_context *effect_context;
+ struct d2d_effect *object;
HRESULT hr;
- FIXME("iface %p, effect_id %s, effect %p stub!\n", iface, debugstr_guid(effect_id), effect);
+ TRACE("iface %p, effect_id %s, effect %p.\n", iface, debugstr_guid(effect_id), effect);
if (!(effect_context = calloc(1, sizeof(*effect_context))))
return E_OUTOFMEMORY;
d2d_effect_context_init(effect_context, context);
- hr = ID2D1EffectContext_CreateEffect(&effect_context->ID2D1EffectContext_iface, effect_id, effect);
+ if (!(object = calloc(1, sizeof(*object))))
+ {
+ ID2D1EffectContext_Release(&effect_context->ID2D1EffectContext_iface);
+ return E_OUTOFMEMORY;
+ }
+ hr = d2d_effect_init(object, effect_context, effect_id);
ID2D1EffectContext_Release(&effect_context->ID2D1EffectContext_iface);
- return hr;
+ if (FAILED(hr))
+ {
+ WARN("Failed to initialise effect, hr %#lx.\n", hr);
+ free(object);
+ return hr;
+ }
+
+ *effect = &object->ID2D1Effect_iface;
+
+ TRACE("Created effect %p.\n", *effect);
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateGradientStopCollection(
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index 78db9489be9..f5d5494c67a 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -123,25 +123,11 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateEffect(ID2D1EffectCont
REFCLSID clsid, ID2D1Effect **effect)
{
struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
- struct d2d_effect *object;
- HRESULT hr;
TRACE("iface %p, clsid %s, effect %p.\n", iface, debugstr_guid(clsid), effect);
- if (!(object = calloc(1, sizeof(*object))))
- return E_OUTOFMEMORY;
-
- if (FAILED(hr = d2d_effect_init(object, effect_context, clsid)))
- {
- WARN("Failed to initialise effect, hr %#lx.\n", hr);
- free(object);
- return hr;
- }
-
- TRACE("Created effect %p.\n", object);
- *effect = &object->ID2D1Effect_iface;
-
- return S_OK;
+ return ID2D1DeviceContext1_CreateEffect(&effect_context->device_context->ID2D1DeviceContext1_iface,
+ clsid, effect);
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_GetMaximumSupportedFeatureLevel(ID2D1EffectContext *iface,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 8/9] d2d1/effect: Add CheckFeatureSupport().
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/effect.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index d298985c020..78db9489be9 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -359,9 +359,23 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContextFromWicCol
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CheckFeatureSupport(ID2D1EffectContext *iface,
D2D1_FEATURE feature, void *data, UINT32 data_size)
{
- FIXME("iface %p, feature %#x, data %p, data_size %u stub!\n", iface, feature, data, data_size);
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+ D3D11_FEATURE d3d11_feature;
- return E_NOTIMPL;
+ TRACE("iface %p, feature %#x, data %p, data_size %u.\n", iface, feature, data, data_size);
+
+ /* Data structures are compatible. */
+ switch (feature)
+ {
+ case D2D1_FEATURE_DOUBLES: d3d11_feature = D3D11_FEATURE_DOUBLES; break;
+ case D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS: d3d11_feature = D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS; break;
+ default:
+ WARN("Unexpected feature index %d.\n", feature);
+ return E_INVALIDARG;
+ }
+
+ return ID3D11Device1_CheckFeatureSupport(effect_context->device_context->d3d_device,
+ d3d11_feature, data, data_size);
}
static BOOL STDMETHODCALLTYPE d2d_effect_context_IsBufferPrecisionSupported(ID2D1EffectContext *iface,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 7/9] d2d1/effect: Add LoadComputeShader().
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/effect.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index 2da655b00d8..d298985c020 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -247,10 +247,27 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadComputeShader(ID2D1EffectContext *iface,
REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
{
- FIXME("iface %p, shader_id %s, buffer %p, buffer_size %u stub!\n",
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+ ID3D11ComputeShader *shader;
+ HRESULT hr;
+
+ TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
- return E_NOTIMPL;
+ if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
+ return S_OK;
+
+ if (FAILED(hr = ID3D11Device1_CreateComputeShader(effect_context->device_context->d3d_device,
+ buffer, buffer_size, NULL, &shader)))
+ {
+ WARN("Failed to create a compute shader, hr %#lx.\n", hr);
+ return hr;
+ }
+
+ hr = d2d_effect_context_add_shader(effect_context, shader_id, shader);
+ ID3D11ComputeShader_Release(shader);
+
+ return hr;
}
static BOOL STDMETHODCALLTYPE d2d_effect_context_IsShaderLoaded(ID2D1EffectContext *iface, REFGUID shader_id)
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 6/9] d2d1/effect: Add LoadPixelShader().
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/effect.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index 8345a5aa7d7..2da655b00d8 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -195,10 +195,27 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBoundsAdjustmentTransf
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadPixelShader(ID2D1EffectContext *iface,
REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
{
- FIXME("iface %p, shader_id %s, buffer %p, buffer_size %u stub!\n",
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+ ID3D11PixelShader *shader;
+ HRESULT hr;
+
+ TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
- return E_NOTIMPL;
+ if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
+ return S_OK;
+
+ if (FAILED(hr = ID3D11Device1_CreatePixelShader(effect_context->device_context->d3d_device,
+ buffer, buffer_size, NULL, &shader)))
+ {
+ WARN("Failed to create a pixel shader, hr %#lx.\n", hr);
+ return hr;
+ }
+
+ hr = d2d_effect_context_add_shader(effect_context, shader_id, shader);
+ ID3D11PixelShader_Release(shader);
+
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1EffectContext *iface,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 5/9] d2d1/effect: Forward color context methods to corresponding device context.
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/effect.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index fb5e26273f6..8345a5aa7d7 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -291,26 +291,35 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_FindVertexBuffer(ID2D1Effect
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContext(ID2D1EffectContext *iface,
D2D1_COLOR_SPACE space, const BYTE *profile, UINT32 profile_size, ID2D1ColorContext **color_context)
{
- FIXME("iface %p, space %#x, profile %p, profile_size %u, color_context %p stub!\n",
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+
+ TRACE("iface %p, space %#x, profile %p, profile_size %u, color_context %p.\n",
iface, space, profile, profile_size, color_context);
- return E_NOTIMPL;
+ return ID2D1DeviceContext1_CreateColorContext(&effect_context->device_context->ID2D1DeviceContext1_iface,
+ space, profile, profile_size, color_context);
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContextFromFilename(ID2D1EffectContext *iface,
const WCHAR *filename, ID2D1ColorContext **color_context)
{
- FIXME("iface %p, filename %s, color_context %p stub!\n", iface, debugstr_w(filename), color_context);
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
- return E_NOTIMPL;
+ TRACE("iface %p, filename %s, color_context %p.\n", iface, debugstr_w(filename), color_context);
+
+ return ID2D1DeviceContext1_CreateColorContextFromFilename(&effect_context->device_context->ID2D1DeviceContext1_iface,
+ filename, color_context);
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateColorContextFromWicColorContext(ID2D1EffectContext *iface,
IWICColorContext *wic_color_context, ID2D1ColorContext **color_context)
{
- FIXME("iface %p, wic_color_context %p, color_context %p stub!\n", iface, wic_color_context, color_context);
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
- return E_NOTIMPL;
+ TRACE("iface %p, wic_color_context %p, color_context %p.\n", iface, wic_color_context, color_context);
+
+ return ID2D1DeviceContext1_CreateColorContextFromWicColorContext(&effect_context->device_context->ID2D1DeviceContext1_iface,
+ wic_color_context, color_context);
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_CheckFeatureSupport(ID2D1EffectContext *iface,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 4/9] d2d1: Implement UnregisterEffect().
by Ziqing Hui
From: Ziqing Hui <zhui(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/factory.c | 20 ++++++++++++++++++--
dlls/d2d1/tests/d2d1.c | 28 +++++++++++++---------------
2 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index b3875f28209..5c79d1791ff 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -953,9 +953,25 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Facto
static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory3 *iface, REFCLSID effect_id)
{
- FIXME("iface %p, effect_id %s stub!\n", iface, debugstr_guid(effect_id));
+ struct d2d_factory *factory = impl_from_ID2D1Factory3(iface);
+ struct d2d_effect_registration *effect;
- return E_NOTIMPL;
+ TRACE("iface %p, effect_id %s.\n", iface, debugstr_guid(effect_id));
+
+ LIST_FOR_EACH_ENTRY(effect, &factory->effects, struct d2d_effect_registration, entry)
+ {
+ if (IsEqualGUID(effect_id, &effect->id))
+ {
+ if (!--effect->registration_count)
+ {
+ list_remove(&effect->entry);
+ d2d_effect_registration_cleanup(effect);
+ }
+ return S_OK;
+ }
+ }
+
+ return D2DERR_EFFECT_IS_NOT_REGISTERED;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_GetRegisteredEffects(ID2D1Factory3 *iface,
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 752e34bf4da..f1cec1d7a0b 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -10715,7 +10715,7 @@ static void test_effect_register(BOOL d3d11)
winetest_push_context("Test %u", i);
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, test->xml, NULL, 0, effect_impl_create);
- todo_wine_if(test->hr != S_OK)
+ todo_wine_if(i == 5)
ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr);
if (hr == S_OK)
{
@@ -10723,9 +10723,9 @@ static void test_effect_register(BOOL d3d11)
hr = ID2D1DeviceContext_CreateEffect(device_context, &CLSID_TestEffect, &effect);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
if (effect)
ID2D1Effect_Release(effect);
}
@@ -10748,11 +10748,11 @@ static void test_effect_register(BOOL d3d11)
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, test->xml, NULL, 0, effect_impl_create);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
winetest_pop_context();
}
@@ -10787,9 +10787,9 @@ static void test_effect_register(BOOL d3d11)
}
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
/* Register effect with property binding */
for (i = 0; i < ARRAY_SIZE(binding_tests); ++i)
@@ -10799,7 +10799,6 @@ static void test_effect_register(BOOL d3d11)
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect,
test->effect_xml, test->binding, test->binding_count, effect_impl_create);
- todo_wine_if(test->hr != S_OK)
ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr);
ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
@@ -10848,13 +10847,13 @@ static void test_effect_register(BOOL d3d11)
}
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
/* Unregister builtin effect */
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_D2D1Composite);
- todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
release_test_context(&ctx);
}
@@ -10932,7 +10931,6 @@ done:
if (effect)
ID2D1Effect_Release(effect);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
release_test_context(&ctx);
}
@@ -11089,7 +11087,7 @@ static void test_effect_properties(BOOL d3d11)
if (effect)
ID2D1Effect_Release(effect);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
winetest_pop_context();
}
@@ -11182,7 +11180,7 @@ done:
if (effect)
ID2D1Effect_Release(effect);
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
- todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
release_test_context(&ctx);
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 3/9] d2d1: Implement property parsing for RegisterEffectFromStream().
by Ziqing Hui
From: Ziqing Hui <zhui(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/factory.c | 199 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 193 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 4a08a0cf76d..b3875f28209 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -30,6 +30,15 @@ struct d2d_settings d2d_settings =
~0u, /* No ID2D1Factory version limit by default. */
};
+struct d2d_effect_property
+{
+ WCHAR *name;
+ D2D1_PROPERTY_TYPE type;
+ BYTE *value;
+ PD2D1_PROPERTY_SET_FUNCTION set_function;
+ PD2D1_PROPERTY_GET_FUNCTION get_function;
+};
+
struct d2d_effect_registration
{
struct list entry;
@@ -38,10 +47,22 @@ struct d2d_effect_registration
CLSID id;
UINT32 input_count;
+
+ struct d2d_effect_property *properties;
+ size_t property_size;
+ size_t property_count;
};
static void d2d_effect_registration_cleanup(struct d2d_effect_registration *reg)
{
+ size_t i;
+
+ for (i = 0; i < reg->property_count; ++i)
+ {
+ free(reg->properties[i].name);
+ free(reg->properties[i].value);
+ }
+ free(reg->properties);
free(reg);
}
@@ -643,7 +664,146 @@ static HRESULT parse_effect_skip_element(IXmlReader *reader, unsigned int elemen
return hr;
}
-static HRESULT parse_effect_xml(IXmlReader *reader)
+static HRESULT parse_effect_get_attribute(IXmlReader *reader, const WCHAR *name, WCHAR **ret)
+{
+ const WCHAR *value;
+
+ *ret = NULL;
+
+ if (IXmlReader_MoveToAttributeByName(reader, name, NULL) != S_OK)
+ return E_INVALIDARG;
+ if (IXmlReader_GetValue(reader, &value, NULL) != S_OK)
+ return E_INVALIDARG;
+ if (!(*ret = wcsdup(value)))
+ return E_OUTOFMEMORY;
+
+ return S_OK;
+}
+
+static HRESULT parse_effect_get_property_type(IXmlReader *reader, D2D1_PROPERTY_TYPE *type)
+{
+ static const WCHAR *types[] =
+ {
+ L"", /* D2D1_PROPERTY_TYPE_UNKNOWN */
+ L"string", /* D2D1_PROPERTY_TYPE_STRING */
+ L"bool", /* D2D1_PROPERTY_TYPE_BOOL */
+ L"uint32", /* D2D1_PROPERTY_TYPE_UINT32 */
+ L"int32", /* D2D1_PROPERTY_TYPE_INT32 */
+ L"float", /* D2D1_PROPERTY_TYPE_FLOAT */
+ L"vector2", /* D2D1_PROPERTY_TYPE_VECTOR2 */
+ L"vector3", /* D2D1_PROPERTY_TYPE_VECTOR3 */
+ L"vector4", /* D2D1_PROPERTY_TYPE_VECTOR4 */
+ L"blob", /* D2D1_PROPERTY_TYPE_BLOB */
+ L"iunknown", /* D2D1_PROPERTY_TYPE_IUNKNOWN */
+ L"enum", /* D2D1_PROPERTY_TYPE_ENUM */
+ L"array", /* D2D1_PROPERTY_TYPE_ARRAY */
+ L"clsid", /* D2D1_PROPERTY_TYPE_CLSID */
+ L"matrix3x2", /* D2D1_PROPERTY_TYPE_MATRIX_3X2 */
+ L"matrix4x3", /* D2D1_PROPERTY_TYPE_MATRIX_4X3 */
+ L"matrix4x4", /* D2D1_PROPERTY_TYPE_MATRIX_4X4 */
+ L"matrix5x4", /* D2D1_PROPERTY_TYPE_MATRIX_5X4 */
+ L"colorcontext", /* D2D1_PROPERTY_TYPE_COLOR_CONTEXT */
+ };
+ unsigned int i;
+ WCHAR *value;
+ HRESULT hr;
+
+ if (FAILED(hr = parse_effect_get_attribute(reader, L"type", &value))) return hr;
+
+ *type = D2D1_PROPERTY_TYPE_UNKNOWN;
+
+ for (i = 0; i < ARRAY_SIZE(types); ++i)
+ {
+ if (!wcscmp(value, types[i]))
+ {
+ *type = i;
+ break;
+ }
+ }
+
+ free(value);
+
+ return *type == D2D1_PROPERTY_TYPE_UNKNOWN ? E_INVALIDARG : S_OK;
+}
+
+static struct d2d_effect_property * parse_effect_get_property(const struct d2d_effect_registration *effect,
+ const WCHAR *name)
+{
+ unsigned int i;
+
+ for (i = 0; i < effect->property_count; ++i)
+ {
+ if (!wcscmp(name, effect->properties[i].name))
+ return &effect->properties[i];
+ }
+
+ return NULL;
+}
+
+static HRESULT parse_effect_add_property(struct d2d_effect_registration *effect, WCHAR *name,
+ D2D1_PROPERTY_TYPE type, BYTE *value)
+{
+ struct d2d_effect_property *property;
+
+ if (!d2d_array_reserve((void **)&effect->properties, &effect->property_size,
+ effect->property_count + 1, sizeof(*effect->properties)))
+ {
+ return E_OUTOFMEMORY;
+ }
+
+ property = &effect->properties[effect->property_count++];
+ property->name = name;
+ property->type = type;
+ property->value = value;
+ property->set_function = NULL;
+ property->get_function = NULL;
+
+ return S_OK;
+}
+
+static HRESULT parse_effect_property(IXmlReader *reader, struct d2d_effect_registration *effect)
+{
+ WCHAR *name = NULL, *value = NULL;
+ D2D1_PROPERTY_TYPE type;
+ unsigned int depth;
+ HRESULT hr;
+
+ if (FAILED(hr = parse_effect_get_attribute(reader, L"name", &name)))
+ return hr;
+
+ if (FAILED(hr = parse_effect_get_property_type(reader, &type)))
+ {
+ free(name);
+ return hr;
+ }
+
+ /* Check for duplicates. */
+ if (parse_effect_get_property(effect, name))
+ hr = E_INVALIDARG;
+
+ parse_effect_get_attribute(reader, L"value", &value);
+
+ if (SUCCEEDED(hr))
+ {
+ /* FIXME: sub properties are ignored */
+ IXmlReader_MoveToElement(reader);
+ IXmlReader_GetDepth(reader, &depth);
+ hr = parse_effect_skip_element(reader, depth);
+ }
+
+ if (SUCCEEDED(hr))
+ hr = parse_effect_add_property(effect, name, type, (BYTE *)value);
+
+ if (FAILED(hr))
+ {
+ free(value);
+ free(name);
+ }
+
+ return hr;
+}
+
+static HRESULT parse_effect_xml(IXmlReader *reader, struct d2d_effect_registration *effect)
{
const WCHAR *node_name;
XmlNodeType node_type;
@@ -666,11 +826,10 @@ static HRESULT parse_effect_xml(IXmlReader *reader)
if (FAILED(hr = IXmlReader_GetLocalName(reader, &node_name, NULL))) return hr;
if (node_type == XmlNodeType_EndElement) break;
- if (!wcscmp(node_name, L"Property")
- || !wcscmp(node_name, L"Inputs"))
- {
+ if (!wcscmp(node_name, L"Property"))
+ hr = parse_effect_property(reader, effect);
+ else if (!wcscmp(node_name, L"Inputs"))
hr = parse_effect_skip_element(reader, depth);
- }
else
{
WARN("Unexpected element %s.\n", debugstr_w(node_name));
@@ -691,6 +850,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto
struct d2d_factory *factory = impl_from_ID2D1Factory3(iface);
struct d2d_effect_registration *effect;
IXmlReader *reader;
+ unsigned int i;
HRESULT hr;
TRACE("iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p.\n",
@@ -720,7 +880,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto
return E_OUTOFMEMORY;
}
- hr = parse_effect_xml(reader);
+ hr = parse_effect_xml(reader, effect);
IXmlReader_Release(reader);
if (FAILED(hr))
{
@@ -729,6 +889,33 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto
return hr;
}
+ /* Check required properties. */
+ if (!parse_effect_get_property(effect, L"DisplayName")
+ || !parse_effect_get_property(effect, L"Author")
+ || !parse_effect_get_property(effect, L"Category")
+ || !parse_effect_get_property(effect, L"Description"))
+ {
+ WARN("Missing required properties.\n");
+ d2d_effect_registration_cleanup(effect);
+ return E_INVALIDARG;
+ }
+
+ /* Bind getter and setter. */
+ for (i = 0; i < binding_count; ++i)
+ {
+ struct d2d_effect_property *property;
+
+ if (!(property = parse_effect_get_property(effect, bindings[i].propertyName)))
+ {
+ WARN("Failed to bind to missing property.\n");
+ d2d_effect_registration_cleanup(effect);
+ return D2DERR_INVALID_PROPERTY;
+ }
+
+ property->get_function = bindings[i].getFunction;
+ property->set_function = bindings[i].setFunction;
+ }
+
effect->registration_count = 1;
effect->id = *effect_id;
effect->factory = effect_factory;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022