Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d2d1/d2d1_private.h | 13 +++++++++++++ dlls/d2d1/effect.c | 24 +++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 1cca943122e..f4bc1ab2011 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -565,6 +565,13 @@ struct d2d_device
void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device) DECLSPEC_HIDDEN;
+struct d2d_property +{ + D2D1_PROPERTY_TYPE type; + void *value; + UINT32 value_size; +}; + struct d2d_effect { ID2D1Effect ID2D1Effect_iface; @@ -572,6 +579,12 @@ struct d2d_effect LONG refcount;
ID2D1Factory *factory; + CLSID clsid; + BOOL cached; + UINT min_inputs; + UINT max_inputs; + D2D1_BUFFER_PRECISION precision; + struct d2d_property standard_properties[10]; };
void d2d_effect_init(struct d2d_effect *effect, ID2D1Factory *factory, const CLSID *effect_id) DECLSPEC_HIDDEN; diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index c9d8085f81a..2d70ec84f6a 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -294,9 +294,31 @@ static const ID2D1ImageVtbl d2d_effect_image_vtbl = d2d_effect_image_GetFactory, };
+static void d2d_property_set(struct d2d_property *property, D2D1_PROPERTY_TYPE type, void *value, UINT32 value_size) +{ + property->type = type; + property->value = value; + property->value_size = value_size; +} + static void d2d_effect_init_standard_properties(struct d2d_effect *effect, const struct d2d_effect_info *info) { - /* TODO */ + effect->clsid = *info->clsid; + effect->cached = info->cached; + effect->precision = info->precision; + effect->min_inputs = info->min_inputs; + effect->max_inputs = info->max_inputs; + + d2d_property_set(effect->standard_properties + D2D1_PROPERTY_CLSID - D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_CLSID, &effect->clsid, sizeof(effect->clsid)); + d2d_property_set(effect->standard_properties + D2D1_PROPERTY_CACHED - D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_BOOL, &effect->cached, sizeof(effect->cached)); + d2d_property_set(effect->standard_properties + D2D1_PROPERTY_PRECISION - D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_ENUM, &effect->precision, sizeof(effect->precision)); + d2d_property_set(effect->standard_properties + D2D1_PROPERTY_MIN_INPUTS - D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_UINT32, &effect->min_inputs, sizeof(effect->min_inputs)); + d2d_property_set(effect->standard_properties + D2D1_PROPERTY_MAX_INPUTS - D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_UINT32, &effect->max_inputs, sizeof(effect->max_inputs)); }
void d2d_effect_init(struct d2d_effect *effect, ID2D1Factory *factory, const CLSID *effect_id)