testsuite: Use gsk_renderer_realize_for_display()

... in all the places where we used realize (NULL) before.
This commit is contained in:
Benjamin Otte 2024-01-07 10:07:48 +01:00
parent b486588883
commit e2c8b7fa6c
3 changed files with 9 additions and 6 deletions

View File

@ -1453,6 +1453,7 @@ add_conversion_test (const char *name,
int
main (int argc, char *argv[])
{
GdkDisplay *display;
int result;
gtk_test_init (&argc, &argv, NULL);
@ -1462,26 +1463,28 @@ main (int argc, char *argv[])
add_conversion_test ("/memorytexture/conversion_1x1", test_conversion_1x1);
add_conversion_test ("/memorytexture/conversion_random", test_conversion_random);
gl_context = gdk_display_create_gl_context (gdk_display_get_default (), NULL);
display = gdk_display_get_default ();
gl_context = gdk_display_create_gl_context (display, NULL);
if (gl_context == NULL || !gdk_gl_context_realize (gl_context, NULL))
{
g_clear_object (&gl_context);
}
gl_renderer = gsk_gl_renderer_new ();
if (!gsk_renderer_realize (gl_renderer, NULL, NULL))
if (!gsk_renderer_realize_for_display (gl_renderer, display, NULL))
{
g_clear_object (&gl_renderer);
}
ngl_renderer = gsk_ngl_renderer_new ();
if (!gsk_renderer_realize (ngl_renderer, NULL, NULL))
if (!gsk_renderer_realize_for_display (ngl_renderer, display, NULL))
{
g_clear_object (&ngl_renderer);
}
vulkan_renderer = gsk_vulkan_renderer_new ();
if (!gsk_renderer_realize (vulkan_renderer, NULL, NULL))
if (!gsk_renderer_realize_for_display (vulkan_renderer, display, NULL))
{
g_clear_object (&vulkan_renderer);
}

View File

@ -67,7 +67,7 @@ texture_threads (void)
/* 1. Get a GL renderer */
gl_renderer = gsk_gl_renderer_new ();
if (!gsk_renderer_realize (gl_renderer, NULL, &error))
if (!gsk_renderer_realize_for_display (gl_renderer, gdk_display_get_default (), &error))
{
g_test_skip (error->message);

View File

@ -1046,7 +1046,7 @@ create_renderers (void)
for (i = 0; i < G_N_ELEMENTS (renderers); i++)
{
renderers[i].renderer = renderers[i].create_func ();
if (!gsk_renderer_realize (renderers[i].renderer, NULL, &error))
if (!gsk_renderer_realize_for_display (renderers[i].renderer, gdk_display_get_default (), &error))
{
g_test_message ("Could not realize %s renderer: %s", renderers[i].name, error->message);
g_clear_error (&error);