Signed-off-by: Ziqing Hui zhui@codeweavers.com --- include/d2d1effects.idl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/include/d2d1effects.idl b/include/d2d1effects.idl index ee1dbe94728..5dde46cbb6a 100644 --- a/include/d2d1effects.idl +++ b/include/d2d1effects.idl @@ -16,7 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") +cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") +cpp_quote("DEFINE_GUID(CLSID_D2D13DPerspectiveTransform, 0xc2844d0b,0x3d86,0x46e7,0x85,0xba,0x52,0x6c,0x92,0x40,0xf3,0xfb);")
typedef enum D2D1_BORDER_MODE { @@ -44,3 +45,26 @@ typedef enum D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 0x5, D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff } D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE; + +typedef enum D2D1_3DPERSPECTIVETRANSFORM_PROP +{ + D2D1_3DPERSPECTIVETRANSFORM_PROP_INTERPOLATION_MODE = 0x0, + D2D1_3DPERSPECTIVETRANSFORM_PROP_BORDER_MODE = 0x1, + D2D1_3DPERSPECTIVETRANSFORM_PROP_DEPTH = 0x2, + D2D1_3DPERSPECTIVETRANSFORM_PROP_PERSPECTIVE_ORIGIN = 0x3, + D2D1_3DPERSPECTIVETRANSFORM_PROP_LOCAL_OFFSET = 0x4, + D2D1_3DPERSPECTIVETRANSFORM_PROP_GLOBAL_OFFSET = 0x5, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION_ORIGIN = 0x6, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION = 0x7, + D2D1_3DPERSPECTIVETRANSFORM_PROP_FORCE_DWORD = 0xffffffff +} D2D1_3DPERSPECTIVETRANSFORM_PROP; + +typedef enum D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE +{ + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0x0, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_LINEAR = 0x1, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_CUBIC = 0x2, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 0x3, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 0x4, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff +} D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE;
Signed-off-by: Ziqing Hui zhui@codeweavers.com --- include/d2d1effects.idl | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/include/d2d1effects.idl b/include/d2d1effects.idl index 5dde46cbb6a..4154276345b 100644 --- a/include/d2d1effects.idl +++ b/include/d2d1effects.idl @@ -18,6 +18,7 @@
cpp_quote("DEFINE_GUID(CLSID_D2D12DAffineTransform, 0x6aa97485,0x6354,0x4cfc,0x90,0x8c,0xe4,0xa7,0x4f,0x62,0xc9,0x6c);") cpp_quote("DEFINE_GUID(CLSID_D2D13DPerspectiveTransform, 0xc2844d0b,0x3d86,0x46e7,0x85,0xba,0x52,0x6c,0x92,0x40,0xf3,0xfb);") +cpp_quote("DEFINE_GUID(CLSID_D2D1Composite, 0x48fc9f51,0xf6ac,0x48f1,0x8b,0x58,0x3b,0x28,0xac,0x46,0xf7,0x6d);")
typedef enum D2D1_BORDER_MODE { @@ -68,3 +69,9 @@ typedef enum D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 0x4, D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff } D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE; + +typedef enum D2D1_COMPOSITE_PROP +{ + D2D1_COMPOSITE_PROP_MODE = 0x0, + D2D1_COMPOSITE_PROP_FORCE_DWORD = 0xffffffff +} D2D1_COMPOSITE_PROP;
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 22/07/21 02:44, Ziqing Hui ha scritto:
Signed-off-by: Ziqing Huizhui@codeweavers.com
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Ziqing Hui zhui@codeweavers.com ---
v2: Remove checks for string properties.
dlls/d2d1/tests/d2d1.c | 81 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 9 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 1ee4941da99..72487692abf 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -9680,13 +9680,30 @@ static void test_mt_factory(BOOL d3d11)
static void test_effect(BOOL d3d11) { + unsigned int i, min_inputs, max_inputs; + D2D1_BUFFER_PRECISION precision; ID2D1Image *image_a, *image_b; struct d2d1_test_context ctx; ID2D1DeviceContext *context; ID2D1Factory1 *factory; ID2D1Effect *effect; + BOOL cached; + CLSID clsid; HRESULT hr;
+ const struct effect_test + { + const CLSID *clsid; + UINT32 min_inputs; + UINT32 max_inputs; + } + effect_tests[] = + { + {&CLSID_D2D12DAffineTransform, 1, 1}, + {&CLSID_D2D13DPerspectiveTransform, 1, 1}, + {&CLSID_D2D1Composite, 1, 0xffffffff}, + }; + if (!init_test_context(&ctx, d3d11)) return;
@@ -9699,17 +9716,63 @@ static void test_effect(BOOL d3d11)
hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&context); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - hr = ID2D1DeviceContext_CreateEffect(context, &CLSID_D2D12DAffineTransform, &effect); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
- hr = ID2D1Effect_QueryInterface(effect, &IID_ID2D1Image, (void **)&image_a); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - ID2D1Effect_GetOutput(effect, &image_b); - ok(image_b == image_a, "Got unexpected image_b %p, expected %p.\n", image_b, image_a); - ID2D1Image_Release(image_b); - ID2D1Image_Release(image_a); + for (i = 0; i < ARRAY_SIZE(effect_tests); ++i) + { + const struct effect_test *test = effect_tests + i; + + winetest_push_context("Test %u", i); + + hr = ID2D1DeviceContext_CreateEffect(context, test->clsid, &effect); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = ID2D1Effect_QueryInterface(effect, &IID_ID2D1Image, (void **)&image_a); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ID2D1Effect_GetOutput(effect, &image_b); + ok(image_b == image_a, "Got unexpected image_b %p, expected %p.\n", image_b, image_a); + ID2D1Image_Release(image_b); + ID2D1Image_Release(image_a); + + todo_wine + { + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID, + D2D1_PROPERTY_TYPE_CLSID, (BYTE *)&clsid, sizeof(clsid)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + ok(IsEqualGUID(&clsid, test->clsid), "Got unexpected clsid %s, expected %s.\n", + debugstr_guid(&clsid), debugstr_guid(test->clsid)); + + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CACHED, + D2D1_PROPERTY_TYPE_BOOL, (BYTE *)&cached, sizeof(cached)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + ok(cached == FALSE, "Got unexpected cached %d.\n", cached); + + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_PRECISION, + D2D1_PROPERTY_TYPE_ENUM, (BYTE *)&precision, sizeof(precision)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + ok(precision == D2D1_BUFFER_PRECISION_UNKNOWN, "Got unexpected precision %u.\n", precision); + + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MIN_INPUTS, + D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&min_inputs, sizeof(min_inputs)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + ok(min_inputs == test->min_inputs, "Got unexpected min inputs %u, expected %u.\n", + min_inputs, test->min_inputs); + + hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MAX_INPUTS, + D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&max_inputs, sizeof(max_inputs)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + ok(max_inputs == test->max_inputs, "Got unexpected max inputs %u, expected %u.\n", + max_inputs, test->max_inputs); + } + + ID2D1Effect_Release(effect); + winetest_pop_context(); + }
- ID2D1Effect_Release(effect); ID2D1DeviceContext_Release(context); ID2D1Factory1_Release(factory); release_test_context(&ctx);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94356
Your paranoid android.
=== debiant2 (32 bit Japanese:Japan report) ===
Report validation errors: d2d1:d2d1 is missing some skip messages
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 22/07/21 02:44, Ziqing Hui ha scritto:
Signed-off-by: Ziqing Huizhui@codeweavers.com
On Thu, 22 Jul 2021 at 02:45, Ziqing Hui zhui@codeweavers.com wrote:
todo_wine
{
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID,
D2D1_PROPERTY_TYPE_CLSID, (BYTE *)&clsid, sizeof(clsid));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(IsEqualGUID(&clsid, test->clsid), "Got unexpected clsid %s, expected %s.\n",
debugstr_guid(&clsid), debugstr_guid(test->clsid));
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CACHED,
D2D1_PROPERTY_TYPE_BOOL, (BYTE *)&cached, sizeof(cached));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(cached == FALSE, "Got unexpected cached %d.\n", cached);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_PRECISION,
D2D1_PROPERTY_TYPE_ENUM, (BYTE *)&precision, sizeof(precision));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(precision == D2D1_BUFFER_PRECISION_UNKNOWN, "Got unexpected precision %u.\n", precision);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MIN_INPUTS,
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&min_inputs, sizeof(min_inputs));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(min_inputs == test->min_inputs, "Got unexpected min inputs %u, expected %u.\n",
min_inputs, test->min_inputs);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MAX_INPUTS,
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&max_inputs, sizeof(max_inputs));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(max_inputs == test->max_inputs, "Got unexpected max inputs %u, expected %u.\n",
max_inputs, test->max_inputs);
}
This has come up before, but if you're essentially asserting that a particular variable has a particular value using ok() (i.e., "ok(hr == S_OK, ...);"), there's then no point in attempting to handle cases where that variable would have a different value.
On 7/22/21 8:49 PM, Henri Verbeet wrote:
On Thu, 22 Jul 2021 at 02:45, Ziqing Hui zhui@codeweavers.com wrote:
todo_wine
{
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CLSID,
D2D1_PROPERTY_TYPE_CLSID, (BYTE *)&clsid, sizeof(clsid));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(IsEqualGUID(&clsid, test->clsid), "Got unexpected clsid %s, expected %s.\n",
debugstr_guid(&clsid), debugstr_guid(test->clsid));
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_CACHED,
D2D1_PROPERTY_TYPE_BOOL, (BYTE *)&cached, sizeof(cached));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(cached == FALSE, "Got unexpected cached %d.\n", cached);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_PRECISION,
D2D1_PROPERTY_TYPE_ENUM, (BYTE *)&precision, sizeof(precision));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(precision == D2D1_BUFFER_PRECISION_UNKNOWN, "Got unexpected precision %u.\n", precision);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MIN_INPUTS,
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&min_inputs, sizeof(min_inputs));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(min_inputs == test->min_inputs, "Got unexpected min inputs %u, expected %u.\n",
min_inputs, test->min_inputs);
hr = ID2D1Effect_GetValue(effect, D2D1_PROPERTY_MAX_INPUTS,
D2D1_PROPERTY_TYPE_UINT32, (BYTE *)&max_inputs, sizeof(max_inputs));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
ok(max_inputs == test->max_inputs, "Got unexpected max inputs %u, expected %u.\n",
max_inputs, test->max_inputs);
}
This has come up before, but if you're essentially asserting that a particular variable has a particular value using ok() (i.e., "ok(hr == S_OK, ...);"), there's then no point in attempting to handle cases where that variable would have a different value.
The reason I check the "hr" is that we have a todo_wine here, which means that
the "hr" would have a different value when running the tests on wine.
Once we implemented it in wine, then we can remove the "todo_wine", also remove
the "if (hr == S_OK)".
What do you think, Henri? Should we remove the "if (hr == S_OK)"
in this patch right now or remove them after implementing ID2D1Effect_GetValue()?
On Thu, 22 Jul 2021 at 18:20, Ziqing Hui zhui@codeweavers.com wrote:
The reason I check the "hr" is that we have a todo_wine here, which means that
the "hr" would have a different value when running the tests on wine.
Oh, right. Yes, in that case this is ok, my bad.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 22/07/21 02:44, Ziqing Hui ha scritto:
Signed-off-by: Ziqing Huizhui@codeweavers.com
(sorry, Ziqing, I replied to you directly by mistake)