remove _cogl_xlib_trap/untrap_errors wrappers
This removes the redundant _cogl_xlib_trap/untrap_errors functions that simply wrap equivalent functions in the _cogl_renderer_xlib namespace. These were originally only required while the EGL winsys was being handled in clutter and so there wasn't a CoglRenderer in all cases.
This commit is contained in:
parent
43c4b21a1d
commit
8c35a6bb7c
@ -49,13 +49,14 @@ _cogl_renderer_xlib_disconnect (CoglRenderer *renderer);
|
|||||||
* cogl_renderer_xlib_trap_errors:
|
* cogl_renderer_xlib_trap_errors:
|
||||||
* @state: A temporary place to store data for the trap.
|
* @state: A temporary place to store data for the trap.
|
||||||
*
|
*
|
||||||
* Traps every X error until _cogl_xlib_untrap_errors() called. You
|
* Traps every X error until _cogl_renderer_xlib_untrap_errors()
|
||||||
* should allocate an uninitialised CoglXlibTrapState struct on the
|
* called. You should allocate an uninitialised CoglXlibTrapState
|
||||||
* stack to pass to this function. The same pointer should later be
|
* struct on the stack to pass to this function. The same pointer
|
||||||
* passed to _cogl_xlib_untrap_errors(). Calls to
|
* should later be passed to _cogl_renderer_xlib_untrap_errors().
|
||||||
* _cogl_xlib_trap_errors() can be nested as long as
|
*
|
||||||
* _cogl_xlib_untrap_errors() is called with the corresponding state
|
* Calls to _cogl_renderer_xlib_trap_errors() can be nested as long as
|
||||||
* pointers in reverse order.
|
* _cogl_renderer_xlib_untrap_errors() is called with the
|
||||||
|
* corresponding state pointers in reverse order.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_cogl_renderer_xlib_trap_errors (CoglRenderer *renderer,
|
_cogl_renderer_xlib_trap_errors (CoglRenderer *renderer,
|
||||||
@ -63,7 +64,7 @@ _cogl_renderer_xlib_trap_errors (CoglRenderer *renderer,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* cogl_renderer_xlib_untrap_errors:
|
* cogl_renderer_xlib_untrap_errors:
|
||||||
* @state: The state that was passed to _cogl_xlib_trap_errors().
|
* @state: The state that was passed to _cogl_renderer_xlib_trap_errors().
|
||||||
*
|
*
|
||||||
* Removes the X error trap and returns the current status.
|
* Removes the X error trap and returns the current status.
|
||||||
*
|
*
|
||||||
|
@ -46,12 +46,6 @@ _cogl_xlib_query_damage_extension (void);
|
|||||||
int
|
int
|
||||||
_cogl_xlib_get_damage_base (void);
|
_cogl_xlib_get_damage_base (void);
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_xlib_trap_errors (CoglXlibTrapState *state);
|
|
||||||
|
|
||||||
int
|
|
||||||
_cogl_xlib_untrap_errors (CoglXlibTrapState *state);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _cogl_xlib_add_filter:
|
* _cogl_xlib_add_filter:
|
||||||
*
|
*
|
||||||
|
@ -99,23 +99,6 @@ _cogl_xlib_remove_filter (CoglNativeFilterFunc func,
|
|||||||
cogl_renderer_remove_native_filter (ctx->display->renderer, func, data);
|
cogl_renderer_remove_native_filter (ctx->display->renderer, func, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_xlib_trap_errors (CoglXlibTrapState *state)
|
|
||||||
{
|
|
||||||
_COGL_GET_CONTEXT (ctxt, NO_RETVAL);
|
|
||||||
|
|
||||||
_cogl_renderer_xlib_trap_errors (ctxt->display->renderer, state);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
_cogl_xlib_untrap_errors (CoglXlibTrapState *state)
|
|
||||||
{
|
|
||||||
_COGL_GET_CONTEXT (ctxt, 0);
|
|
||||||
|
|
||||||
return _cogl_renderer_xlib_untrap_errors (ctxt->display->renderer, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_cogl_xlib_query_damage_extension (void)
|
_cogl_xlib_query_damage_extension (void)
|
||||||
{
|
{
|
||||||
|
@ -1366,7 +1366,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
|
#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
|
||||||
_cogl_xlib_trap_errors (&old_state);
|
_cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state);
|
||||||
|
|
||||||
if (!xlib_onscreen->is_foreign_xwin && xlib_onscreen->xwin != None)
|
if (!xlib_onscreen->is_foreign_xwin && xlib_onscreen->xwin != None)
|
||||||
{
|
{
|
||||||
@ -1378,7 +1378,8 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
|||||||
|
|
||||||
XSync (xlib_renderer->xdpy, False);
|
XSync (xlib_renderer->xdpy, False);
|
||||||
|
|
||||||
if (_cogl_xlib_untrap_errors (&old_state) != Success)
|
if (_cogl_renderer_xlib_untrap_errors (context->display->renderer,
|
||||||
|
&old_state) != Success)
|
||||||
g_warning ("X Error while destroying X window");
|
g_warning ("X Error while destroying X window");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
|||||||
if (glx_onscreen == NULL)
|
if (glx_onscreen == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_cogl_xlib_trap_errors (&old_state);
|
_cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state);
|
||||||
|
|
||||||
if (glx_onscreen->glxwin != None)
|
if (glx_onscreen->glxwin != None)
|
||||||
{
|
{
|
||||||
@ -883,7 +883,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
|
|||||||
|
|
||||||
XSync (xlib_renderer->xdpy, False);
|
XSync (xlib_renderer->xdpy, False);
|
||||||
|
|
||||||
_cogl_xlib_untrap_errors (&old_state);
|
_cogl_renderer_xlib_untrap_errors (context->display->renderer, &old_state);
|
||||||
|
|
||||||
g_slice_free (CoglOnscreenGLX, onscreen->winsys);
|
g_slice_free (CoglOnscreenGLX, onscreen->winsys);
|
||||||
onscreen->winsys = NULL;
|
onscreen->winsys = NULL;
|
||||||
@ -912,7 +912,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
|||||||
if (glx_context->current_drawable == drawable)
|
if (glx_context->current_drawable == drawable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_cogl_xlib_trap_errors (&old_state);
|
_cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state);
|
||||||
|
|
||||||
glXMakeContextCurrent (xlib_renderer->xdpy,
|
glXMakeContextCurrent (xlib_renderer->xdpy,
|
||||||
drawable, drawable,
|
drawable, drawable,
|
||||||
@ -926,7 +926,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
|||||||
if (glx_context->current_drawable == drawable)
|
if (glx_context->current_drawable == drawable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_cogl_xlib_trap_errors (&old_state);
|
_cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state);
|
||||||
|
|
||||||
COGL_NOTE (WINSYS,
|
COGL_NOTE (WINSYS,
|
||||||
"MakeContextCurrent dpy: %p, window: 0x%x (%s), context: %p",
|
"MakeContextCurrent dpy: %p, window: 0x%x (%s), context: %p",
|
||||||
@ -973,7 +973,8 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
|||||||
|
|
||||||
/* FIXME: We should be reporting a GError here
|
/* FIXME: We should be reporting a GError here
|
||||||
*/
|
*/
|
||||||
if (_cogl_xlib_untrap_errors (&old_state))
|
if (_cogl_renderer_xlib_untrap_errors (context->display->renderer,
|
||||||
|
&old_state))
|
||||||
{
|
{
|
||||||
g_warning ("X Error received while making drawable 0x%08lX current",
|
g_warning ("X Error received while making drawable 0x%08lX current",
|
||||||
drawable);
|
drawable);
|
||||||
|
Loading…
Reference in New Issue
Block a user