Skip to content

Commit

Permalink
Merge branch 'ebassi/egl-x11' into 'master'
Browse files Browse the repository at this point in the history
Prefer EGL to GLX for the GL support on X11

See merge request GNOME/gtk!3540
  • Loading branch information
ebassi committed May 10, 2021
2 parents 564d835 + 69856a9 commit 6120519
Show file tree
Hide file tree
Showing 11 changed files with 2,227 additions and 1,224 deletions.
1 change: 1 addition & 0 deletions gdk/gdk.c
Expand Up @@ -126,6 +126,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
{ "gl-gles", GDK_DEBUG_GL_GLES, "Use a GLES OpenGL context" },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11" },
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings" },
Expand Down
7 changes: 4 additions & 3 deletions gdk/gdkdebug.h
Expand Up @@ -41,9 +41,10 @@ typedef enum {
GDK_DEBUG_GL_LEGACY = 1 << 15,
GDK_DEBUG_GL_GLES = 1 << 16,
GDK_DEBUG_GL_DEBUG = 1 << 17,
GDK_DEBUG_VULKAN_DISABLE = 1 << 18,
GDK_DEBUG_VULKAN_VALIDATE = 1 << 19,
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 20
GDK_DEBUG_GL_GLX = 1 << 18,
GDK_DEBUG_VULKAN_DISABLE = 1 << 19,
GDK_DEBUG_VULKAN_VALIDATE = 1 << 20,
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 21
} GdkDebugFlags;

extern guint _gdk_debug_flags;
Expand Down
20 changes: 15 additions & 5 deletions gdk/x11/gdkdisplay-x11.h
Expand Up @@ -126,18 +126,28 @@ struct _GdkX11Display

int wm_moveresize_button;

#ifdef HAVE_XDAMAGE
int damage_event_base;
int damage_error_base;
guint have_damage;
#endif

/* GLX information */
int glx_version;
int glx_error_base;
int glx_event_base;

/* EGL information */
int egl_version;

/* Translation between X server time and system-local monotonic time */
gint64 server_time_query_time;
gint64 server_time_offset;

guint server_time_is_monotonic_time : 1;

guint have_glx : 1;
guint have_egl : 1;

/* GLX extensions we check */
guint has_glx_swap_interval : 1;
Expand All @@ -151,11 +161,11 @@ struct _GdkX11Display
guint has_glx_create_es2_context : 1;
guint has_async_glx_swap_buffers : 1;

#ifdef HAVE_XDAMAGE
int damage_event_base;
int damage_error_base;
guint have_damage;
#endif
/* EGL extensions we check */
guint has_egl_khr_create_context : 1;
guint has_egl_buffer_age : 1;
guint has_egl_swap_buffers_with_damage : 1;
guint has_egl_surfaceless_context : 1;
};

struct _GdkX11DisplayClass
Expand Down

0 comments on commit 6120519

Please sign in to comment.