Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 7 participants
- 84546 discussions
[PATCH vkd3d v2 4/8] tests: Test complex initializers for numeric types.
by Francisco Casas Jan. 21, 2022
by Francisco Casas Jan. 21, 2022
Jan. 21, 2022
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
Makefile.am | 2 ++
tests/hlsl-initializer-numeric.shader_test | 35 ++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100644 tests/hlsl-initializer-numeric.shader_test
diff --git a/Makefile.am b/Makefile.am
index 23887367..ef32711c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,6 +70,7 @@ vkd3d_shader_tests = \
tests/hlsl-function-overload.shader_test \
tests/hlsl-initializer-invalid-n-args.shader_test \
tests/hlsl-initializer-local-array.shader_test \
+ tests/hlsl-initializer-numeric.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
tests/hlsl-intrinsic-override.shader_test \
@@ -295,6 +296,7 @@ XFAIL_TESTS = \
tests/hlsl-array-dimension.shader_test \
tests/hlsl-initializer-invalid-n-args.shader_test \
tests/hlsl-initializer-local-array.shader_test \
+ tests/hlsl-initializer-numeric.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
tests/hlsl-bool-cast.shader_test \
diff --git a/tests/hlsl-initializer-numeric.shader_test b/tests/hlsl-initializer-numeric.shader_test
new file mode 100644
index 00000000..2fce3909
--- /dev/null
+++ b/tests/hlsl-initializer-numeric.shader_test
@@ -0,0 +1,35 @@
+[pixel shader]
+float4 main() : sv_target
+{
+ int4 aa = {1, 2, 3, 4};
+ return aa;
+}
+
+[test]
+draw quad
+probe all rgba (1.0, 2.0, 3.0, 4.0) 4
+
+
+[pixel shader]
+float4 main() : sv_target
+{
+ float4 aa = {1, 2, 3, 4};
+ return aa;
+}
+
+[test]
+draw quad
+probe all rgba (1.0, 2.0, 3.0, 4.0) 4
+
+
+[pixel shader]
+float4 main() : sv_target
+{
+ float3 aa = {1, 2, 3};
+ float4 bb = {aa.x, aa.y, aa.z, 4.0};
+ return bb;
+}
+
+[test]
+draw quad
+probe all rgba (1.0, 2.0, 3.0, 4.0) 4
--
2.25.1
3
2
[PATCH vkd3d v2 3/8] tests: Test invalid number of arguments on initializers.
by Francisco Casas Jan. 21, 2022
by Francisco Casas Jan. 21, 2022
Jan. 21, 2022
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
Makefile.am | 2 +
...lsl-initializer-invalid-n-args.shader_test | 95 +++++++++++++++++++
2 files changed, 97 insertions(+)
create mode 100644 tests/hlsl-initializer-invalid-n-args.shader_test
diff --git a/Makefile.am b/Makefile.am
index 051053cd..23887367 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,7 @@ vkd3d_shader_tests = \
tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
tests/hlsl-function-overload.shader_test \
+ tests/hlsl-initializer-invalid-n-args.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
@@ -292,6 +293,7 @@ XFAIL_TESTS = \
tests/cast-to-int.shader_test \
tests/cast-to-uint.shader_test \
tests/hlsl-array-dimension.shader_test \
+ tests/hlsl-initializer-invalid-n-args.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
diff --git a/tests/hlsl-initializer-invalid-n-args.shader_test b/tests/hlsl-initializer-invalid-n-args.shader_test
new file mode 100644
index 00000000..bde6024f
--- /dev/null
+++ b/tests/hlsl-initializer-invalid-n-args.shader_test
@@ -0,0 +1,95 @@
+[pixel shader]
+float4 main() : sv_target
+{
+ float4 color[2][3] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
+ };
+ return color[1][1];
+}
+
+[test]
+draw quad
+probe all rgba (17, 18, 19, 20)
+
+
+[pixel shader fail]
+float4 main() : sv_target
+{
+ float4 color[2][3] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
+ };
+ return color[1][1];
+}
+
+[pixel shader fail]
+float4 main() : sv_target
+{
+ float4 color[2][3] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
+ };
+ return color[1][1];
+}
+
+
+[pixel shader]
+struct stu {
+ struct {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31, 32,
+ };
+ return val.bbb[1].foo;
+}
+
+[test]
+draw quad
+probe all rgba (22, 23, 24, 25)
+
+
+[pixel shader fail]
+struct stu {
+ struct {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31, 32, 33,
+ };
+ return val.bbb[1].foo;
+}
+
+
+[pixel shader fail]
+struct stu {
+ struct {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31,
+ };
+ return val.bbb[1].foo;
+}
--
2.25.1
3
2
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
Makefile.am | 4 ++
.../hlsl-initializer-local-array.shader_test | 35 ++++++++++++++++++
.../hlsl-initializer-static-array.shader_test | 37 +++++++++++++++++++
3 files changed, 76 insertions(+)
create mode 100644 tests/hlsl-initializer-local-array.shader_test
create mode 100644 tests/hlsl-initializer-static-array.shader_test
diff --git a/Makefile.am b/Makefile.am
index a3ec6850..3545d74b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,8 @@ vkd3d_shader_tests = \
tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
tests/hlsl-function-overload.shader_test \
+ tests/hlsl-initializer-local-array.shader_test \
+ tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-intrinsic-override.shader_test \
tests/hlsl-invalid.shader_test \
tests/hlsl-majority-pragma.shader_test \
@@ -289,6 +291,8 @@ XFAIL_TESTS = \
tests/cast-to-int.shader_test \
tests/cast-to-uint.shader_test \
tests/hlsl-array-dimension.shader_test \
+ tests/hlsl-initializer-local-array.shader_test \
+ tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-bool-cast.shader_test \
tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
diff --git a/tests/hlsl-initializer-local-array.shader_test b/tests/hlsl-initializer-local-array.shader_test
new file mode 100644
index 00000000..0862d4c9
--- /dev/null
+++ b/tests/hlsl-initializer-local-array.shader_test
@@ -0,0 +1,35 @@
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float4 array_loc[3] = {
+ 11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34
+ };
+ return array_loc[1];
+}
+
+[test]
+draw quad
+probe all rgba (21, 22, 23, 24)
+
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float4 array_loc[2][4] = {
+ 11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34,
+ 41, 42, 43, 44,
+ 51, 52, 53, 54,
+ 61, 62, 63, 64,
+ 71, 72, 73, 74,
+ 81, 82, 83, 84,
+ };
+ return array_loc[1][2];
+}
+
+[test]
+draw quad
+probe all rgba (71, 72, 73, 74)
diff --git a/tests/hlsl-initializer-static-array.shader_test b/tests/hlsl-initializer-static-array.shader_test
new file mode 100644
index 00000000..57733502
--- /dev/null
+++ b/tests/hlsl-initializer-static-array.shader_test
@@ -0,0 +1,37 @@
+[pixel shader]
+static const float4 array_st[3] = {
+ 11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34
+};
+
+float4 main() : SV_TARGET
+{
+ return array_st[1];
+}
+
+[test]
+draw quad
+probe all rgba (21, 22, 23, 24)
+
+
+[pixel shader]
+static const float4 array_st[4][2] = {
+ 11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34,
+ 41, 42, 43, 44,
+ 51, 52, 53, 54,
+ 61, 62, 63, 64,
+ 71, 72, 73, 74,
+ 81, 82, 83, 84,
+};
+
+float4 main() : SV_TARGET
+{
+ return array_st[2][1];
+}
+
+[test]
+draw quad
+probe all rgba (61, 62, 63, 64)
--
2.25.1
3
2
Jan. 21, 2022
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
v3: Replaced double2 with int2 so that tests are compatible with
ps_4_0.
Signed-off-by: Francisco Casas <fcasas(a)codeweavers.com>
---
Makefile.am | 2 +
tests/hlsl-initializer-struct.shader_test | 77 +++++++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100644 tests/hlsl-initializer-struct.shader_test
diff --git a/Makefile.am b/Makefile.am
index 3545d74b..051053cd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,6 +70,7 @@ vkd3d_shader_tests = \
tests/hlsl-function-overload.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
+ tests/hlsl-initializer-struct.shader_test \
tests/hlsl-intrinsic-override.shader_test \
tests/hlsl-invalid.shader_test \
tests/hlsl-majority-pragma.shader_test \
@@ -293,6 +294,7 @@ XFAIL_TESTS = \
tests/hlsl-array-dimension.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
+ tests/hlsl-initializer-struct.shader_test \
tests/hlsl-bool-cast.shader_test \
tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
diff --git a/tests/hlsl-initializer-struct.shader_test b/tests/hlsl-initializer-struct.shader_test
new file mode 100644
index 00000000..7efb4bb4
--- /dev/null
+++ b/tests/hlsl-initializer-struct.shader_test
@@ -0,0 +1,77 @@
+[pixel shader]
+struct stu {
+ int3 aaa;
+ float3 bbb;
+ int2 ccc;
+ float4 ddd;
+ int eee;
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 11, 12, 13,
+ 21, 22, 23,
+ 31, 32,
+ 41, 42, 43, 44,
+ 51
+ };
+ return val.ddd;
+}
+
+[test]
+draw quad
+probe all rgba (41, 42, 43, 44)
+
+
+[pixel shader]
+struct stu {
+ int3 aaa;
+ float3 bbb[2];
+ int2 ccc;
+ float4 ddd[3][2];
+ int eee;
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 11, 12, 13,
+ 211, 212, 213, 221, 222, 223,
+ 31, 32,
+ 4111, 4112, 4113, 4114, 4121, 4122, 4123, 4124,
+ 4211, 4212, 4213, 4214, 4221, 4222, 4223, 4224,
+ 4311, 4312, 4313, 4314, 4321, 4322, 4323, 4324,
+ 51
+ };
+ return val.ddd[2][0];
+}
+
+[test]
+draw quad
+probe all rgba (4311, 4312, 4313, 4314)
+
+
+[pixel shader]
+struct stu {
+ int3 aaa;
+ struct {
+ float4 foo;
+ int2 bar;
+ } bbb[3];
+};
+
+float4 main() : sv_target
+{
+ struct stu val = {
+ 1, 2, 3,
+ 11, 12, 13, 14, 15, 16,
+ 21, 22, 23, 24, 25, 26,
+ 31, 32, 33, 34, 35, 36
+ };
+ return val.bbb[1].foo;
+}
+
+[test]
+draw quad
+probe all rgba (21, 22, 23, 24)
--
2.25.1
3
3
From: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfmediaengine/main.c | 496 ++++++++++++++++++++++++++++++--------
1 file changed, 398 insertions(+), 98 deletions(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c
index b098844a7fa..3fb8e2b9433 100644
--- a/dlls/mfmediaengine/main.c
+++ b/dlls/mfmediaengine/main.c
@@ -113,7 +113,7 @@ struct rect
struct media_engine
{
- IMFMediaEngine IMFMediaEngine_iface;
+ IMFMediaEngineEx IMFMediaEngineEx_iface;
IMFGetService IMFGetService_iface;
IMFAsyncCallback session_events;
IMFAsyncCallback load_handler;
@@ -718,9 +718,9 @@ static void media_engine_set_flag(struct media_engine *engine, unsigned int mask
engine->flags &= ~mask;
}
-static inline struct media_engine *impl_from_IMFMediaEngine(IMFMediaEngine *iface)
+static inline struct media_engine *impl_from_IMFMediaEngineEx(IMFMediaEngineEx *iface)
{
- return CONTAINING_RECORD(iface, struct media_engine, IMFMediaEngine_iface);
+ return CONTAINING_RECORD(iface, struct media_engine, IMFMediaEngineEx_iface);
}
static inline struct media_engine *impl_from_IMFGetService(IMFGetService *iface)
@@ -826,13 +826,13 @@ static HRESULT WINAPI media_engine_callback_QueryInterface(IMFAsyncCallback *ifa
static ULONG WINAPI media_engine_session_events_AddRef(IMFAsyncCallback *iface)
{
struct media_engine *engine = impl_from_session_events_IMFAsyncCallback(iface);
- return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface);
}
static ULONG WINAPI media_engine_session_events_Release(IMFAsyncCallback *iface)
{
struct media_engine *engine = impl_from_session_events_IMFAsyncCallback(iface);
- return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface);
}
static HRESULT WINAPI media_engine_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue)
@@ -948,13 +948,13 @@ static const IMFAsyncCallbackVtbl media_engine_session_events_vtbl =
static ULONG WINAPI media_engine_load_handler_AddRef(IMFAsyncCallback *iface)
{
struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface);
- return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface);
}
static ULONG WINAPI media_engine_load_handler_Release(IMFAsyncCallback *iface)
{
struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface);
- return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface);
}
static HRESULT media_engine_create_source_node(IMFMediaSource *source, IMFPresentationDescriptor *pd, IMFStreamDescriptor *sd,
@@ -1258,13 +1258,14 @@ static const IMFAsyncCallbackVtbl media_engine_load_handler_vtbl =
media_engine_load_handler_Invoke,
};
-static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngine *iface, REFIID riid, void **obj)
+static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngineEx *iface, REFIID riid, void **obj)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
- if (IsEqualIID(riid, &IID_IMFMediaEngine) ||
+ if (IsEqualIID(riid, &IID_IMFMediaEngineEx) ||
+ IsEqualIID(riid, &IID_IMFMediaEngine) ||
IsEqualIID(riid, &IID_IUnknown))
{
*obj = iface;
@@ -1284,9 +1285,9 @@ static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngine *iface, REFIID
return S_OK;
}
-static ULONG WINAPI media_engine_AddRef(IMFMediaEngine *iface)
+static ULONG WINAPI media_engine_AddRef(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
ULONG refcount = InterlockedIncrement(&engine->refcount);
TRACE("%p, refcount %u.\n", iface, refcount);
@@ -1318,9 +1319,9 @@ static void free_media_engine(struct media_engine *engine)
free(engine);
}
-static ULONG WINAPI media_engine_Release(IMFMediaEngine *iface)
+static ULONG WINAPI media_engine_Release(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
ULONG refcount = InterlockedDecrement(&engine->refcount);
TRACE("%p, refcount %u.\n", iface, refcount);
@@ -1331,9 +1332,9 @@ static ULONG WINAPI media_engine_Release(IMFMediaEngine *iface)
return refcount;
}
-static HRESULT WINAPI media_engine_GetError(IMFMediaEngine *iface, IMFMediaError **error)
+static HRESULT WINAPI media_engine_GetError(IMFMediaEngineEx *iface, IMFMediaError **error)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %p.\n", iface, error);
@@ -1356,9 +1357,9 @@ static HRESULT WINAPI media_engine_GetError(IMFMediaEngine *iface, IMFMediaError
return hr;
}
-static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngine *iface, MF_MEDIA_ENGINE_ERR code)
+static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_ERR code)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %u.\n", iface, code);
@@ -1376,16 +1377,16 @@ static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngine *iface, MF_MEDIA_
return hr;
}
-static HRESULT WINAPI media_engine_SetSourceElements(IMFMediaEngine *iface, IMFMediaEngineSrcElements *elements)
+static HRESULT WINAPI media_engine_SetSourceElements(IMFMediaEngineEx *iface, IMFMediaEngineSrcElements *elements)
{
FIXME("(%p, %p): stub.\n", iface, elements);
return E_NOTIMPL;
}
-static HRESULT WINAPI media_engine_SetSource(IMFMediaEngine *iface, BSTR url)
+static HRESULT WINAPI media_engine_SetSource(IMFMediaEngineEx *iface, BSTR url)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %s.\n", iface, debugstr_w(url));
@@ -1433,9 +1434,9 @@ static HRESULT WINAPI media_engine_SetSource(IMFMediaEngine *iface, BSTR url)
return hr;
}
-static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngine *iface, BSTR *url)
+static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngineEx *iface, BSTR *url)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %p.\n", iface, url);
@@ -1453,18 +1454,18 @@ static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngine *iface, BSTR
return hr;
}
-static USHORT WINAPI media_engine_GetNetworkState(IMFMediaEngine *iface)
+static USHORT WINAPI media_engine_GetNetworkState(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
return engine->network_state;
}
-static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngine *iface)
+static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
MF_MEDIA_ENGINE_PRELOAD preload;
TRACE("%p.\n", iface);
@@ -1476,9 +1477,9 @@ static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngine *if
return preload;
}
-static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_ENGINE_PRELOAD preload)
+static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_PRELOAD preload)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p, %d.\n", iface, preload);
@@ -1489,9 +1490,9 @@ static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_EN
return S_OK;
}
-static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTimeRange **range)
+static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngineEx *iface, IMFMediaTimeRange **range)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr;
TRACE("%p, %p.\n", iface, range);
@@ -1507,23 +1508,23 @@ static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTi
return hr;
}
-static HRESULT WINAPI media_engine_Load(IMFMediaEngine *iface)
+static HRESULT WINAPI media_engine_Load(IMFMediaEngineEx *iface)
{
FIXME("(%p): stub.\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngine *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer)
+static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngineEx *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer)
{
FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(type), answer);
return E_NOTIMPL;
}
-static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngine *iface)
+static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
unsigned short state;
TRACE("%p.\n", iface);
@@ -1535,16 +1536,16 @@ static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngine *iface)
return state;
}
-static BOOL WINAPI media_engine_IsSeeking(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_IsSeeking(IMFMediaEngineEx *iface)
{
FIXME("(%p): stub.\n", iface);
return FALSE;
}
-static double WINAPI media_engine_GetCurrentTime(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
double ret = 0.0;
MFTIME clocktime;
@@ -1564,23 +1565,23 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngine *iface)
return ret;
}
-static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngine *iface, double time)
+static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngineEx *iface, double time)
{
FIXME("(%p, %f): stub.\n", iface, time);
return E_NOTIMPL;
}
-static double WINAPI media_engine_GetStartTime(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetStartTime(IMFMediaEngineEx *iface)
{
FIXME("(%p): stub.\n", iface);
return 0.0;
}
-static double WINAPI media_engine_GetDuration(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetDuration(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
double value;
TRACE("%p.\n", iface);
@@ -1592,9 +1593,9 @@ static double WINAPI media_engine_GetDuration(IMFMediaEngine *iface)
return value;
}
-static BOOL WINAPI media_engine_IsPaused(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_IsPaused(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1606,9 +1607,9 @@ static BOOL WINAPI media_engine_IsPaused(IMFMediaEngine *iface)
return value;
}
-static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
double rate;
TRACE("%p.\n", iface);
@@ -1620,9 +1621,9 @@ static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngine *iface)
return rate;
}
-static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngine *iface, double rate)
+static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngineEx *iface, double rate)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, rate);
@@ -1640,9 +1641,9 @@ static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngine *iface,
return hr;
}
-static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
double rate;
TRACE("%p.\n", iface);
@@ -1654,9 +1655,9 @@ static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngine *iface)
return rate;
}
-static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngine *iface, double rate)
+static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngineEx *iface, double rate)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, rate);
@@ -1674,23 +1675,23 @@ static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngine *iface, double
return hr;
}
-static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngine *iface, IMFMediaTimeRange **played)
+static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngineEx *iface, IMFMediaTimeRange **played)
{
FIXME("(%p, %p): stub.\n", iface, played);
return E_NOTIMPL;
}
-static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngine *iface, IMFMediaTimeRange **seekable)
+static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngineEx *iface, IMFMediaTimeRange **seekable)
{
FIXME("(%p, %p): stub.\n", iface, seekable);
return E_NOTIMPL;
}
-static BOOL WINAPI media_engine_IsEnded(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_IsEnded(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1702,9 +1703,9 @@ static BOOL WINAPI media_engine_IsEnded(IMFMediaEngine *iface)
return value;
}
-static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1716,9 +1717,9 @@ static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngine *iface)
return value;
}
-static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngine *iface, BOOL autoplay)
+static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngineEx *iface, BOOL autoplay)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
FIXME("(%p, %d): stub.\n", iface, autoplay);
@@ -1729,9 +1730,9 @@ static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngine *iface, BOOL autop
return S_OK;
}
-static BOOL WINAPI media_engine_GetLoop(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_GetLoop(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1743,9 +1744,9 @@ static BOOL WINAPI media_engine_GetLoop(IMFMediaEngine *iface)
return value;
}
-static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop)
+static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngineEx *iface, BOOL loop)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
FIXME("(%p, %d): stub.\n", iface, loop);
@@ -1756,9 +1757,9 @@ static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop)
return S_OK;
}
-static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface)
+static HRESULT WINAPI media_engine_Play(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
@@ -1786,9 +1787,9 @@ static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface)
return S_OK;
}
-static HRESULT WINAPI media_engine_Pause(IMFMediaEngine *iface)
+static HRESULT WINAPI media_engine_Pause(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
@@ -1810,9 +1811,9 @@ static HRESULT WINAPI media_engine_Pause(IMFMediaEngine *iface)
return S_OK;
}
-static BOOL WINAPI media_engine_GetMuted(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_GetMuted(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL ret;
TRACE("%p.\n", iface);
@@ -1824,9 +1825,9 @@ static BOOL WINAPI media_engine_GetMuted(IMFMediaEngine *iface)
return ret;
}
-static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngine *iface, BOOL muted)
+static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngineEx *iface, BOOL muted)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %d.\n", iface, muted);
@@ -1844,9 +1845,9 @@ static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngine *iface, BOOL muted)
return hr;
}
-static double WINAPI media_engine_GetVolume(IMFMediaEngine *iface)
+static double WINAPI media_engine_GetVolume(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
double volume;
TRACE("%p.\n", iface);
@@ -1858,9 +1859,9 @@ static double WINAPI media_engine_GetVolume(IMFMediaEngine *iface)
return volume;
}
-static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngine *iface, double volume)
+static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngineEx *iface, double volume)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, volume);
@@ -1878,9 +1879,9 @@ static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngine *iface, double volum
return hr;
}
-static BOOL WINAPI media_engine_HasVideo(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_HasVideo(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1892,9 +1893,9 @@ static BOOL WINAPI media_engine_HasVideo(IMFMediaEngine *iface)
return value;
}
-static BOOL WINAPI media_engine_HasAudio(IMFMediaEngine *iface)
+static BOOL WINAPI media_engine_HasAudio(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
BOOL value;
TRACE("%p.\n", iface);
@@ -1906,9 +1907,9 @@ static BOOL WINAPI media_engine_HasAudio(IMFMediaEngine *iface)
return value;
}
-static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngine *iface, DWORD *cx, DWORD *cy)
+static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngineEx *iface, DWORD *cx, DWORD *cy)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %p, %p.\n", iface, cx, cy);
@@ -1933,9 +1934,9 @@ static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngine *iface, DWO
return hr;
}
-static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngine *iface, DWORD *cx, DWORD *cy)
+static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngineEx *iface, DWORD *cx, DWORD *cy)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
TRACE("%p, %p, %p.\n", iface, cx, cy);
@@ -1960,9 +1961,9 @@ static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngine *iface, DW
return hr;
}
-static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngine *iface)
+static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngineEx *iface)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr = S_OK;
FIXME("(%p): stub.\n", iface);
@@ -2202,10 +2203,10 @@ done:
return hr;
}
-static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngine *iface, IUnknown *surface,
+static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngineEx *iface, IUnknown *surface,
const MFVideoNormalizedRect *src_rect, const RECT *dst_rect, const MFARGB *color)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
ID3D11Texture2D *texture;
HRESULT hr = E_NOINTERFACE;
@@ -2230,9 +2231,9 @@ static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngine *iface, IUn
return hr;
}
-static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngine *iface, LONGLONG *pts)
+static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngineEx *iface, LONGLONG *pts)
{
- struct media_engine *engine = impl_from_IMFMediaEngine(iface);
+ struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
HRESULT hr;
TRACE("%p, %p.\n", iface, pts);
@@ -2254,7 +2255,269 @@ static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngine *iface, LONG
return hr;
}
-static const IMFMediaEngineVtbl media_engine_vtbl =
+static HRESULT WINAPI media_engine_SetSourceFromByteStream(IMFMediaEngineEx *iface, IMFByteStream *bytestream, BSTR url)
+{
+ FIXME("%p, %p, %s stub.\n", iface, bytestream, debugstr_w(url));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetStatistics(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_STATISTIC stat_id, PROPVARIANT *stat)
+{
+ FIXME("%p, %x, %p stub.\n", iface, stat_id, stat);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_UpdateVideoStream(IMFMediaEngineEx *iface, const MFVideoNormalizedRect *src,
+ const RECT *dst, const MFARGB *border_color)
+{
+ FIXME("%p, %p, %p, %p stub.\n", iface, src, dst, border_color);
+
+ return E_NOTIMPL;
+}
+
+static double WINAPI media_engine_GetBalance(IMFMediaEngineEx *iface)
+{
+ FIXME("%p stub.\n", iface);
+
+ return 0.0;
+}
+
+static HRESULT WINAPI media_engine_SetBalance(IMFMediaEngineEx *iface, double balance)
+{
+ FIXME("%p, %f stub.\n", iface, balance);
+
+ return E_NOTIMPL;
+}
+
+static BOOL WINAPI media_engine_IsPlaybackRateSupported(IMFMediaEngineEx *iface, double rate)
+{
+ FIXME("%p, %f stub.\n", iface, rate);
+
+ return FALSE;
+}
+
+static HRESULT WINAPI media_engine_FrameStep(IMFMediaEngineEx *iface, BOOL forward)
+{
+ FIXME("%p, %d stub.\n", iface, forward);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *iface, DWORD *flags)
+{
+ FIXME("%p, %p stub.\n", iface, flags);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetPresentationAttribute(IMFMediaEngineEx *iface, REFGUID attribute,
+ PROPVARIANT *value)
+{
+ FIXME("%p, %s, %p stub.\n", iface, debugstr_guid(attribute), value);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetNumberOfStreams(IMFMediaEngineEx *iface, DWORD *stream_count)
+{
+ FIXME("%p, %p stub.\n", iface, stream_count);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetStreamAttribute(IMFMediaEngineEx *iface, DWORD stream_index, REFGUID attribute,
+ PROPVARIANT *value)
+{
+ FIXME("%p, %d, %s, %p stub.\n", iface, stream_index, debugstr_guid(attribute), value);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetStreamSelection(IMFMediaEngineEx *iface, DWORD stream_index, BOOL *enabled)
+{
+ FIXME("%p, %d, %p stub.\n", iface, stream_index, enabled);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetStreamSelection(IMFMediaEngineEx *iface, DWORD stream_index, BOOL enabled)
+{
+ FIXME("%p, %d, %d stub.\n", iface, stream_index, enabled);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_ApplyStreamSelections(IMFMediaEngineEx *iface)
+{
+ FIXME("%p stub.\n", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_IsProtected(IMFMediaEngineEx *iface, BOOL *protected)
+{
+ FIXME("%p, %p stub.\n", iface, protected);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_InsertVideoEffect(IMFMediaEngineEx *iface, IUnknown *effect, BOOL is_optional)
+{
+ FIXME("%p, %p, %d stub.\n", iface, effect, is_optional);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_InsertAudioEffect(IMFMediaEngineEx *iface, IUnknown *effect, BOOL is_optional)
+{
+ FIXME("%p, %p, %d stub.\n", iface, effect, is_optional);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_RemoveAllEffects(IMFMediaEngineEx *iface)
+{
+ FIXME("%p stub.\n", iface);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetTimelineMarkerTimer(IMFMediaEngineEx *iface, double timeout)
+{
+ FIXME("%p, %f stub.\n", iface, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetTimelineMarkerTimer(IMFMediaEngineEx *iface, double *timeout)
+{
+ FIXME("%p, %p stub.\n", iface, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_CancelTimelineMarkerTimer(IMFMediaEngineEx *iface)
+{
+ FIXME("%p stub.\n", iface);
+
+ return E_NOTIMPL;
+}
+
+static BOOL WINAPI media_engine_IsStereo3D(IMFMediaEngineEx *iface)
+{
+ FIXME("%p stub.\n", iface);
+
+ return FALSE;
+}
+
+static HRESULT WINAPI media_engine_GetStereo3DFramePackingMode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_S3D_PACKING_MODE *mode)
+{
+ FIXME("%p, %p stub.\n", iface, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetStereo3DFramePackingMode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_S3D_PACKING_MODE mode)
+{
+ FIXME("%p, %#x stub.\n", iface, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetStereo3DRenderMode(IMFMediaEngineEx *iface, MF3DVideoOutputType *output_type)
+{
+ FIXME("%p, %p stub.\n", iface, output_type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetStereo3DRenderMode(IMFMediaEngineEx *iface, MF3DVideoOutputType output_type)
+{
+ FIXME("%p, %#x stub.\n", iface, output_type);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_EnableWindowlessSwapchainMode(IMFMediaEngineEx *iface, BOOL enable)
+{
+ FIXME("%p, %d stub.\n", iface, enable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetVideoSwapchainHandle(IMFMediaEngineEx *iface, HANDLE *swapchain)
+{
+ FIXME("%p, %p stub.\n", iface, swapchain);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_EnableHorizontalMirrorMode(IMFMediaEngineEx *iface, BOOL enable)
+{
+ FIXME("%p, %d stub.\n", iface, enable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 *category)
+{
+ FIXME("%p, %p stub.\n", iface, category);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 category)
+{
+ FIXME("%p, %u stub.\n", iface, category);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 *role)
+{
+ FIXME("%p, %p stub.\n", iface, role);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 role)
+{
+ FIXME("%p, %u stub.\n", iface, role);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_GetRealTimeMode(IMFMediaEngineEx *iface, BOOL *enabled)
+{
+ FIXME("%p, %p stub.\n", iface, enabled);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetRealTimeMode(IMFMediaEngineEx *iface, BOOL enable)
+{
+ FIXME("%p, %d stub.\n", iface, enable);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_SetCurrentTimeEx(IMFMediaEngineEx *iface, double seektime, MF_MEDIA_ENGINE_SEEK_MODE mode)
+{
+ FIXME("%p, %f, %#x stub.\n", iface, seektime, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI media_engine_EnableTimeUpdateTimer(IMFMediaEngineEx *iface, BOOL enable)
+{
+ FIXME("%p, %d stub.\n", iface, enable);
+
+ return E_NOTIMPL;
+}
+
+static const IMFMediaEngineExVtbl media_engine_vtbl =
{
media_engine_QueryInterface,
media_engine_AddRef,
@@ -2301,24 +2564,61 @@ static const IMFMediaEngineVtbl media_engine_vtbl =
media_engine_Shutdown,
media_engine_TransferVideoFrame,
media_engine_OnVideoStreamTick,
+ media_engine_SetSourceFromByteStream,
+ media_engine_GetStatistics,
+ media_engine_UpdateVideoStream,
+ media_engine_GetBalance,
+ media_engine_SetBalance,
+ media_engine_IsPlaybackRateSupported,
+ media_engine_FrameStep,
+ media_engine_GetResourceCharacteristics,
+ media_engine_GetPresentationAttribute,
+ media_engine_GetNumberOfStreams,
+ media_engine_GetStreamAttribute,
+ media_engine_GetStreamSelection,
+ media_engine_SetStreamSelection,
+ media_engine_ApplyStreamSelections,
+ media_engine_IsProtected,
+ media_engine_InsertVideoEffect,
+ media_engine_InsertAudioEffect,
+ media_engine_RemoveAllEffects,
+ media_engine_SetTimelineMarkerTimer,
+ media_engine_GetTimelineMarkerTimer,
+ media_engine_CancelTimelineMarkerTimer,
+ media_engine_IsStereo3D,
+ media_engine_GetStereo3DFramePackingMode,
+ media_engine_SetStereo3DFramePackingMode,
+ media_engine_GetStereo3DRenderMode,
+ media_engine_SetStereo3DRenderMode,
+ media_engine_EnableWindowlessSwapchainMode,
+ media_engine_GetVideoSwapchainHandle,
+ media_engine_EnableHorizontalMirrorMode,
+ media_engine_GetAudioStreamCategory,
+ media_engine_SetAudioStreamCategory,
+ media_engine_GetAudioEndpointRole,
+ media_engine_SetAudioEndpointRole,
+ media_engine_GetRealTimeMode,
+ media_engine_SetRealTimeMode,
+ media_engine_SetCurrentTimeEx,
+ media_engine_EnableTimeUpdateTimer,
};
static HRESULT WINAPI media_engine_gs_QueryInterface(IMFGetService *iface, REFIID riid, void **obj)
{
struct media_engine *engine = impl_from_IMFGetService(iface);
- return IMFMediaEngine_QueryInterface(&engine->IMFMediaEngine_iface, riid, obj);
+ return IMFMediaEngineEx_QueryInterface(&engine->IMFMediaEngineEx_iface, riid, obj);
}
static ULONG WINAPI media_engine_gs_AddRef(IMFGetService *iface)
{
struct media_engine *engine = impl_from_IMFGetService(iface);
- return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface);
}
static ULONG WINAPI media_engine_gs_Release(IMFGetService *iface)
{
struct media_engine *engine = impl_from_IMFGetService(iface);
- return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface);
}
static HRESULT WINAPI media_engine_gs_GetService(IMFGetService *iface, REFGUID service,
@@ -2355,13 +2655,13 @@ static HRESULT WINAPI media_engine_grabber_callback_QueryInterface(IMFSampleGrab
static ULONG WINAPI media_engine_grabber_callback_AddRef(IMFSampleGrabberSinkCallback *iface)
{
struct media_engine *engine = impl_from_IMFSampleGrabberSinkCallback(iface);
- return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface);
}
static ULONG WINAPI media_engine_grabber_callback_Release(IMFSampleGrabberSinkCallback *iface)
{
struct media_engine *engine = impl_from_IMFSampleGrabberSinkCallback(iface);
- return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface);
+ return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface);
}
static HRESULT WINAPI media_engine_grabber_callback_OnClockStart(IMFSampleGrabberSinkCallback *iface,
@@ -2490,7 +2790,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
IMFClock *clock;
HRESULT hr;
- engine->IMFMediaEngine_iface.lpVtbl = &media_engine_vtbl;
+ engine->IMFMediaEngineEx_iface.lpVtbl = &media_engine_vtbl;
engine->IMFGetService_iface.lpVtbl = &media_engine_get_service_vtbl;
engine->session_events.lpVtbl = &media_engine_session_events_vtbl;
engine->load_handler.lpVtbl = &media_engine_load_handler_vtbl;
@@ -2572,7 +2872,7 @@ static HRESULT WINAPI media_engine_factory_CreateInstance(IMFMediaEngineClassFac
return hr;
}
- *engine = &object->IMFMediaEngine_iface;
+ *engine = (IMFMediaEngine *)&object->IMFMediaEngineEx_iface;
return S_OK;
}
--
2.34.1
2
1
[PATCH 1/2] dwrite: Partially implement newer TranslateColorGlyphRun() variant.
by Nikolay Sivov Jan. 21, 2022
by Nikolay Sivov Jan. 21, 2022
Jan. 21, 2022
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/dwrite/dwrite_private.h | 5 +-
dlls/dwrite/font.c | 38 ++++++++----
dlls/dwrite/main.c | 22 ++++---
dlls/dwrite/tests/font.c | 108 +++++++++++++++++++++++++++++++----
4 files changed, 140 insertions(+), 33 deletions(-)
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index 91b2bb3241c..00fe325518f 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -315,8 +315,9 @@ extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DEC
extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN;
extern BOOL is_face_type_supported(DWRITE_FONT_FACE_TYPE) DECLSPEC_HIDDEN;
extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE_FONT_FACE_TYPE,IDWriteLocalizedStrings**) DECLSPEC_HIDDEN;
-extern HRESULT create_colorglyphenum(FLOAT,FLOAT,const DWRITE_GLYPH_RUN*,const DWRITE_GLYPH_RUN_DESCRIPTION*,DWRITE_MEASURING_MODE,
- const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN;
+extern HRESULT create_colorglyphenum(D2D1_POINT_2F origin, const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *desc,
+ DWRITE_GLYPH_IMAGE_FORMATS formats, DWRITE_MEASURING_MODE mode, const DWRITE_MATRIX *transform, UINT32 palette,
+ IDWriteColorGlyphRunEnumerator1 **enumerator) DECLSPEC_HIDDEN;
extern BOOL lb_is_newline_char(WCHAR) DECLSPEC_HIDDEN;
extern HRESULT create_system_fontfallback(IDWriteFactory7 *factory, IDWriteFontFallback1 **fallback) DECLSPEC_HIDDEN;
extern void release_system_fontfallback(IDWriteFontFallback1 *fallback) DECLSPEC_HIDDEN;
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 2296c74c1e3..cbc0434b72d 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -397,8 +397,7 @@ struct dwrite_colorglyphenum
IDWriteColorGlyphRunEnumerator1 IDWriteColorGlyphRunEnumerator1_iface;
LONG refcount;
- FLOAT origin_x; /* original run origin */
- FLOAT origin_y;
+ D2D1_POINT_2F origin; /* original run origin */
IDWriteFontFace5 *fontface; /* for convenience */
DWRITE_COLOR_GLYPH_RUN1 colorrun; /* returned with GetCurrentRun() */
@@ -6431,8 +6430,8 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
glyphenum->color_offsets[g] = glyphenum->offsets[g];
}
- colorrun->baselineOriginX = glyphenum->origin_x + get_glyph_origin(glyphenum, first_glyph);
- colorrun->baselineOriginY = glyphenum->origin_y;
+ colorrun->baselineOriginX = glyphenum->origin.x + get_glyph_origin(glyphenum, first_glyph);
+ colorrun->baselineOriginY = glyphenum->origin.y;
colorrun->glyphRun.glyphCount = glyphenum->run.glyphCount;
colorrun->paletteIndex = 0xffff;
memset(&colorrun->runColor, 0, sizeof(colorrun->runColor));
@@ -6470,8 +6469,8 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
glyphenum->palette, colorrun->paletteIndex, hr);
}
/* found a glyph position new color run starts from, origin is "original origin + distance to this glyph" */
- colorrun->baselineOriginX = glyphenum->origin_x + get_glyph_origin(glyphenum, g);
- colorrun->baselineOriginY = glyphenum->origin_y;
+ colorrun->baselineOriginX = glyphenum->origin.x + get_glyph_origin(glyphenum, g);
+ colorrun->baselineOriginY = glyphenum->origin.y;
glyphenum->color_advances[index] = glyphenum->advances[g];
got_palette_index = TRUE;
}
@@ -6562,9 +6561,9 @@ static const IDWriteColorGlyphRunEnumerator1Vtbl colorglyphenumvtbl =
colorglyphenum1_GetCurrentRun,
};
-HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_RUN *run,
- const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, DWRITE_MEASURING_MODE measuring_mode,
- const DWRITE_MATRIX *transform, unsigned int palette, IDWriteColorGlyphRunEnumerator **ret)
+HRESULT create_colorglyphenum(D2D1_POINT_2F origin, const DWRITE_GLYPH_RUN *run,
+ const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, DWRITE_GLYPH_IMAGE_FORMATS formats, DWRITE_MEASURING_MODE measuring_mode,
+ const DWRITE_MATRIX *transform, unsigned int palette, IDWriteColorGlyphRunEnumerator1 **ret)
{
struct dwrite_colorglyphenum *colorglyphenum;
BOOL colorfont, has_colored_glyph;
@@ -6580,13 +6579,28 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
if (!colorfont)
return DWRITE_E_NOCOLOR;
+ if (!(formats & (DWRITE_GLYPH_IMAGE_FORMATS_COLR |
+ DWRITE_GLYPH_IMAGE_FORMATS_SVG |
+ DWRITE_GLYPH_IMAGE_FORMATS_PNG |
+ DWRITE_GLYPH_IMAGE_FORMATS_JPEG |
+ DWRITE_GLYPH_IMAGE_FORMATS_TIFF |
+ DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8)))
+ {
+ return DWRITE_E_NOCOLOR;
+ }
+
+ if (formats & ~(DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE | DWRITE_GLYPH_IMAGE_FORMATS_CFF | DWRITE_GLYPH_IMAGE_FORMATS_COLR))
+ {
+ FIXME("Unimplemented formats requested %#x.\n", formats);
+ return E_NOTIMPL;
+ }
+
if (!(colorglyphenum = calloc(1, sizeof(*colorglyphenum))))
return E_OUTOFMEMORY;
colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface.lpVtbl = &colorglyphenumvtbl;
colorglyphenum->refcount = 1;
- colorglyphenum->origin_x = originX;
- colorglyphenum->origin_y = originY;
+ colorglyphenum->origin = origin;
colorglyphenum->fontface = &fontface->IDWriteFontFace5_iface;
IDWriteFontFace5_AddRef(colorglyphenum->fontface);
colorglyphenum->glyphs = NULL;
@@ -6648,7 +6662,7 @@ HRESULT create_colorglyphenum(float originX, float originY, const DWRITE_GLYPH_R
run->fontEmSize, 1.0f, transform, run->glyphIndices[i], run->isSideways);
}
- *ret = (IDWriteColorGlyphRunEnumerator *)&colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface;
+ *ret = &colorglyphenum->IDWriteColorGlyphRunEnumerator1_iface;
return S_OK;
}
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c
index b21eba0c50a..ab53d5cb80d 100644
--- a/dlls/dwrite/main.c
+++ b/dlls/dwrite/main.c
@@ -1398,13 +1398,17 @@ static HRESULT WINAPI dwritefactory2_CreateFontFallbackBuilder(IDWriteFactory7 *
}
static HRESULT WINAPI dwritefactory2_TranslateColorGlyphRun(IDWriteFactory7 *iface, FLOAT originX, FLOAT originY,
- const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, DWRITE_MEASURING_MODE mode,
- const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **colorlayers)
+ const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *run_desc, DWRITE_MEASURING_MODE measuring_mode,
+ const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **layers)
{
- TRACE("%p, %.8e, %.8e, %p, %p, %d, %p, %u, %p.\n", iface, originX, originY, run, rundescr, mode,
- transform, palette, colorlayers);
+ D2D1_POINT_2F origin = { originX, originY };
- return create_colorglyphenum(originX, originY, run, rundescr, mode, transform, palette, colorlayers);
+ TRACE("%p, %.8e, %.8e, %p, %p, %d, %p, %u, %p.\n", iface, originX, originY, run, run_desc, measuring_mode,
+ transform, palette, layers);
+
+ return create_colorglyphenum(origin, run, run_desc, DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE
+ | DWRITE_GLYPH_IMAGE_FORMATS_CFF | DWRITE_GLYPH_IMAGE_FORMATS_COLR,
+ measuring_mode, transform, palette, (IDWriteColorGlyphRunEnumerator1 **)layers);
}
static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory7 *iface, FLOAT gamma, FLOAT contrast,
@@ -1697,15 +1701,15 @@ static HRESULT WINAPI dwritefactory3_GetFontDownloadQueue(IDWriteFactory7 *iface
return E_NOTIMPL;
}
-static HRESULT WINAPI dwritefactory4_TranslateColorGlyphRun(IDWriteFactory7 *iface, D2D1_POINT_2F baseline_origin,
+static HRESULT WINAPI dwritefactory4_TranslateColorGlyphRun(IDWriteFactory7 *iface, D2D1_POINT_2F origin,
DWRITE_GLYPH_RUN const *run, DWRITE_GLYPH_RUN_DESCRIPTION const *run_desc,
DWRITE_GLYPH_IMAGE_FORMATS desired_formats, DWRITE_MEASURING_MODE measuring_mode, DWRITE_MATRIX const *transform,
UINT32 palette, IDWriteColorGlyphRunEnumerator1 **layers)
{
- FIXME("%p, %p, %p, %u, %d, %p, %u, %p: stub\n", iface, run, run_desc, desired_formats, measuring_mode,
- transform, palette, layers);
+ TRACE("%p, %.8e, %.8e, %p, %p, %u, %d, %p, %u, %p.\n", iface, origin.x, origin.y, run, run_desc, desired_formats,
+ measuring_mode, transform, palette, layers);
- return E_NOTIMPL;
+ return create_colorglyphenum(origin, run, run_desc, desired_formats, measuring_mode, transform, palette, layers);
}
HRESULT compute_glyph_origins(DWRITE_GLYPH_RUN const *run, DWRITE_MEASURING_MODE measuring_mode,
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index b347a73a53e..a610491e09c 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -7671,6 +7671,7 @@ static void test_TranslateColorGlyphRun(void)
const DWRITE_COLOR_GLYPH_RUN *colorrun;
IDWriteFontFace2 *fontface2;
IDWriteFontFace *fontface;
+ IDWriteFactory4 *factory4;
IDWriteFactory2 *factory;
DWRITE_GLYPH_RUN run;
UINT32 codepoints[2];
@@ -7740,7 +7741,8 @@ static void test_TranslateColorGlyphRun(void)
win_skip("IDWriteColorGlyphRunEnumerator1 is not supported.\n");
}
- for (;;) {
+ for (;;)
+ {
hasrun = FALSE;
hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun);
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -7749,22 +7751,24 @@ static void test_TranslateColorGlyphRun(void)
break;
hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(colorrun->glyphRun.fontFace != NULL, "got fontface %p\n", colorrun->glyphRun.fontFace);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(colorrun->glyphRun.fontFace == fontface, "Unexpected fontface %p.\n", colorrun->glyphRun.fontFace);
ok(colorrun->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun->glyphRun.fontEmSize);
- ok(colorrun->glyphRun.glyphCount > 0, "got wrong glyph count %u\n", colorrun->glyphRun.glyphCount);
+ ok(colorrun->glyphRun.glyphCount == 1, "Unexpected glyph count %u.\n", colorrun->glyphRun.glyphCount);
ok(colorrun->glyphRun.glyphIndices != NULL, "got null glyph indices %p\n", colorrun->glyphRun.glyphIndices);
ok(colorrun->glyphRun.glyphAdvances != NULL, "got null glyph advances %p\n", colorrun->glyphRun.glyphAdvances);
+ ok(!colorrun->glyphRunDescription, "Unexpected description pointer.\n");
if (layers1)
{
hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
ok(hr == S_OK, "Failed to get color runt, hr %#x.\n", hr);
- ok(colorrun1->glyphRun.fontFace != NULL, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
- ok(colorrun1->glyphRun.fontEmSize == 20.0f, "Unexpected font size %f.\n", colorrun1->glyphRun.fontEmSize);
- ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u\n", colorrun1->glyphRun.glyphCount);
- ok(colorrun1->glyphRun.glyphIndices != NULL, "Unexpected indices array.\n");
- ok(colorrun1->glyphRun.glyphAdvances != NULL, "Unexpected advances array.\n");
+ ok((const DWRITE_COLOR_GLYPH_RUN *)colorrun1 == colorrun, "Unexpected pointer.\n");
+ ok(colorrun1->glyphImageFormat == (DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE | DWRITE_GLYPH_IMAGE_FORMATS_COLR) ||
+ colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_NONE,
+ "Unexpected glyph image format %#x.\n", colorrun1->glyphImageFormat);
+ ok(colorrun1->measuringMode == DWRITE_MEASURING_MODE_NATURAL, "Unexpected measuring mode %d.\n",
+ colorrun1->measuringMode);
}
}
@@ -7804,6 +7808,7 @@ static void test_TranslateColorGlyphRun(void)
codepoints[0] = 'A';
hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!!*glyphs, "Unexpected glyph.\n");
layers = (void*)0xdeadbeef;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
@@ -7822,11 +7827,94 @@ static void test_TranslateColorGlyphRun(void)
layers = NULL;
hr = IDWriteFactory2_TranslateColorGlyphRun(factory, 0.0f, 0.0f, &run, NULL,
- DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
+ DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(layers != NULL, "got %p\n", layers);
+
+ hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (void **)&layers1);
+ if (SUCCEEDED(hr))
+ {
+ for (;;)
+ {
+ hasrun = FALSE;
+ hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ if (!hasrun)
+ break;
+
+ hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
+ ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize);
+ ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount);
+ ok(!!colorrun1->glyphRun.glyphIndices, "Unexpected indices %p.\n", colorrun1->glyphRun.glyphIndices);
+ ok(!!colorrun1->glyphRun.glyphAdvances, "Unexpected advances %p.\n", colorrun1->glyphRun.glyphAdvances);
+ ok(!colorrun1->glyphRunDescription, "Unexpected description pointer.\n");
+ todo_wine
+ ok(colorrun1->glyphImageFormat == (DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE | DWRITE_GLYPH_IMAGE_FORMATS_COLR) ||
+ colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE, "Unexpected glyph image format %#x.\n",
+ colorrun1->glyphImageFormat);
+ ok(colorrun1->measuringMode == DWRITE_MEASURING_MODE_NATURAL, "Unexpected measuring mode %d.\n",
+ colorrun1->measuringMode);
+ }
+
+ IDWriteColorGlyphRunEnumerator1_Release(layers1);
+ }
IDWriteColorGlyphRunEnumerator_Release(layers);
+ if (SUCCEEDED(IDWriteFactory2_QueryInterface(factory, &IID_IDWriteFactory4, (void **)&factory4)))
+ {
+ D2D1_POINT_2F origin;
+
+ origin.x = origin.y = 0.0f;
+ hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
+ DWRITE_GLYPH_IMAGE_FORMATS_NONE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+
+ hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
+ DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+
+ hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
+ DWRITE_GLYPH_IMAGE_FORMATS_CFF, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
+ ok(hr == DWRITE_E_NOCOLOR, "Unexpected hr %#x.\n", hr);
+
+ hr = IDWriteFactory4_TranslateColorGlyphRun(factory4, origin, &run, NULL,
+ DWRITE_GLYPH_IMAGE_FORMATS_COLR, DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers1);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ for (;;)
+ {
+ hasrun = FALSE;
+ hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ if (!hasrun)
+ break;
+
+ hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(!!colorrun1->glyphRun.fontFace, "Unexpected fontface %p.\n", colorrun1->glyphRun.fontFace);
+ ok(colorrun1->glyphRun.fontEmSize == 20.0f, "got wrong font size %f\n", colorrun1->glyphRun.fontEmSize);
+ ok(colorrun1->glyphRun.glyphCount > 0, "Unexpected glyph count %u.\n", colorrun1->glyphRun.glyphCount);
+ ok(!!colorrun1->glyphRun.glyphIndices, "Unexpected indices %p.\n", colorrun1->glyphRun.glyphIndices);
+ ok(!!colorrun1->glyphRun.glyphAdvances, "Unexpected advances %p.\n", colorrun1->glyphRun.glyphAdvances);
+ ok(!colorrun1->glyphRunDescription, "Unexpected description pointer.\n");
+ ok(colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_COLR ||
+ colorrun1->glyphImageFormat == DWRITE_GLYPH_IMAGE_FORMATS_NONE, "Unexpected glyph image format %#x.\n",
+ colorrun1->glyphImageFormat);
+ ok(colorrun1->measuringMode == DWRITE_MEASURING_MODE_NATURAL, "Unexpected measuring mode %d.\n",
+ colorrun1->measuringMode);
+ }
+
+ IDWriteColorGlyphRunEnumerator1_Release(layers1);
+
+ IDWriteFactory4_Release(factory4);
+ }
+ else
+ win_skip("IDWriteFactory4::TranslateColorGlyphRun() is not supported.\n");
+
IDWriteFontFace2_Release(fontface2);
IDWriteFontFace_Release(fontface);
ref = IDWriteFactory2_Release(factory);
--
2.34.1
2
4
[PATCH 5/5] uxtheme: Make IsThemeDialogTextureEnabled() return TRUE for all valid flags without ETDT_DISABLE.
by Zhiyi Zhang Jan. 21, 2022
by Zhiyi Zhang Jan. 21, 2022
Jan. 21, 2022
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/draw.c | 7 ++-----
dlls/uxtheme/tests/system.c | 17 ++++++-----------
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index a7942b03f97..b6e5f0230e5 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -69,14 +69,11 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
{
DWORD dwDialogTextureFlags;
+
TRACE("(%p)\n", hwnd);
dwDialogTextureFlags = HandleToUlong( GetPropW( hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled) ));
- if (dwDialogTextureFlags == 0)
- /* Means EnableThemeDialogTexture wasn't called for this dialog */
- return TRUE;
-
- return (dwDialogTextureFlags & ETDT_ENABLE) && !(dwDialogTextureFlags & ETDT_DISABLE);
+ return dwDialogTextureFlags && !(dwDialogTextureFlags & ETDT_DISABLE);
}
/***********************************************************************
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 03e435eb463..93994fa8364 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1649,12 +1649,12 @@ static void test_EnableThemeDialogTexture(void)
}
invalid_flag_tests[] =
{
- {0, FALSE},
+ {0, FALSE, TRUE},
{ETDT_DISABLE | ETDT_ENABLE, FALSE},
{ETDT_ENABLETAB | ETDT_ENABLEAEROWIZARDTAB, TRUE},
- {ETDT_USETABTEXTURE | ETDT_USEAEROWIZARDTABTEXTURE, TRUE, TRUE},
+ {ETDT_USETABTEXTURE | ETDT_USEAEROWIZARDTABTEXTURE, TRUE},
{ETDT_VALIDBITS, FALSE},
- {~ETDT_VALIDBITS, FALSE},
+ {~ETDT_VALIDBITS, FALSE, TRUE},
{~ETDT_VALIDBITS | ETDT_DISABLE, FALSE}
};
@@ -1746,7 +1746,6 @@ static void test_EnableThemeDialogTexture(void)
/* Test dialog texture is disabled by default. EnableThemeDialogTexture() needs to be called */
ret = IsThemeDialogTextureEnabled(dialog);
- todo_wine
ok(!ret, "Expected theme dialog texture disabled.\n");
ok(GetWindowTheme(dialog) == NULL, "Expected NULL theme handle.\n");
@@ -2021,7 +2020,7 @@ static void test_EnableThemeDialogTexture(void)
"EnableThemeDialogTexture first flag", FALSE);
ret = IsThemeDialogTextureEnabled(dialog);
/* Non-zero flags without ETDT_DISABLE enables dialog texture */
- todo_wine_if(flags[i] == ETDT_USETABTEXTURE || flags[i] == ETDT_USEAEROWIZARDTABTEXTURE)
+ todo_wine_if(flags[i] == 0)
ok(ret == (!(flags[i] & ETDT_DISABLE) && flags[i]), "Wrong dialog texture status.\n");
child = GetDlgItem(dialog, 100);
@@ -2044,10 +2043,9 @@ static void test_EnableThemeDialogTexture(void)
ret = IsThemeDialogTextureEnabled(dialog);
/* If the flag is zero, it will have previous dialog texture status */
if (flags[j])
- todo_wine_if(flags[j] == ETDT_USETABTEXTURE || flags[j] == ETDT_USEAEROWIZARDTABTEXTURE)
ok(ret == !(flags[j] & ETDT_DISABLE), "Wrong dialog texture status.\n");
else
- todo_wine_if((!(flags[i] & ETDT_DISABLE) && flags[i]))
+ todo_wine_if(!flags[i] || flags[i] == ETDT_DISABLE || flags[i] == (ETDT_DISABLE | ETDT_ENABLE))
ok(ret == (!(flags[i] & ETDT_DISABLE) && flags[i]), "Wrong dialog texture status.\n");
lr = SendMessageA(dialog, WM_ERASEBKGND, (WPARAM)child_hdc, 0);
ok(lr != 0, "WM_ERASEBKGND failed.\n");
@@ -2159,12 +2157,12 @@ static void test_EnableThemeDialogTexture(void)
0, 0, NULL);
ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
ret = IsThemeDialogTextureEnabled(hwnd);
- todo_wine
ok(!ret, "Wrong dialog texture status.\n");
child = CreateWindowA(WC_STATICA, "child", WS_CHILD | WS_VISIBLE, 0, 0, 50, 50, hwnd, 0, 0,
NULL);
ok(child != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
ret = IsThemeDialogTextureEnabled(hwnd);
+ todo_wine
ok(ret, "Wrong dialog texture status.\n");
/* Test that if you move the child control to another window, it doesn't enables tab texture for
@@ -2173,18 +2171,15 @@ static void test_EnableThemeDialogTexture(void)
0, 0, NULL);
ok(hwnd2 != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
ret = IsThemeDialogTextureEnabled(hwnd2);
- todo_wine
ok(!ret, "Wrong dialog texture status.\n");
SetParent(child, hwnd2);
ok(GetParent(child) == hwnd2, "Wrong parent.\n");
ret = IsThemeDialogTextureEnabled(hwnd2);
- todo_wine
ok(!ret, "Wrong dialog texture status.\n");
InvalidateRect(child, NULL, TRUE);
flush_events();
ret = IsThemeDialogTextureEnabled(hwnd2);
- todo_wine
ok(!ret, "Wrong dialog texture status.\n");
DestroyWindow(hwnd2);
--
2.32.0
1
0
[PATCH 4/5] uxtheme: Do not call SetWindowTheme() in EnableThemeDialogTexture().
by Zhiyi Zhang Jan. 21, 2022
by Zhiyi Zhang Jan. 21, 2022
Jan. 21, 2022
It's no longer necessary to call SetWindowTheme() in EnableThemeDialogTexture() because dialog
theming doesn't need to open theme handles associated with the dialog. Calling SetWindowTheme() also
sends extra messages.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/draw.c | 7 +------
dlls/uxtheme/tests/system.c | 4 ++--
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index 04ea1e79df9..a7942b03f97 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -60,12 +60,7 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
res = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled),
UlongToHandle(dwFlags|0x80000000));
/* 0x80000000 serves as a "flags set" flag */
- if (!res)
- return HRESULT_FROM_WIN32(GetLastError());
- if (dwFlags & ETDT_USETABTEXTURE)
- return SetWindowTheme (hwnd, NULL, L"Tab");
- else
- return SetWindowTheme (hwnd, NULL, NULL);
+ return res ? S_OK : HRESULT_FROM_WIN32(GetLastError());
}
/***********************************************************************
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 3f8f32a9a7b..03e435eb463 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -2018,7 +2018,7 @@ static void test_EnableThemeDialogTexture(void)
hr = EnableThemeDialogTexture(dialog, flags[i]);
ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
- "EnableThemeDialogTexture first flag", TRUE);
+ "EnableThemeDialogTexture first flag", FALSE);
ret = IsThemeDialogTextureEnabled(dialog);
/* Non-zero flags without ETDT_DISABLE enables dialog texture */
todo_wine_if(flags[i] == ETDT_USETABTEXTURE || flags[i] == ETDT_USEAEROWIZARDTABTEXTURE)
@@ -2040,7 +2040,7 @@ static void test_EnableThemeDialogTexture(void)
hr = EnableThemeDialogTexture(dialog, flags[j]);
ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
- "EnableThemeDialogTexture second flag", TRUE);
+ "EnableThemeDialogTexture second flag", FALSE);
ret = IsThemeDialogTextureEnabled(dialog);
/* If the flag is zero, it will have previous dialog texture status */
if (flags[j])
--
2.32.0
1
0
[PATCH 3/5] comctl32/tests: Remove WM_CTLCOLORSTATIC tests for property sheets.
by Zhiyi Zhang Jan. 21, 2022
by Zhiyi Zhang Jan. 21, 2022
Jan. 21, 2022
The removed tests are covered by test_EnableThemeDialogTexture() in uxtheme/tests/system.c.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/propsheet.c | 229 ++------------------------------
1 file changed, 14 insertions(+), 215 deletions(-)
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index affd21da825..0284311c81b 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -20,8 +20,6 @@
#include <windows.h>
#include <commctrl.h>
-#include <uxtheme.h>
-#include <vsstyle.h>
#include "msg.h"
#include "resources.h"
@@ -45,13 +43,8 @@ static HPROPSHEETPAGE (WINAPI *pCreatePropertySheetPageW)(const PROPSHEETPAGEW *
static BOOL (WINAPI *pDestroyPropertySheetPage)(HPROPSHEETPAGE proppage);
static INT_PTR (WINAPI *pPropertySheetA)(const PROPSHEETHEADERA *header);
-static HRESULT (WINAPI *pCloseThemeData)(HTHEME);
-static HRESULT (WINAPI *pEnableThemeDialogTexture)(HWND, DWORD);
-static HRESULT (WINAPI *pGetThemePartSize)(HTHEME, HDC, int, int, RECT *, THEMESIZE, SIZE *);
-static HTHEME (WINAPI *pGetWindowTheme)(HWND);
static BOOL (WINAPI *pIsThemeActive)(void);
static BOOL (WINAPI *pIsThemeDialogTextureEnabled)(HWND);
-static HTHEME (WINAPI *pOpenThemeData)(HWND, LPCWSTR);
static void detect_locale(void)
{
@@ -1198,26 +1191,12 @@ static void test_bad_control_class(void)
DestroyWindow((HWND)ret);
}
-static BOOL handle_WM_CTLCOLORSTATIC;
-
static INT_PTR CALLBACK test_WM_CTLCOLORSTATIC_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
- static HWND child;
-
switch(msg)
{
case WM_INITDIALOG:
sheethwnd = hwnd;
- child = CreateWindowA(WC_STATICA, "child", WS_CHILD | WS_VISIBLE, 1, 2, 50, 50, hwnd,
- (HMENU)100, 0, NULL);
- ok(child != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
- return FALSE;
-
- case WM_CTLCOLORSTATIC:
- return (INT_PTR)(handle_WM_CTLCOLORSTATIC ? GetSysColorBrush(COLOR_MENU) : 0);
-
- case WM_CLOSE:
- DestroyWindow(child);
return FALSE;
default:
@@ -1225,26 +1204,16 @@ static INT_PTR CALLBACK test_WM_CTLCOLORSTATIC_proc(HWND hwnd, UINT msg, WPARAM
}
}
-static void test_WM_CTLCOLORSTATIC(void)
+static void test_page_dialog_texture(void)
{
- HWND hdlg, child, parent, hwnd;
- COLORREF color, old_color;
- int mode, old_mode, count;
- HBRUSH hbrush, hbrush2;
HPROPSHEETPAGE hpsp[1];
PROPSHEETHEADERA psh;
- HDC child_hdc, hdc;
- LOGBRUSH log_brush;
PROPSHEETPAGEA psp;
ULONG_PTR dlgproc;
- WNDCLASSA cls;
- HTHEME theme;
- DWORD error;
- BITMAP bmp;
- HRESULT hr;
- POINT org;
- SIZE size;
+ HWND hdlg, hwnd;
+ HBRUSH hbrush;
BOOL ret;
+ HDC hdc;
memset(&psp, 0, sizeof(psp));
psp.dwSize = sizeof(psp);
@@ -1265,193 +1234,28 @@ static void test_WM_CTLCOLORSTATIC(void)
ok(hdlg != INVALID_HANDLE_VALUE, "Got invalid handle value %p.\n", hdlg);
flush_events();
- child = GetDlgItem(sheethwnd, 100);
- ok(child != NULL, "Failed to get child static control, error %d.\n", GetLastError());
- parent = GetParent(child);
- ok(parent == sheethwnd, "Expected parent %p, got %p.\n", sheethwnd, parent);
- ok(sheethwnd != hdlg, "Expected handles not equal.\n");
-
/* Test that page dialog procedure is unchanged */
dlgproc = GetWindowLongPtrA(sheethwnd, DWLP_DLGPROC);
ok(dlgproc == (ULONG_PTR)test_WM_CTLCOLORSTATIC_proc, "Unexpected dlgproc %#lx.\n", dlgproc);
- child_hdc = GetDC(child);
- old_mode = SetBkMode(child_hdc, OPAQUE);
- ok(old_mode != 0, "SetBkMode failed.\n");
- old_color = SetBkColor(child_hdc, 0xaa5511);
- ok(old_color != CLR_INVALID, "SetBkColor failed.\n");
-
- /* Test that brush origin is at (0,0) */
- ret = GetBrushOrgEx(child_hdc, &org);
- ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
- ok(org.x == 0 && org.y == 0, "Expected (0,0), got %s.\n", wine_dbgstr_point(&org));
-
/* Test that theme dialog texture is enabled for comctl32 v6, even when theming is off */
ret = pIsThemeDialogTextureEnabled(sheethwnd);
todo_wine_if(!is_v6)
ok(ret == is_v6, "Wrong theme dialog texture status.\n");
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
+ hwnd = CreateWindowA(WC_EDITA, "child", WS_POPUP | WS_VISIBLE, 1, 2, 50, 50, 0, 0, 0, NULL);
+ ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
+ hdc = GetDC(hwnd);
+
+ hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
if (is_v6 && is_theme_active)
{
- /* Test that brush origin is changed after WM_CTLCOLORSTATIC */
- ret = GetBrushOrgEx(child_hdc, &org);
- ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
- ok(org.x == -1 && org.y == -2, "Expected (-1,-2), got %s.\n", wine_dbgstr_point(&org));
-
- /* Test that device context is set to transparent after WM_CTLCOLORSTATIC */
- mode = SetBkMode(child_hdc, old_mode);
- ok(mode == TRANSPARENT, "Expected mode %#x, got %#x.\n", TRANSPARENT, mode);
-
- /* Test that the brush is a pattern brush created from the tab body bitmap in the theme */
+ /* Test that dialog tab texture is enabled even without any child controls in the dialog */
ok(hbrush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
- ok(hbrush != GetStockObject(NULL_BRUSH), "Expected a different brush.\n");
- hbrush2 = SelectObject(child_hdc, GetSysColorBrush(COLOR_BTNFACE));
- ok(hbrush2 != hbrush, "Expected a different brush.\n");
-
- memset(&log_brush, 0, sizeof(log_brush));
- count = GetObjectA(hbrush, sizeof(log_brush), &log_brush);
- ok(count == sizeof(log_brush), "GetObjectA failed, error %u.\n", GetLastError());
- ok(log_brush.lbColor == 0, "Expected brush color %#x, got %#x.\n", 0, log_brush.lbColor);
- ok(log_brush.lbStyle == BS_PATTERN, "Expected brush style %#x, got %#x.\n", BS_PATTERN,
- log_brush.lbStyle);
-
- memset(&bmp, 0, sizeof(bmp));
- count = GetObjectA((HBITMAP)log_brush.lbHatch, sizeof(bmp), &bmp);
- ok(count == sizeof(bmp), "GetObjectA failed, error %u.\n", GetLastError());
-
- ok(pGetWindowTheme(hdlg) == NULL, "Expected NULL theme handle.\n");
- ok(pGetWindowTheme(sheethwnd) == NULL, "Expected NULL theme handle.\n");
-
- memset(&cls, 0, sizeof(cls));
- cls.lpfnWndProc = DefWindowProcA;
- cls.hInstance = GetModuleHandleA(NULL);
- cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
- cls.hbrBackground = GetStockObject(WHITE_BRUSH);
- cls.lpszClassName = "TestClass";
- RegisterClassA(&cls);
-
- hwnd = CreateWindowA("TestClass", "test", WS_POPUP | WS_VISIBLE, 0, 0, 4, 4, 0, 0, 0, NULL);
- ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
- theme = pOpenThemeData(hwnd, L"Tab");
- ok(theme != NULL, "OpenThemeData failed.\n");
-
- size.cx = 0;
- size.cy = 0;
- hr = pGetThemePartSize(theme, NULL, TABP_BODY, 0, NULL, TS_TRUE, &size);
- ok(hr == S_OK, "GetThemePartSize failed, hr %#x.\n", hr);
- ok(bmp.bmWidth == size.cx, "Expected width %d, got %d.\n", size.cx, bmp.bmWidth);
- ok(bmp.bmHeight == size.cy, "Expected height %d, got %d.\n", size.cy, bmp.bmHeight);
-
- pCloseThemeData(theme);
-
- /* Test that other controls besides static controls also get the same brush */
- hdc = GetDC(hwnd);
- old_mode = SetBkMode(hdc, OPAQUE);
- ok(old_mode != 0, "SetBkMode failed.\n");
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
- ok(hbrush2 == hbrush, "Expected the same brush.\n");
- mode = SetBkMode(hdc, old_mode);
- ok(mode == TRANSPARENT, "Expected mode %#x, got %#x.\n", TRANSPARENT, mode);
- ReleaseDC(hwnd, hdc);
- DestroyWindow(hwnd);
- UnregisterClassA("TestClass", GetModuleHandleA(NULL));
-
- /* Test disabling theme dialog texture should change the brush */
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_DISABLE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(hbrush2 != hbrush, "Expected a different brush.\n");
- ok(hbrush2 == GetSysColorBrush(COLOR_BTNFACE), "Expected brush %p, got %p.\n",
- GetSysColorBrush(COLOR_BTNFACE), hbrush2);
-
- /* Test re-enabling theme dialog texture with ETDT_ENABLE doesn't change the brush*/
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_ENABLE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(hbrush2 != hbrush)
- ok(hbrush2 == hbrush, "Expected the same brush.\n");
-
- /* Test ETDT_ENABLE | ETDT_USETABTEXTURE should change the brush */
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_ENABLE | ETDT_USETABTEXTURE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(hbrush2 == hbrush)
- ok(hbrush2 != hbrush, "Expected a different brush.\n");
-
- /* Test ETDT_ENABLE | ETDT_USEAEROWIZARDTABTEXTURE should change the brush */
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_ENABLE | ETDT_USEAEROWIZARDTABTEXTURE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- /* ETDT_USEAEROWIZARDTABTEXTURE is supported only on Vista+ */
- if (LOBYTE(LOWORD(GetVersion())) < 6)
- ok(hbrush2 == hbrush, "Expected the same brush.\n");
- else
- todo_wine_if(hbrush2 == hbrush)
- ok(hbrush2 != hbrush, "Expected a different brush.\n");
-
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_DISABLE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- hr = pEnableThemeDialogTexture(sheethwnd, ETDT_ENABLE | ETDT_USETABTEXTURE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
-
- /* Test that the page procedure should take precedence if WM_CTLCOLORSTATIC is handled */
- handle_WM_CTLCOLORSTATIC = TRUE;
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(hbrush == GetSysColorBrush(COLOR_MENU), "Expected brush %p, got %p.\n",
- GetSysColorBrush(COLOR_MENU), hbrush);
- handle_WM_CTLCOLORSTATIC = FALSE;
-
- /* Test that the brush is not a system object and has only one reference and shouldn't be freed */
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ret = DeleteObject(hbrush);
- ok(ret, "DeleteObject failed, error %u.\n", GetLastError());
- SetLastError(0xdeadbeef);
- ret = GetObjectA(hbrush, sizeof(log_brush), &log_brush);
- error = GetLastError();
- ok(!ret, "GetObjectA succeeded.\n");
- todo_wine
- ok(error == ERROR_INVALID_PARAMETER, "Expected error %u, got %u.\n",
- ERROR_INVALID_PARAMETER, error);
- ret = DeleteObject(hbrush);
- ok(!ret, "DeleteObject succeeded.\n");
-
- /* Should still report the same brush handle after the brush handle was freed */
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(hbrush2 == hbrush, "Expected the same brush.\n");
-
- /* Test that WM_THEMECHANGED should recreate the brush */
- hbrush = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- SendMessageW(sheethwnd, WM_THEMECHANGED, 0, 0);
- hbrush2 = (HBRUSH)SendMessageW(sheethwnd, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(hbrush2 != hbrush, "Expected a different brush.\n");
- ret = GetObjectA(hbrush, sizeof(log_brush), &log_brush);
- ok(!ret, "GetObjectA succeeded.\n");
}
- else
- {
- /* Test that brush origin is at (0,0) */
- ret = GetBrushOrgEx(child_hdc, &org);
- ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
- todo_wine_if(is_theme_active)
- ok(org.x == 0 && org.y == 0, "Expected (0,0), got %s.\n", wine_dbgstr_point(&org));
- todo_wine_if(is_theme_active)
- ok(hbrush == GetSysColorBrush(COLOR_BTNFACE), "Expected brush %p, got %p.\n",
- GetSysColorBrush(COLOR_BTNFACE), hbrush);
- mode = SetBkMode(child_hdc, old_mode);
- todo_wine_if(is_theme_active)
- ok(mode == OPAQUE, "Expected mode %#x, got %#x.\n", OPAQUE, mode);
- }
- color = SetBkColor(child_hdc, old_color);
- ok(color == GetSysColor(COLOR_BTNFACE), "Expected background color %#x, got %#x.\n",
- GetSysColor(COLOR_BTNFACE), color);
-
- ReleaseDC(child, child_hdc);
+ ReleaseDC(hwnd, hdc);
+ DestroyWindow(hwnd);
DestroyWindow(hdlg);
}
@@ -1472,13 +1276,8 @@ static void init_uxtheme_functions(void)
HMODULE uxtheme = LoadLibraryA("uxtheme.dll");
#define X(f) p##f = (void *)GetProcAddress(uxtheme, #f);
- X(CloseThemeData)
- X(EnableThemeDialogTexture)
- X(GetThemePartSize)
- X(GetWindowTheme)
X(IsThemeActive)
X(IsThemeDialogTextureEnabled)
- X(OpenThemeData)
#undef X
}
@@ -1511,7 +1310,7 @@ START_TEST(propsheet)
test_PSM_ADDPAGE();
test_PSM_INSERTPAGE();
test_CreatePropertySheetPage();
- test_WM_CTLCOLORSTATIC();
+ test_page_dialog_texture();
if (!load_v6_module(&ctx_cookie, &ctx))
return;
@@ -1519,7 +1318,7 @@ START_TEST(propsheet)
init_comctl32_functions();
is_v6 = TRUE;
- test_WM_CTLCOLORSTATIC();
+ test_page_dialog_texture();
unload_v6_module(ctx_cookie, ctx);
}
--
2.32.0
1
0
[PATCH 2/5] comctl32/tests: Remove WM_CTLCOLORSTATIC tests for static controls.
by Zhiyi Zhang Jan. 21, 2022
by Zhiyi Zhang Jan. 21, 2022
Jan. 21, 2022
These tests are covered by test_EnableThemeDialogTexture() in uxtheme/tests/system.c. These tests
are also misleading because a WM_ERASEBKGND message is needed to actually activate dialog theming.
Without the message, they give the impression that EnableThemeDialogTexture() does nothing and
DefDlgProcA/W() are not hooked.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/static.c | 120 -----------------------------------
1 file changed, 120 deletions(-)
diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c
index 529396b3f0d..40a337b97b0 100644
--- a/dlls/comctl32/tests/static.c
+++ b/dlls/comctl32/tests/static.c
@@ -27,7 +27,6 @@
#include "winuser.h"
#include "commctrl.h"
#include "resources.h"
-#include "uxtheme.h"
#include "wine/test.h"
@@ -40,10 +39,6 @@
static HWND hMainWnd;
static int g_nReceivedColorStatic;
-static HRESULT (WINAPI *pEnableThemeDialogTexture)(HWND, DWORD);
-static HTHEME (WINAPI *pGetWindowTheme)(HWND);
-static BOOL (WINAPI *pIsThemeDialogTextureEnabled)(HWND);
-
/* try to make sure pending X events have been processed before continuing */
static void flush_events(void)
{
@@ -382,118 +377,6 @@ static void test_STM_SETIMAGE(void)
DeleteEnhMetaFile(emf);
}
-static INT_PTR CALLBACK test_WM_CTLCOLORSTATIC_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
-{
- static HWND child;
-
- switch (msg)
- {
- case WM_INITDIALOG:
- child = CreateWindowA(WC_STATICA, "child", WS_CHILD | WS_VISIBLE, 1, 2, 50, 50, hwnd,
- (HMENU)100, 0, NULL);
- ok(child != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
- return FALSE;
-
- case WM_CLOSE:
- DestroyWindow(child);
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
-static void test_WM_CTLCOLORSTATIC(void)
-{
- HWND parent, dialog, child;
- COLORREF color, old_color;
- HDC child_hdc, dialog_hdc;
- int mode, old_mode;
- HBRUSH brush;
- HRESULT hr;
- POINT org;
- BOOL ret;
-
- struct
- {
- DLGTEMPLATE tmplate;
- WORD menu;
- WORD class;
- WORD title;
- } temp = {{0}};
-
- parent = CreateWindowA(WC_STATICA, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 200, 200, 0, 0, 0,
- NULL);
- ok(parent != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
-
- temp.tmplate.style = WS_CHILD | WS_VISIBLE;
- temp.tmplate.cx = 80;
- temp.tmplate.cy = 80;
- dialog = CreateDialogIndirectParamA(NULL, &temp.tmplate, parent, test_WM_CTLCOLORSTATIC_proc, 0);
- ok(dialog != NULL, "CreateDialogIndirectParamA failed, error %d.\n", GetLastError());
- child = GetDlgItem(dialog, 100);
- ok(child != NULL, "Failed to get child static control, error %d.\n", GetLastError());
-
- dialog_hdc = GetDC(dialog);
- child_hdc = GetDC(child);
- PatBlt(dialog_hdc, 0, 0, 80, 80, BLACKNESS);
-
- old_mode = SetBkMode(child_hdc, OPAQUE);
- ok(old_mode != 0, "SetBkMode failed.\n");
- old_color = SetBkColor(child_hdc, 0xaa5511);
- ok(old_color != CLR_INVALID, "SetBkColor failed.\n");
-
- ret = pIsThemeDialogTextureEnabled(dialog);
- ok(ret, "Expected theme dialog texture supported.\n");
- ok(pGetWindowTheme(dialog) == NULL, "Expected NULL theme handle.\n");
-
- brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush == GetSysColorBrush(COLOR_BTNFACE), "Expected brush %p, got %p.\n",
- GetSysColorBrush(COLOR_BTNFACE), brush);
- color = SetBkColor(child_hdc, old_color);
- ok(color == GetSysColor(COLOR_BTNFACE), "Expected background color %#x, got %#x.\n",
- GetSysColor(COLOR_BTNFACE), color);
- mode = SetBkMode(child_hdc, old_mode);
- ok(mode == OPAQUE, "Expected mode %#x, got %#x.\n", OPAQUE, mode);
- color = GetPixel(dialog_hdc, 40, 40);
- ok(color == 0, "Expected pixel %#x, got %#x.\n", 0, color);
-
- /* Test that EnableThemeDialogTexture() doesn't make WM_CTLCOLORSTATIC return a different brush */
- hr = pEnableThemeDialogTexture(dialog, ETDT_DISABLE);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- ret = pIsThemeDialogTextureEnabled(dialog);
- ok(!ret, "Expected theme dialog texture disabled.\n");
- hr = pEnableThemeDialogTexture(dialog, ETDT_ENABLETAB);
- ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
- ret = pIsThemeDialogTextureEnabled(dialog);
- ok(ret, "Expected theme dialog texture enabled.\n");
-
- brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush == GetSysColorBrush(COLOR_BTNFACE), "Expected brush %p, got %p.\n",
- GetSysColorBrush(COLOR_BTNFACE), brush);
-
- /* Test that WM_CTLCOLORSTATIC doesn't change brush origin */
- ret = GetBrushOrgEx(child_hdc, &org);
- ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
- ok(org.x == 0 && org.y == 0, "Expected (0,0), got %s.\n", wine_dbgstr_point(&org));
-
- ReleaseDC(child, child_hdc);
- ReleaseDC(dialog, dialog_hdc);
- EndDialog(dialog, 0);
- DestroyWindow(parent);
-}
-
-static void init_functions(void)
-{
- HMODULE uxtheme = LoadLibraryA("uxtheme.dll");
-
-#define X(f) p##f = (void *)GetProcAddress(uxtheme, #f);
- X(EnableThemeDialogTexture)
- X(GetWindowTheme)
- X(IsThemeDialogTextureEnabled)
-#undef X
-}
-
START_TEST(static)
{
static const char classname[] = "testclass";
@@ -504,8 +387,6 @@ START_TEST(static)
if (!load_v6_module(&ctx_cookie, &hCtx))
return;
- init_functions();
-
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
@@ -536,7 +417,6 @@ START_TEST(static)
test_set_text();
test_set_image();
test_STM_SETIMAGE();
- test_WM_CTLCOLORSTATIC();
DestroyWindow(hMainWnd);
--
2.32.0
1
0