mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
Store XVisualInfo into the Xlib renderer
We want to be able to retrieve the XVisualInfo used when creating the GL context under GLX and EGL-X11, so that we can use the visual before we have an onscreen frame buffer.
This commit is contained in:
parent
0ad995746a
commit
19ca856810
@ -48,6 +48,8 @@ typedef struct _CoglXlibRenderer
|
||||
CoglXlibTrapState *trap_state;
|
||||
|
||||
unsigned long outputs_update_serial;
|
||||
|
||||
XVisualInfo *xvisinfo;
|
||||
} CoglXlibRenderer;
|
||||
|
||||
CoglBool
|
||||
|
@ -58,6 +58,11 @@ static GList *_cogl_xlib_renderers = NULL;
|
||||
static void
|
||||
destroy_xlib_renderer_data (void *user_data)
|
||||
{
|
||||
CoglXlibRenderer *data = user_data;
|
||||
|
||||
if (data->xvisinfo)
|
||||
XFree (data->xvisinfo);
|
||||
|
||||
g_slice_free (CoglXlibRenderer, user_data);
|
||||
}
|
||||
|
||||
@ -658,3 +663,15 @@ _cogl_xlib_renderer_output_for_rectangle (CoglRenderer *renderer,
|
||||
|
||||
return max_overlapped;
|
||||
}
|
||||
|
||||
XVisualInfo *
|
||||
cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer)
|
||||
{
|
||||
CoglXlibRenderer *xlib_renderer;
|
||||
|
||||
_COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL);
|
||||
|
||||
xlib_renderer = _cogl_xlib_renderer_get_data (renderer);
|
||||
|
||||
return xlib_renderer->xvisinfo;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#define __COGL_XLIB_RENDERER_H__
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
/* NB: this is a top-level header that can be included directly but we
|
||||
* want to be careful not to define __COGL_H_INSIDE__ when this is
|
||||
@ -169,6 +170,9 @@ cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
|
||||
Display *
|
||||
cogl_xlib_renderer_get_display (CoglRenderer *renderer);
|
||||
|
||||
XVisualInfo *
|
||||
cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer);
|
||||
|
||||
COGL_END_DECLS
|
||||
|
||||
/* The gobject introspection scanner seems to parse public headers in
|
||||
|
@ -1063,6 +1063,7 @@ cogl_xlib_handle_event
|
||||
cogl_xlib_renderer_add_filter
|
||||
cogl_xlib_renderer_get_display
|
||||
cogl_xlib_renderer_get_foreign_display
|
||||
cogl_xlib_renderer_get_visual_info
|
||||
cogl_xlib_renderer_handle_event
|
||||
cogl_xlib_renderer_remove_filter
|
||||
cogl_xlib_renderer_set_event_retrieval_enabled
|
||||
|
Loading…
Reference in New Issue
Block a user