mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 06:06:13 +00:00
d2d1/tests: Test registering effect multiple times with different binding.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a95433d685
commit
3b4e112c17
1 changed files with 49 additions and 2 deletions
|
@ -10437,7 +10437,7 @@ static HRESULT STDMETHODCALLTYPE effect_impl_create(IUnknown **effect_impl)
|
|||
|
||||
object->ID2D1EffectImpl_iface.lpVtbl = &effect_impl_vtbl;
|
||||
object->refcount = 1;
|
||||
object->integer = 0;
|
||||
object->integer = 10;
|
||||
object->effect_context = NULL;
|
||||
|
||||
*effect_impl = (IUnknown *)&object->ID2D1EffectImpl_iface;
|
||||
|
@ -10489,11 +10489,12 @@ static HRESULT STDMETHODCALLTYPE effect_impl_get_context(const IUnknown *iface,
|
|||
static void test_effect_register(BOOL d3d11)
|
||||
{
|
||||
ID2D1DeviceContext *device_context;
|
||||
ID2D1EffectContext *effect_context;
|
||||
struct d2d1_test_context ctx;
|
||||
unsigned int i, integer;
|
||||
ID2D1Factory1 *factory;
|
||||
WCHAR display_name[64];
|
||||
ID2D1Effect *effect;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
const D2D1_PROPERTY_BINDING binding[] =
|
||||
|
@ -10613,6 +10614,52 @@ static void test_effect_register(BOOL d3d11)
|
|||
winetest_pop_context();
|
||||
}
|
||||
|
||||
/* Register effect multiple times with different binding */
|
||||
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect,
|
||||
effect_xml_c, binding, 1, effect_impl_create);
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
hr = ID2D1DeviceContext_CreateEffect(device_context, &CLSID_TestEffect, &effect);
|
||||
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
integer = 0xdeadbeef;
|
||||
effect_context = (ID2D1EffectContext *)0xdeadbeef;
|
||||
hr = ID2D1Effect_GetValueByName(effect, L"Integer",
|
||||
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer));
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
hr = ID2D1Effect_GetValueByName(effect, L"Context",
|
||||
D2D1_PROPERTY_TYPE_IUNKNOWN, (BYTE *)&effect_context, sizeof(effect_context));
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
ok(integer == 10, "Got unexpected integer %u.\n", integer);
|
||||
ok(effect_context == NULL, "Got unexpected effect context %p.\n", effect_context);
|
||||
ID2D1Effect_Release(effect);
|
||||
}
|
||||
|
||||
hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect,
|
||||
effect_xml_c, binding + 1, 1, effect_impl_create);
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
hr = ID2D1DeviceContext_CreateEffect(device_context, &CLSID_TestEffect, &effect);
|
||||
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
integer = 0xdeadbeef;
|
||||
effect_context = (ID2D1EffectContext *)0xdeadbeef;
|
||||
hr = ID2D1Effect_GetValueByName(effect, L"Integer",
|
||||
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&integer, sizeof(integer));
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
hr = ID2D1Effect_GetValueByName(effect, L"Context",
|
||||
D2D1_PROPERTY_TYPE_IUNKNOWN, (BYTE *)&effect_context, sizeof(effect_context));
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
ok(integer == 10, "Got unexpected integer %u.\n", integer);
|
||||
ok(effect_context == NULL, "Got unexpected effect context %p.\n", effect_context);
|
||||
ID2D1Effect_Release(effect);
|
||||
}
|
||||
|
||||
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
|
||||
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);
|
||||
|
||||
/* Unregister builtin effect */
|
||||
hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_D2D1Composite);
|
||||
todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
|
||||
|
|
Loading…
Reference in a new issue