From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/effect.c | 21 +++++++++++++++++++++ dlls/d2d1/tests/d2d1.c | 20 ++++++++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index 8e7ee8fda64..29e50358717 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -1094,6 +1094,21 @@ L"<?xml version='1.0'?> \ </Inputs> \ </Effect>";
+static const WCHAR gaussian_blur_description[] = +L"<?xml version='1.0'?> \ + <Effect> \ + <Property name='DisplayName' type='string' value='Gaussian Blur'/> \ + <Property name='Author' type='string' value='The Wine Project'/> \ + <Property name='Category' type='string' value='Stub'/> \ + <Property name='Description' type='string' value='Gaussian Blur'/> \ + <Inputs> \ + <Input name='Source'/> \ + </Inputs> \ + <Property name='StandardDeviation' type='float' /> \ + <Property name='Optimization' type='enum' /> \ + <Property name='BorderMode' type='enum' /> \ + </Effect>"; + void d2d_effects_init_builtins(struct d2d_factory *factory) { static const struct builtin_description @@ -1111,6 +1126,7 @@ void d2d_effects_init_builtins(struct d2d_factory *factory) { &CLSID_D2D1Grayscale, grayscale_description }, { &CLSID_D2D1ColorMatrix, color_matrix_description }, { &CLSID_D2D1Flood, flood_description }, + { &CLSID_D2D1GaussianBlur, gaussian_blur_description }, }; unsigned int i; HRESULT hr; @@ -1240,6 +1256,7 @@ static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties * else { void *src = NULL; + WCHAR *end_ptr; UINT32 _uint32; float _vec[20]; CLSID _clsid; @@ -1258,6 +1275,10 @@ static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties * _uint32 = wcstoul(value, NULL, 0); src = &_uint32; break; + case D2D1_PROPERTY_TYPE_FLOAT: + _vec[0] = wcstof(value, &end_ptr); + src = &_vec[0]; + break; case D2D1_PROPERTY_TYPE_ENUM: _uint32 = wcstoul(value, NULL, 10); src = &_uint32; diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index c1d9e78787c..dc1cdad3a71 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11564,6 +11564,7 @@ static void test_builtin_effect(BOOL d3d11) {&CLSID_D2D1Grayscale, 3, 1, 1, 1}, {&CLSID_D2D1ColorMatrix, 1, 1, 1, 1}, {&CLSID_D2D1Flood, 1, 0, 0, 0}, + {&CLSID_D2D1GaussianBlur, 1, 1, 1, 1}, };
if (!init_test_context(&ctx, d3d11)) @@ -13345,6 +13346,7 @@ static void test_effect_gaussian_blur(BOOL d3d11) }; struct d2d1_test_context ctx; ID2D1DeviceContext *context; + ID2D1Properties *subprops; unsigned int count, i; ID2D1Effect *effect; WCHAR name[64]; @@ -13358,13 +13360,7 @@ static void test_effect_gaussian_blur(BOOL d3d11) context = ctx.context;
hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D1GaussianBlur, &effect); - todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - if (hr != S_OK) - { - release_test_context(&ctx); - return; - }
check_system_properties(effect);
@@ -13376,12 +13372,24 @@ static void test_effect_gaussian_blur(BOOL d3d11) hr = ID2D1Effect_GetPropertyName(effect, properties[i].index, name, 64); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!wcscmp(name, properties[i].name), "Unexpected name %s.\n", wine_dbgstr_w(name)); + + hr = ID2D1Effect_GetSubProperties(effect, properties[i].index, &subprops); + todo_wine + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + count = ID2D1Properties_GetPropertyCount(subprops); + ok(!count, "Got unexpected property count %u.\n", count); + ID2D1Properties_Release(subprops); + } }
f = effect_get_float_prop(effect, D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION); + todo_wine ok(f == 3.0f, "Unexpected value %.8e.\n", f);
v = effect_get_enum_prop(effect, D2D1_GAUSSIANBLUR_PROP_OPTIMIZATION); + todo_wine ok(v == D2D1_GAUSSIANBLUR_OPTIMIZATION_BALANCED, "Unexpected value %u.\n", v);
v = effect_get_enum_prop(effect, D2D1_GAUSSIANBLUR_PROP_BORDER_MODE);