From df12a41cbb440f2543086d865710240df8761cb5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Nov 2021 20:39:33 -0400 Subject: [PATCH 1/3] testsuite: Set GDK_DEBUG unconditionally The default-settings key works in non-debug builds too, nowadays. --- testsuite/meson.build | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/testsuite/meson.build b/testsuite/meson.build index 10fa16dfbc..97344f3062 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -8,12 +8,9 @@ common_env = [ 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), + 'GDK_DEBUG=default-settings', ] -if get_option('debug') - common_env += [ 'GDK_DEBUG=default-settings' ] -endif - if x11_enabled add_test_setup ('x11', env: common_env + [ @@ -30,16 +27,11 @@ if wayland_enabled 'TEST_OUTPUT_SUBDIR=wayland', ]) - if get_option('debug') - gdk_debug = 'GDK_DEBUG=gl-gles,default-settings' - else - gdk_debug = 'GDK_DEBUG=gl-gles' - endif add_test_setup ('waylandgles', env: common_env + [ 'GDK_BACKEND=wayland', 'TEST_OUTPUT_SUBDIR=waylandgles', - gdk_debug, + 'GDK_DEBUG=gl-gles,default-settings', ]) endif From 97365a8ffed47af484308ae70561858190414a1d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Nov 2021 20:40:22 -0400 Subject: [PATCH 2/3] reftest: Stop setting GDK_RENDERING That environment variable isn't used anymore. --- testsuite/reftests/gtk-reftest.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index b3f9774c73..cd933004f4 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -157,7 +157,7 @@ get_components_of_test_file (const char *test_file, if (basename) { char *base = g_path_get_basename (test_file); - + if (g_str_has_suffix (base, ".ui")) base[strlen (base) - strlen (".ui")] = '\0'; @@ -241,7 +241,7 @@ add_extra_css (const char *testname, { GtkStyleProvider *provider = NULL; char *css_file; - + css_file = get_test_file (testname, extension, TRUE); if (css_file == NULL) return NULL; @@ -254,7 +254,7 @@ add_extra_css (const char *testname, GTK_STYLE_PROVIDER_PRIORITY_FORCE); g_free (css_file); - + return provider; } @@ -276,7 +276,7 @@ save_image (GdkTexture *texture, GError *error = NULL; char *filename; gboolean ret; - + filename = get_output_file (test_name, extension, &error); if (filename == NULL) { @@ -301,7 +301,7 @@ save_node (GskRenderNode *node, char *filename; gboolean ret; GBytes *bytes; - + filename = get_output_file (test_name, extension, &error); if (filename == NULL) { @@ -444,7 +444,7 @@ add_test_for_file (GFile *file) g_object_unref (info); } - + g_assert_no_error (error); g_object_unref (enumerator); @@ -505,12 +505,6 @@ main (int argc, char **argv) { const char *basedir; int result; - - /* I don't want to fight fuzzy scaling algorithms in GPUs, - * so unless you explicitly set it to something else, we - * will use Cairo's image surface. - */ - g_setenv ("GDK_RENDERING", "image", FALSE); if (!parse_command_line (&argc, &argv)) return 1; @@ -525,7 +519,7 @@ main (int argc, char **argv) GFile *dir; dir = g_file_new_for_path (basedir); - + add_test_for_file (dir); g_object_unref (dir); From e017e4252b4270611bda973e02ea5862f6e4f102 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Nov 2021 20:43:01 -0400 Subject: [PATCH 3/3] reftest: No blinking, please Blinking cursors aren't helpful when we want to compare renderings pixel-by-pixel. Turn them off. --- testsuite/reftests/gtk-reftest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index cd933004f4..232108f46a 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -509,6 +509,13 @@ main (int argc, char **argv) if (!parse_command_line (&argc, &argv)) return 1; + /* Override some settings that otherwise might affect + * the reliability of our output. + */ + g_object_set (gtk_settings_get_default (), + "gtk-cursor-blink", FALSE, + NULL); + if (arg_base_dir) basedir = arg_base_dir; else