mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
testsuite: Create GL renderers without surfaces
This commit is contained in:
parent
869d2f281a
commit
0898023e6b
@ -765,7 +765,6 @@ add_test (const char *name,
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GdkSurface *surface;
|
||||
int result;
|
||||
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
@ -776,12 +775,10 @@ main (int argc, char *argv[])
|
||||
add_test ("/memorytexture/download_float_1x1", test_download_float_1x1);
|
||||
add_test ("/memorytexture/download_float_4x4", test_download_float_4x4);
|
||||
|
||||
surface = gdk_surface_new_toplevel (gdk_display_get_default());
|
||||
gl_renderer = gsk_gl_renderer_new ();
|
||||
if (!gsk_renderer_realize (gl_renderer, surface, NULL))
|
||||
if (!gsk_renderer_realize (gl_renderer, NULL, NULL))
|
||||
{
|
||||
g_clear_object (&gl_renderer);
|
||||
g_clear_object (&surface);
|
||||
}
|
||||
|
||||
result = g_test_run ();
|
||||
@ -791,7 +788,6 @@ main (int argc, char *argv[])
|
||||
gsk_renderer_unrealize (gl_renderer);
|
||||
g_clear_object (&gl_renderer);
|
||||
}
|
||||
g_clear_object (&surface);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -64,7 +64,6 @@ texture_download_thread (GTask *task,
|
||||
static void
|
||||
texture_threads (void)
|
||||
{
|
||||
GdkSurface *surface;
|
||||
GskRenderer *gl_renderer;
|
||||
GskRenderNode *node;
|
||||
GMainLoop *loop;
|
||||
@ -73,15 +72,13 @@ texture_threads (void)
|
||||
GError *error = NULL;
|
||||
|
||||
/* 1. Get a GL renderer */
|
||||
surface = gdk_surface_new_toplevel (gdk_display_get_default());
|
||||
gl_renderer = gsk_gl_renderer_new ();
|
||||
if (!gsk_renderer_realize (gl_renderer, surface, &error))
|
||||
if (!gsk_renderer_realize (gl_renderer, NULL, &error))
|
||||
{
|
||||
g_test_skip (error->message);
|
||||
|
||||
g_clear_error (&error);
|
||||
g_clear_object (&gl_renderer);
|
||||
g_clear_object (&surface);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -116,7 +113,6 @@ texture_threads (void)
|
||||
gsk_renderer_unrealize (gl_renderer);
|
||||
g_clear_pointer (&loop, g_main_loop_unref);
|
||||
g_clear_object (&gl_renderer);
|
||||
g_clear_object (&surface);
|
||||
g_main_context_release (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user