[gtk/wip/otte/display-gl: 6/6] testsuite: Create GL renderers without surfaces




commit 272950c083e4ffe6c9b813fa1276f47c03449c7c
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 20 20:33:57 2021 +0200

    testsuite: Create GL renderers without surfaces

 testsuite/gdk/memorytexture.c   | 6 +-----
 testsuite/gdk/texture-threads.c | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c
index 03f8634c3f..712ff951cb 100644
--- a/testsuite/gdk/memorytexture.c
+++ b/testsuite/gdk/memorytexture.c
@@ -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;
 }
diff --git a/testsuite/gdk/texture-threads.c b/testsuite/gdk/texture-threads.c
index 5ca16e0ec5..17236070cf 100644
--- a/testsuite/gdk/texture-threads.c
+++ b/testsuite/gdk/texture-threads.c
@@ -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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]