Module: wine Branch: master Commit: 4bb4469e43b3de442064feea68a898c11f3ff0d3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=4bb4469e43b3de442064feea6...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sun Jun 26 23:47:10 2022 +0300
d2d1/effect: Mark custom properties as writable.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
---
dlls/d2d1/effect.c | 9 ++++----- dlls/d2d1/tests/d2d1.c | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index 72ee5dd5fb1..9085981b733 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -89,15 +89,14 @@ HRESULT d2d_effect_properties_add(struct d2d_effect_properties *props, const WCH
p = &props->properties[props->count++]; p->index = index; - if (p->index < 0x80000000) props->custom_count++; - - if (index == D2D1_PROPERTY_CACHED - || index == D2D1_PROPERTY_PRECISION) + if (p->index < 0x80000000) { + props->custom_count++; + /* FIXME: this should probably be controller by subproperty */ p->readonly = FALSE; } else - p->readonly = TRUE; + p->readonly = index != D2D1_PROPERTY_CACHED && index != D2D1_PROPERTY_PRECISION; p->name = wcsdup(name); p->type = type; if (p->type == D2D1_PROPERTY_TYPE_STRING) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 3f152c5c2b8..9e64b1354c4 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11119,6 +11119,7 @@ static void test_effect_properties(BOOL d3d11) "Got unexpected effect context %p.\n", effect_context);
hr = ID2D1Effect_SetValue(effect, 0, D2D1_PROPERTY_TYPE_IUNKNOWN, (BYTE *)&effect_context, sizeof(effect_context)); + todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
integer = 0xdeadbeef; @@ -11135,7 +11136,6 @@ static void test_effect_properties(BOOL d3d11)
integer = 20; hr = ID2D1Effect_SetValue(effect, 1, D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer)); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); integer = 0xdeadbeef; hr = ID2D1Effect_GetValue(effect, 1, D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer)); @@ -11173,8 +11173,10 @@ static void test_effect_properties(BOOL d3d11) ok(integer == 0, "Got unexpected integer %u.", integer);
hr = ID2D1Effect_SetValue(effect, 0, D2D1_PROPERTY_TYPE_IUNKNOWN, (BYTE *)&effect_context, sizeof(effect_context)); + todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); hr = ID2D1Effect_SetValue(effect, 1, D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer)); + todo_wine ok(hr == E_INVALIDARG || broken(hr == S_OK) /* win8 */, "Got unexpected hr %#lx.\n", hr);
ID2D1Effect_Release(effect);