We check the same extensions anyway, so no need to duplicate the code.
return FALSE;
}
+ self->have_egl_buffer_age =
+ epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_buffer_age");
+ self->have_egl_swap_buffers_with_damage =
+ epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_swap_buffers_with_damage");
+
GDK_DISPLAY_NOTE (self, OPENGL, {
char *ext = describe_extensions (priv->egl_display);
char *cfg = describe_egl_config (priv->egl_display, priv->egl_config);
g_free (ext);
});
-
gdk_profiler_end_mark (start_time, "init EGL", NULL);
return TRUE;
guint double_click_time; /* Maximum time between clicks in msecs */
guint double_click_distance; /* Maximum distance between clicks in pixels */
+ GList *seats;
+
#ifdef GDK_RENDERING_VULKAN
VkInstance vk_instance;
VkDebugReportCallbackEXT vk_debug_callback;
guint vulkan_refcount;
#endif /* GDK_RENDERING_VULKAN */
- GList *seats;
+ /* egl info */
+ guint have_egl_buffer_age : 1;
+ guint have_egl_swap_buffers_with_damage : 1;
};
struct _GdkDisplayClass
GListStore *monitors;
gint64 last_bell_time_ms;
-
- /* egl info */
-
- guint have_egl_buffer_age : 1;
- guint have_egl_swap_buffers_with_damage : 1;
};
struct _GdkWaylandDisplayClass
gdk_wayland_gl_context_get_damage (GdkGLContext *context)
{
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLSurface egl_surface;
GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
int buffer_age = 0;
- if (display_wayland->have_egl_buffer_age)
+ if (display->have_egl_buffer_age)
{
egl_surface = gdk_surface_get_egl_surface (surface);
gdk_gl_context_make_current (context);
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_surface_get_display (surface);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLSurface egl_surface;
GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->end_frame (draw_context, painted);
gdk_wayland_surface_request_frame (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "swap buffers");
- if (display_wayland->have_egl_swap_buffers_with_damage)
+ if (display->have_egl_swap_buffers_with_damage)
{
EGLint stack_rects[4 * 4]; /* 4 rects */
EGLint *heap_rects = NULL;
GError **error)
{
GdkWaylandDisplay *self = GDK_WAYLAND_DISPLAY (display);
- EGLDisplay egl_display;
if (!gdk_display_init_egl (display,
EGL_PLATFORM_WAYLAND_EXT,
return NULL;
}
- egl_display = gdk_display_get_egl_display (display);
-
- self->have_egl_buffer_age =
- epoxy_has_egl_extension (egl_display, "EGL_EXT_buffer_age");
-
- self->have_egl_swap_buffers_with_damage =
- epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage");
-
return g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
"display", display,
NULL);
self->egl_version = epoxy_egl_version (egl_display);
- self->has_egl_buffer_age =
- epoxy_has_egl_extension (egl_display, "EGL_EXT_buffer_age");
- self->has_egl_swap_buffers_with_damage =
- epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage");
-
return TRUE;
}
guint has_glx_visual_rating : 1;
guint has_glx_create_es2_context : 1;
guint has_async_glx_swap_buffers : 1;
-
- /* EGL extensions we check */
- guint has_egl_buffer_age : 1;
- guint has_egl_swap_buffers_with_damage : 1;
};
struct _GdkX11DisplayClass
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_surface_get_display (surface);
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
EGLSurface egl_surface;
GDK_DRAW_CONTEXT_CLASS (gdk_x11_gl_context_egl_parent_class)->end_frame (draw_context, painted);
egl_surface = gdk_surface_get_egl_surface (surface);
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "x11", "swap buffers");
- if (display_x11->has_egl_swap_buffers_with_damage)
+ if (display->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (painted);
int surface_height = gdk_surface_get_height (surface);
gdk_x11_gl_context_egl_get_damage (GdkGLContext *context)
{
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
- if (display_x11->has_egl_buffer_age)
+ if (display->have_egl_buffer_age)
{
GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
EGLSurface egl_surface;