summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-15 19:11:35 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-15 19:11:35 -0400
commit013401b594cac5c5e1ee5541789703784acfa969 (patch)
tree4b2bbadbb3e7df3e695cfc0c1248eea2c1a09fb8
parent0152286fa0a585e729d0a39efc1dc926b11b0ab2 (diff)
downloadgtk+-013401b594cac5c5e1ee5541789703784acfa969.tar.gz
Fix texture tests with GLES
No sync for you if you're using GLES.
-rw-r--r--testsuite/gdk/gltexture.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/testsuite/gdk/gltexture.c b/testsuite/gdk/gltexture.c
index f1145647c3..cb00e842ff 100644
--- a/testsuite/gdk/gltexture.c
+++ b/testsuite/gdk/gltexture.c
@@ -1,6 +1,7 @@
#include <gtk/gtk.h>
#include <epoxy/gl.h>
#include "gdk/gdktextureprivate.h"
+#include "gdk/gdkglcontextprivate.h"
static cairo_surface_t *
make_surface (void)
@@ -177,7 +178,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS
id = make_gl_texture (context, surface);
- sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ if (gdk_gl_context_has_sync (context))
+ sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ else
+ sync = NULL;
update_region = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { 10, 10, 32, 32 });
@@ -219,7 +223,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
cairo_surface_destroy (surface);
- glDeleteSync (sync);
+ if (sync)
+ glDeleteSync (sync);
cairo_region_destroy (update_region);
g_object_unref (old_texture);