Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index e60128b38f2..f0f6e054047 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -9678,6 +9678,54 @@ static void test_mt_factory(BOOL d3d11) ID2D1Factory_Release(factory); }
+static void test_effect(BOOL d3d11) +{ + ID2D1Image *image_a = NULL, *image_b = NULL; + ID2D1DeviceContext *context = NULL; + ID2D1Factory1 *factory = NULL; + struct d2d1_test_context ctx; + ID2D1Effect *effect = NULL; + HRESULT hr; + + if (!init_test_context(&ctx, d3d11)) + return; + + if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) + { + win_skip("ID2D1Factory1 is not supported.\n"); + goto end; + } + + hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context); + ok(hr == S_OK, "Failed to get device context interface, hr %#x.\n", hr); + + hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D12DAffineTransform, &effect); + ok(hr == S_OK, "Failed to create effect, hr %#x.\n", hr); + + hr = ID2D1Effect_QueryInterface(effect, &IID_ID2D1Image, (void **)&image_a); + todo_wine + ok(hr == S_OK, "Failed to get image interface, hr %#x.\n", hr); + if (hr != S_OK) + goto end; + + ID2D1Effect_GetOutput(effect, &image_b); + todo_wine + ok(image_a == image_b, "Image interface mismatch.\n"); + +end: + if (image_b) + ID2D1Image_Release(image_b); + if (image_a) + ID2D1Image_Release(image_a); + if (effect) + ID2D1Effect_Release(effect); + if (context) + ID2D1DeviceContext_Release(context); + if (factory) + ID2D1Factory1_Release(factory); + release_test_context(&ctx); +} + START_TEST(d2d1) { HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll"); @@ -9739,6 +9787,7 @@ START_TEST(d2d1) queue_d3d10_test(test_colour_space); queue_test(test_geometry_group); queue_test(test_mt_factory); + queue_test(test_effect);
run_queued_tests(); }