Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- 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
November 2021
- 83 participants
- 2620 messages
[PATCH vkd3d 4/5] vkd3d-shader/hlsl: Align conditionals and loops in the IR dump.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c
index a72e0a18..6e5fad8c 100644
--- a/libs/vkd3d-shader/hlsl.c
+++ b/libs/vkd3d-shader/hlsl.c
@@ -1198,11 +1198,11 @@ static void dump_ir_if(struct hlsl_ctx *ctx, struct vkd3d_string_buffer *buffer,
{
vkd3d_string_buffer_printf(buffer, "if (");
dump_src(buffer, &if_node->condition);
- vkd3d_string_buffer_printf(buffer, ")\n{\n");
+ vkd3d_string_buffer_printf(buffer, ") {\n");
dump_instr_list(ctx, buffer, &if_node->then_instrs.instrs);
- vkd3d_string_buffer_printf(buffer, "}\nelse\n{\n");
+ vkd3d_string_buffer_printf(buffer, " %10s } else {\n", "");
dump_instr_list(ctx, buffer, &if_node->else_instrs.instrs);
- vkd3d_string_buffer_printf(buffer, "}\n");
+ vkd3d_string_buffer_printf(buffer, " %10s }", "");
}
static void dump_ir_jump(struct vkd3d_string_buffer *buffer, const struct hlsl_ir_jump *jump)
@@ -1229,9 +1229,9 @@ static void dump_ir_jump(struct vkd3d_string_buffer *buffer, const struct hlsl_i
static void dump_ir_loop(struct hlsl_ctx *ctx, struct vkd3d_string_buffer *buffer, const struct hlsl_ir_loop *loop)
{
- vkd3d_string_buffer_printf(buffer, "for (;;)\n{\n");
+ vkd3d_string_buffer_printf(buffer, "for (;;) {\n");
dump_instr_list(ctx, buffer, &loop->body.instrs);
- vkd3d_string_buffer_printf(buffer, "}\n");
+ vkd3d_string_buffer_printf(buffer, " %10s }", "");
}
static void dump_ir_resource_load(struct vkd3d_string_buffer *buffer, const struct hlsl_ir_resource_load *load)
--
2.33.1
Nov. 2, 2021
[PATCH vkd3d 3/5] vkd3d-shader/hlsl: Write SM4 conditionals.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl_sm4.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
index c022b5dd..3919725d 100644
--- a/libs/vkd3d-shader/hlsl_sm4.c
+++ b/libs/vkd3d-shader/hlsl_sm4.c
@@ -1358,6 +1358,33 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
}
}
+static void write_sm4_if(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_if *iff)
+{
+ struct sm4_instruction instr =
+ {
+ .opcode = VKD3D_SM4_OP_IF | VKD3D_SM4_CONDITIONAL_NZ,
+ .src_count = 1,
+ };
+ unsigned int writemask;
+
+ assert(iff->condition.node->data_type->dimx == 1);
+
+ sm4_register_from_node(&instr.srcs[0].reg, &writemask, iff->condition.node);
+ instr.srcs[0].swizzle = hlsl_swizzle_from_writemask(writemask);
+ write_sm4_instruction(buffer, &instr);
+
+ write_sm4_block(ctx, buffer, &iff->then_instrs);
+
+ instr.opcode = VKD3D_SM4_OP_ELSE;
+ instr.src_count = 0;
+ write_sm4_instruction(buffer, &instr);
+
+ write_sm4_block(ctx, buffer, &iff->else_instrs);
+
+ instr.opcode = VKD3D_SM4_OP_ENDIF;
+ write_sm4_instruction(buffer, &instr);
+}
+
static void write_sm4_load(struct hlsl_ctx *ctx,
struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_load *load)
{
@@ -1473,6 +1500,10 @@ static void write_sm4_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *
write_sm4_expr(ctx, buffer, hlsl_ir_expr(instr));
break;
+ case HLSL_IR_IF:
+ write_sm4_if(ctx, buffer, hlsl_ir_if(instr));
+ break;
+
case HLSL_IR_LOAD:
write_sm4_load(ctx, buffer, hlsl_ir_load(instr));
break;
--
2.33.1
Nov. 2, 2021
[PATCH vkd3d 2/5] vkd3d-shader/hlsl: Write SM4 loops.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl_sm4.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
index 0a9aac2a..c022b5dd 100644
--- a/libs/vkd3d-shader/hlsl_sm4.c
+++ b/libs/vkd3d-shader/hlsl_sm4.c
@@ -23,6 +23,8 @@
#include "vkd3d_d3dcommon.h"
#include "sm4.h"
+static void write_sm4_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer, const struct hlsl_block *block);
+
bool hlsl_sm4_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic,
bool output, enum vkd3d_sm4_register_type *type, bool *has_idx)
{
@@ -1375,6 +1377,22 @@ static void write_sm4_load(struct hlsl_ctx *ctx,
write_sm4_instruction(buffer, &instr);
}
+static void write_sm4_loop(struct hlsl_ctx *ctx,
+ struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_loop *loop)
+{
+ struct sm4_instruction instr =
+ {
+ .opcode = VKD3D_SM4_OP_LOOP,
+ };
+
+ write_sm4_instruction(buffer, &instr);
+
+ write_sm4_block(ctx, buffer, &loop->body);
+
+ instr.opcode = VKD3D_SM4_OP_ENDLOOP;
+ write_sm4_instruction(buffer, &instr);
+}
+
static void write_sm4_store(struct hlsl_ctx *ctx,
struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_store *store)
{
@@ -1459,6 +1477,10 @@ static void write_sm4_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *
write_sm4_load(ctx, buffer, hlsl_ir_load(instr));
break;
+ case HLSL_IR_LOOP:
+ write_sm4_loop(ctx, buffer, hlsl_ir_loop(instr));
+ break;
+
case HLSL_IR_STORE:
write_sm4_store(ctx, buffer, hlsl_ir_store(instr));
break;
--
2.33.1
Nov. 2, 2021
[PATCH vkd3d 1/5] vkd3d-shader/hlsl: Introduce a helper to write SM4 code blocks.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl_sm4.c | 97 +++++++++++++++++++-----------------
1 file changed, 52 insertions(+), 45 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
index 9d45e163..0a9aac2a 100644
--- a/libs/vkd3d-shader/hlsl_sm4.c
+++ b/libs/vkd3d-shader/hlsl_sm4.c
@@ -1422,13 +1422,63 @@ static void write_sm4_swizzle(struct hlsl_ctx *ctx,
write_sm4_instruction(buffer, &instr);
}
+static void write_sm4_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer,
+ const struct hlsl_block *block)
+{
+ const struct hlsl_ir_node *instr;
+
+ LIST_FOR_EACH_ENTRY(instr, &block->instrs, struct hlsl_ir_node, entry)
+ {
+ if (instr->data_type)
+ {
+ if (instr->data_type->type == HLSL_CLASS_MATRIX)
+ {
+ FIXME("Matrix operations need to be lowered.\n");
+ break;
+ }
+ else if (instr->data_type->type == HLSL_CLASS_OBJECT)
+ {
+ hlsl_fixme(ctx, instr->loc, "Object copy.\n");
+ break;
+ }
+
+ assert(instr->data_type->type == HLSL_CLASS_SCALAR || instr->data_type->type == HLSL_CLASS_VECTOR);
+ }
+
+ switch (instr->type)
+ {
+ case HLSL_IR_CONSTANT:
+ write_sm4_constant(ctx, buffer, hlsl_ir_constant(instr));
+ break;
+
+ case HLSL_IR_EXPR:
+ write_sm4_expr(ctx, buffer, hlsl_ir_expr(instr));
+ break;
+
+ case HLSL_IR_LOAD:
+ write_sm4_load(ctx, buffer, hlsl_ir_load(instr));
+ break;
+
+ case HLSL_IR_STORE:
+ write_sm4_store(ctx, buffer, hlsl_ir_store(instr));
+ break;
+
+ case HLSL_IR_SWIZZLE:
+ write_sm4_swizzle(ctx, buffer, hlsl_ir_swizzle(instr));
+ break;
+
+ default:
+ FIXME("Unhandled instruction type %s.\n", hlsl_node_type_to_string(instr->type));
+ }
+ }
+}
+
static void write_sm4_shdr(struct hlsl_ctx *ctx,
const struct hlsl_ir_function_decl *entry_func, struct dxbc_writer *dxbc)
{
const struct hlsl_profile_info *profile = ctx->profile;
struct vkd3d_bytecode_buffer buffer = {0};
const struct hlsl_buffer *cbuffer;
- const struct hlsl_ir_node *instr;
const struct hlsl_ir_var *var;
size_t token_count_position;
@@ -1472,50 +1522,7 @@ static void write_sm4_shdr(struct hlsl_ctx *ctx,
if (ctx->temp_count)
write_sm4_dcl_temps(&buffer, ctx->temp_count);
- LIST_FOR_EACH_ENTRY(instr, &entry_func->body.instrs, struct hlsl_ir_node, entry)
- {
- if (instr->data_type)
- {
- if (instr->data_type->type == HLSL_CLASS_MATRIX)
- {
- FIXME("Matrix operations need to be lowered.\n");
- break;
- }
- else if (instr->data_type->type == HLSL_CLASS_OBJECT)
- {
- hlsl_fixme(ctx, instr->loc, "Object copy.\n");
- break;
- }
-
- assert(instr->data_type->type == HLSL_CLASS_SCALAR || instr->data_type->type == HLSL_CLASS_VECTOR);
- }
-
- switch (instr->type)
- {
- case HLSL_IR_CONSTANT:
- write_sm4_constant(ctx, &buffer, hlsl_ir_constant(instr));
- break;
-
- case HLSL_IR_EXPR:
- write_sm4_expr(ctx, &buffer, hlsl_ir_expr(instr));
- break;
-
- case HLSL_IR_LOAD:
- write_sm4_load(ctx, &buffer, hlsl_ir_load(instr));
- break;
-
- case HLSL_IR_STORE:
- write_sm4_store(ctx, &buffer, hlsl_ir_store(instr));
- break;
-
- case HLSL_IR_SWIZZLE:
- write_sm4_swizzle(ctx, &buffer, hlsl_ir_swizzle(instr));
- break;
-
- default:
- FIXME("Unhandled instruction type %s.\n", hlsl_node_type_to_string(instr->type));
- }
- }
+ write_sm4_block(ctx, &buffer, &entry_func->body);
write_sm4_ret(&buffer);
--
2.33.1
Nov. 2, 2021
libFAudio-dev -build requirement
by Sveinar Søpler
Hi
I see now as of wine-devel-6.20, wine is built with /libs/faudio source as PE. I know the overall plan is to get distro's to provide the PE packages, but i would think this is still a bit ahead in time (atleast for some distro's)
ref:
[ https://github.com/wine-mirror/wine/commit/6b45777121fcd50d9b7d5b649c671006… | https://github.com/wine-mirror/wine/commit/6b45777121fcd50d9b7d5b649c671006… ]
[ https://github.com/wine-mirror/wine/commit/d8be85863fedf6982944d06ebd1ce590… | https://github.com/wine-mirror/wine/commit/d8be85863fedf6982944d06ebd1ce590… ]
and
libs: Import code from upstream FAudio 21.10.
xaudio: Use the bundled FAudio and build with msvcrt.
Does this mean that libFAudio-dev requirement for package build on OBS can be dropped? Distro(s) in question is then Debian/Ubuntu, and packages would be wine-devel-6.21+ and wine-staging-6.21+
The note on libFAudio-21.11 also sais this:
Deprecated Features:
* GStreamer support is now deprecated.
o Wine users should migrate to 6.20 and newer, and everyone else
should move to codecs that are not patent-encumbered.
o GStreamer support will be fully removed in the first release
after Wine 7.0.
Removed Features:
* Removed the C++ wrapper. Use the headers/PE binaries found in Wine
6.20 and newer.
PS. I am aware that libFAudio.so.0 would still be required for < wine-devel/staging-6.19 and wine-stable-6.0, but the above would (to me) indicate that configure no longer checks for the systemlib development package, and thus build-depends: libFAudio-dev could be dropped when building packages.
Sveinar
Nov. 2, 2021
[PATCH] configure.ac: allow expressing dwarf version in CFLAGS and CROSSCFLAGS
by Eric Pouech
usage:
configure CFLAGS="-gdwarf-4 -O2"
will enable dwarf4 compilation for ELF parts
(and CROSSCFLAGS="-gdwarf-4 -O2" for PE parts)
evolution from current behavior:
- when CFLAGS contains "-gdwarf-X", -gdwarf-X option is not tested with
WINE_TRY_CFLAGS (the option remains anyway in CFLAGS -so WINE_TRY is
useless- and is not copied in EXTRACFLAGS) (ditto for CROSSCFLAGS)
- using CROSSCFLAGS=-gdwarf is no longer converted to Wine's default
format, but is kepts as is, hence will boil down to compiler's
preferred dwarf version
- CROSSDEBUG=split used to pick up compiler's default format
(while CROSSDEBUG=split-dwarf picked up wine's default format).
They both now pick up the format derived from or specified in
CROSSCLAGS (if any)
what remains undone (and could be improved):
- no test that the final configuration is suitable for Wine (ie
if WINE_TRY_CFLAGS fails on -gdwarf-2, compilation is done with
compilers's default format => dwarf5 on Linux)
Changes from previous version:
- fixed handling of "-g -gcodeview" in CROSSCFLAGS
- fixed CROSSDEBUG=split* (mixup between split-dwarf and dwarf-split)
open question:
- I kept the original behavior, when providing as configure args (and
not providing CROSSCFLAGS in configure args):
CROSSDEBUG=pdb
to add -gcodeview to EXTRACROSSCFLAGS
It could be simplified with no longer supporting CROSSDEBUG from
command line, but:
+ set CROSSDEBUG=pdb in configure when -gcodeview
option is present is CROSSCFLAGS
+ set CROSSDEBUG=split in configure when -gsplit-dwarf
option is present is CROSSCFLAGS
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
configure.ac | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7c1e446814b..99347813a13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1008,21 +1008,24 @@ then
dnl Determine debug info format
AC_SUBST(CROSSDEBUG)
- if test -z "$CROSSDEBUG"
+ ac_debug_format_seen=
+ for ac_flag in $CROSSCFLAGS; do
+ case $ac_flag in
+ -gdwarf*) ac_debug_format_seen=yes ;;
+ -g) ac_debug_format_seen=${ac_debug_format_seen:-default} ;;
+ -gcodeview) ac_debug_format_seen=yes ;;
+ esac
+ done
+ if test "x$ac_debug_format_seen" = "xdefault" -a "x$CROSSDEBUG" = "xpdb"
then
- for ac_flag in $CROSSCFLAGS; do
- case $ac_flag in
- -gdwarf*) CROSSDEBUG=dwarf ;;
- -gcodeview) CROSSDEBUG=pdb ;;
- -g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;;
- esac
- done
+ WINE_TRY_CROSSCFLAGS([-gcodeview])
+ ac_debug_format_seen=yes
+ fi
+ if test "x$ac_debug_format_seen" = "xdefault"
+ then
+ WINE_TRY_CROSSCFLAGS([-gdwarf-2])
+ WINE_TRY_CROSSCFLAGS([-gstrict-dwarf])
fi
- case $CROSSDEBUG in
- *dwarf) WINE_TRY_CROSSCFLAGS([-gdwarf-2])
- WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
- pdb) WINE_TRY_CROSSCFLAGS([-gcodeview]) ;;
- esac
WINE_TRY_CROSSCFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")])
@@ -1822,13 +1825,18 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
*) EXTRACFLAGS="$EXTRACFLAGS $wine_cv_64bit_compare_swap" ;;
esac
- dnl Default to dwarf-2 debug info
+ dnl Determine debug info format
+ ac_debug_format_seen=
for ac_flag in $CFLAGS; do
case $ac_flag in
- -g) WINE_TRY_CFLAGS([-gdwarf-2])
- WINE_TRY_CFLAGS([-gstrict-dwarf]) ;;
+ -gdwarf*) ac_debug_format_seen=yes ;;
+ -g) ac_debug_format_seen=${ac_debug_format_seen:-default} ;;
esac
done
+ if test "x$ac_debug_format_seen" = "xdefault"; then
+ WINE_TRY_CFLAGS([-gdwarf-2])
+ WINE_TRY_CFLAGS([-gstrict-dwarf])
+ fi
dnl Disable gcc builtins except for Mingw
AC_SUBST(MSVCRTFLAGS,"")
Nov. 2, 2021
[PATCH 2/2] comctl32/button: Use BS_PUSHLIKE instead of WS_EX_RIGHT in BUTTON_PositionRect().
by Zhiyi Zhang
BS_PUSHLIKE and WS_EX_RIGHT have the same value and it was a typo to use WS_EX_RIGHT.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/button.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index b3331e179cd..fbe060513d2 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -1122,7 +1122,7 @@ static void BUTTON_PositionRect(LONG style, const RECT *outerRect, RECT *innerRe
INT width = innerRect->right - innerRect->left;
INT height = innerRect->bottom - innerRect->top;
- if ((style & WS_EX_RIGHT) && !(style & BS_CENTER)) style |= BS_CENTER;
+ if ((style & BS_PUSHLIKE) && !(style & BS_CENTER)) style |= BS_CENTER;
if (!(style & BS_CENTER))
{
--
2.32.0
Nov. 2, 2021
[PATCH 1/2] comctl32/button: Remove useless calculation for drawing group boxes.
by Zhiyi Zhang
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/button.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index b576e6c6db6..b3331e179cd 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -2113,10 +2113,6 @@ static void GB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
labelRect.right++;
labelRect.bottom++;
FillRect(hDC, &labelRect, hbr);
- labelRect.left++;
- labelRect.right--;
- labelRect.bottom--;
-
BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect);
}
SelectClipRgn( hDC, hrgn );
--
2.32.0
Nov. 2, 2021
[PATCH 6/6] uxtheme: Implement GetThemeTransitionDuration().
by Zhiyi Zhang
Fix Nokia SDK 2.0 for Java installer buttons not changing state after clicking.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/metric.c | 30 +++++++++++++++++++++++++++---
dlls/uxtheme/tests/system.c | 22 ++++------------------
2 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/dlls/uxtheme/metric.c b/dlls/uxtheme/metric.c
index b7c173740d7..3ef199bcca7 100644
--- a/dlls/uxtheme/metric.c
+++ b/dlls/uxtheme/metric.c
@@ -228,8 +228,32 @@ HRESULT WINAPI GetThemeSysString(HTHEME hTheme, int iStringID,
HRESULT WINAPI GetThemeTransitionDuration(HTHEME hTheme, int iPartId, int iStateIdFrom,
int iStateIdTo, int iPropId, DWORD *pdwDuration)
{
- FIXME("(%p, %u, %u, %u, %u, %p) stub\n", hTheme, iPartId, iStateIdFrom, iStateIdTo,
- iPropId, pdwDuration);
+ INTLIST intlist;
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("(%p, %d, %d, %d, %d, %p)\n", hTheme, iPartId, iStateIdFrom, iStateIdTo, iPropId,
+ pdwDuration);
+
+ if (!pdwDuration || iStateIdFrom < 1 || iStateIdTo < 1)
+ return E_INVALIDARG;
+
+ hr = GetThemeIntList(hTheme, iPartId, 0, iPropId, &intlist);
+ if (FAILED(hr))
+ {
+ if (hr == E_PROP_ID_UNSUPPORTED)
+ *pdwDuration = 0;
+
+ return hr;
+ }
+
+ if (intlist.iValueCount < 1 || iStateIdFrom > intlist.iValues[0]
+ || iStateIdTo > intlist.iValues[0]
+ || intlist.iValueCount != 1 + intlist.iValues[0] * intlist.iValues[0])
+ {
+ *pdwDuration = 0;
+ return E_INVALIDARG;
+ }
+
+ *pdwDuration = intlist.iValues[1 + intlist.iValues[0] * (iStateIdFrom - 1) + (iStateIdTo - 1)];
+ return S_OK;
}
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 57901e6affb..10857115061 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1329,74 +1329,64 @@ static void test_GetThemeTransitionDuration(void)
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(NULL, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+ /* Crash on Wine. HTHEME is not a pointer that can be directly referenced. */
+ if (strcmp(winetest_platform, "wine"))
+ {
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration((HTHEME)0xdeadbeef, BP_PUSHBUTTON, PBS_NORMAL,
PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration);
todo_wine
ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+ }
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, 0xdeadbeef, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL - 1, PBS_DEFAULTED_ANIMATING,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_DEFAULTED_ANIMATING + 1,
PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_NORMAL - 1,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING + 1,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
TMT_BACKGROUND, &duration);
- todo_wine
ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
0xdeadbeef, &duration);
- todo_wine
ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
TMT_TRANSITIONDURATIONS, NULL);
- todo_wine
ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
/* Parts that don't have TMT_TRANSITIONDURATIONS */
@@ -1406,9 +1396,7 @@ static void test_GetThemeTransitionDuration(void)
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_GROUPBOX, GBS_NORMAL, GBS_DISABLED,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
- todo_wine
ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
/* Test parsing TMT_TRANSITIONDURATIONS property. TMT_TRANSITIONDURATIONS is a vista+ property */
@@ -1436,10 +1424,8 @@ static void test_GetThemeTransitionDuration(void)
duration = 0xdeadbeef;
hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, from_state, to_state,
TMT_TRANSITIONDURATIONS, &duration);
- todo_wine
ok(hr == S_OK, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
expected = intlist.iValues[1 + intlist.iValues[0] * (from_state - 1) + (to_state - 1)];
- todo_wine
ok(duration == expected, "Expected duration %d, got %d.\n", expected, duration);
winetest_pop_context();
--
2.32.0
Nov. 2, 2021
[PATCH 5/6] uxtheme/tests: Add GetThemeTransitionDuration() tests.
by Zhiyi Zhang
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/tests/system.c | 154 ++++++++++++++++++++++++++++++++++++
1 file changed, 154 insertions(+)
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 541d46deeaa..57901e6affb 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -43,6 +43,7 @@ static HDC (WINAPI *pGetBufferedPaintDC)(HPAINTBUFFER);
static HDC (WINAPI *pGetBufferedPaintTargetDC)(HPAINTBUFFER);
static HRESULT (WINAPI *pGetBufferedPaintTargetRect)(HPAINTBUFFER, RECT *);
static HRESULT (WINAPI *pGetThemeIntList)(HTHEME, int, int, int, INTLIST *);
+static HRESULT (WINAPI *pGetThemeTransitionDuration)(HTHEME, int, int, int, int, DWORD *);
static LONG (WINAPI *pDisplayConfigGetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *);
static LONG (WINAPI *pDisplayConfigSetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *);
@@ -81,6 +82,7 @@ static void init_funcs(void)
GET_PROC(uxtheme, GetBufferedPaintTargetDC)
GET_PROC(uxtheme, GetBufferedPaintTargetRect)
GET_PROC(uxtheme, GetThemeIntList)
+ GET_PROC(uxtheme, GetThemeTransitionDuration)
GET_PROC(uxtheme, OpenThemeDataEx)
GET_PROC(uxtheme, OpenThemeDataForDpi)
@@ -1299,6 +1301,157 @@ static void test_GetThemeIntList(void)
DestroyWindow(hwnd);
}
+static void test_GetThemeTransitionDuration(void)
+{
+ int from_state, to_state, expected;
+ INTLIST intlist;
+ DWORD duration;
+ HTHEME theme;
+ HRESULT hr;
+ HWND hwnd;
+
+ if (!pGetThemeTransitionDuration || !pGetThemeIntList)
+ {
+ win_skip("GetThemeTransitionDuration or GetThemeIntList is unavailable.\n");
+ return;
+ }
+
+ hwnd = CreateWindowA("static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL);
+ theme = OpenThemeData(hwnd, L"Button");
+ if (!theme)
+ {
+ skip("Theming is not active.\n");
+ DestroyWindow(hwnd);
+ return;
+ }
+
+ /* Invalid parameter tests */
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(NULL, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration((HTHEME)0xdeadbeef, BP_PUSHBUTTON, PBS_NORMAL,
+ PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, 0xdeadbeef, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL - 1, PBS_DEFAULTED_ANIMATING,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_DEFAULTED_ANIMATING + 1,
+ PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_NORMAL - 1,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING + 1,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
+ TMT_BACKGROUND, &duration);
+ todo_wine
+ ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
+ 0xdeadbeef, &duration);
+ todo_wine
+ ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING,
+ TMT_TRANSITIONDURATIONS, NULL);
+ todo_wine
+ ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+
+ /* Parts that don't have TMT_TRANSITIONDURATIONS */
+ hr = GetThemeIntList(theme, BP_GROUPBOX, GBS_NORMAL, TMT_TRANSITIONDURATIONS, &intlist);
+ ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeIntList failed, hr %#x.\n", hr);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_GROUPBOX, GBS_NORMAL, GBS_DISABLED,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ todo_wine
+ ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration);
+
+ /* Test parsing TMT_TRANSITIONDURATIONS property. TMT_TRANSITIONDURATIONS is a vista+ property */
+ if (LOBYTE(LOWORD(GetVersion())) < 6)
+ goto done;
+
+ hr = pGetThemeIntList(theme, BP_PUSHBUTTON, PBS_NORMAL, TMT_TRANSITIONDURATIONS, &intlist);
+ ok(hr == S_OK, "GetThemeIntList failed, hr %#x.\n", hr);
+ /* The first value is the theme part state count. The following are the values from every state
+ * to every state. So the total value count should be 1 + state ^ 2 */
+ expected = PBS_DEFAULTED_ANIMATING - PBS_NORMAL + 1;
+ ok(intlist.iValues[0] == expected, "Expected the first value %d, got %d.\n", expected,
+ intlist.iValues[0]);
+ expected = 1 + intlist.iValues[0] * intlist.iValues[0];
+ ok(intlist.iValueCount == expected, "Expected value count %d, got %d.\n", expected,
+ intlist.iValueCount);
+ if (hr == S_OK)
+ {
+ for (from_state = PBS_NORMAL; from_state <= PBS_DEFAULTED_ANIMATING; ++from_state)
+ {
+ for (to_state = PBS_NORMAL; to_state <= PBS_DEFAULTED_ANIMATING; ++to_state)
+ {
+ winetest_push_context("from state %d to %d", from_state, to_state);
+
+ duration = 0xdeadbeef;
+ hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, from_state, to_state,
+ TMT_TRANSITIONDURATIONS, &duration);
+ todo_wine
+ ok(hr == S_OK, "GetThemeTransitionDuration failed, hr %#x.\n", hr);
+ expected = intlist.iValues[1 + intlist.iValues[0] * (from_state - 1) + (to_state - 1)];
+ todo_wine
+ ok(duration == expected, "Expected duration %d, got %d.\n", expected, duration);
+
+ winetest_pop_context();
+ }
+ }
+ }
+
+done:
+ CloseThemeData(theme);
+ DestroyWindow(hwnd);
+}
+
START_TEST(system)
{
init_funcs();
@@ -1319,6 +1472,7 @@ START_TEST(system)
test_CloseThemeData();
test_buffered_paint();
test_GetThemeIntList();
+ test_GetThemeTransitionDuration();
/* Test EnableTheming() in the end because it may disable theming */
test_EnableTheming();
--
2.32.0
Nov. 2, 2021