[gtk/wip/otte/float-textures: 10/12] testsuite: Add tests uploading the memorytextures
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/float-textures: 10/12] testsuite: Add tests uploading the memorytextures
- Date: Sun, 12 Sep 2021 03:19:44 +0000 (UTC)
commit 69ce036a8237949487b239595e9e704efe1ae328
Author: Benjamin Otte <otte redhat com>
Date: Sat Sep 11 22:50:09 2021 +0200
testsuite: Add tests uploading the memorytextures
Use a GL renderer and render_texture() them.
testsuite/gdk/memorytexture.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c
index c3cbc71e2b..bb379da18c 100644
--- a/testsuite/gdk/memorytexture.c
+++ b/testsuite/gdk/memorytexture.c
@@ -1,8 +1,11 @@
-#include <locale.h>
-#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
+#include "gsk/ngl/gsknglrenderer.h"
#define N 50
+static GskRenderer *gl_renderer = NULL;
+
typedef struct _TextureBuilder TextureBuilder;
struct _TextureBuilder
@@ -412,10 +415,26 @@ add_test (const char *name,
int
main (int argc, char *argv[])
{
- (g_test_init) (&argc, &argv, NULL);
+ GdkSurface *surface;
+ int result;
+
+ gtk_test_init (&argc, &argv, NULL);
add_test ("/memorytexture/download_1x1", test_download_1x1);
add_test ("/memorytexture/download_4x4", test_download_4x4);
- return g_test_run ();
+ surface = gdk_surface_new_toplevel (gdk_display_get_default());
+ gl_renderer = gsk_ngl_renderer_new ();
+ if (!gsk_renderer_realize (gl_renderer, surface, NULL))
+ {
+ g_clear_object (&gl_renderer);
+ g_clear_object (&surface);
+ }
+
+ result = g_test_run ();
+
+ g_clear_object (&gl_renderer);
+ g_clear_object (&surface);
+
+ return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]