diff --git a/cogl/cogl-renderer-xlib-private.h b/cogl/cogl-renderer-xlib-private.h index bc8ccb5ee..c9df5dfe8 100644 --- a/cogl/cogl-renderer-xlib-private.h +++ b/cogl/cogl-renderer-xlib-private.h @@ -49,13 +49,14 @@ _cogl_renderer_xlib_disconnect (CoglRenderer *renderer); * cogl_renderer_xlib_trap_errors: * @state: A temporary place to store data for the trap. * - * Traps every X error until _cogl_xlib_untrap_errors() called. You - * should allocate an uninitialised CoglXlibTrapState struct on the - * stack to pass to this function. The same pointer should later be - * passed to _cogl_xlib_untrap_errors(). Calls to - * _cogl_xlib_trap_errors() can be nested as long as - * _cogl_xlib_untrap_errors() is called with the corresponding state - * pointers in reverse order. + * Traps every X error until _cogl_renderer_xlib_untrap_errors() + * called. You should allocate an uninitialised CoglXlibTrapState + * struct on the stack to pass to this function. The same pointer + * should later be passed to _cogl_renderer_xlib_untrap_errors(). + * + * Calls to _cogl_renderer_xlib_trap_errors() can be nested as long as + * _cogl_renderer_xlib_untrap_errors() is called with the + * corresponding state pointers in reverse order. */ void _cogl_renderer_xlib_trap_errors (CoglRenderer *renderer, @@ -63,7 +64,7 @@ _cogl_renderer_xlib_trap_errors (CoglRenderer *renderer, /* * 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. * diff --git a/cogl/cogl-xlib-private.h b/cogl/cogl-xlib-private.h index 564543988..a7077b21e 100644 --- a/cogl/cogl-xlib-private.h +++ b/cogl/cogl-xlib-private.h @@ -46,12 +46,6 @@ _cogl_xlib_query_damage_extension (void); int _cogl_xlib_get_damage_base (void); -void -_cogl_xlib_trap_errors (CoglXlibTrapState *state); - -int -_cogl_xlib_untrap_errors (CoglXlibTrapState *state); - /* * _cogl_xlib_add_filter: * diff --git a/cogl/cogl-xlib.c b/cogl/cogl-xlib.c index c64821619..6f999b383 100644 --- a/cogl/cogl-xlib.c +++ b/cogl/cogl-xlib.c @@ -99,23 +99,6 @@ _cogl_xlib_remove_filter (CoglNativeFilterFunc func, 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 _cogl_xlib_query_damage_extension (void) { diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c index 6f51992ec..7974ba6b7 100644 --- a/cogl/winsys/cogl-winsys-egl.c +++ b/cogl/winsys/cogl-winsys-egl.c @@ -1366,7 +1366,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen) #endif #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) { @@ -1378,7 +1378,8 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen) 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"); #endif diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index 82008d62d..f5baa79d8 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -865,7 +865,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen) if (glx_onscreen == NULL) return; - _cogl_xlib_trap_errors (&old_state); + _cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state); if (glx_onscreen->glxwin != None) { @@ -883,7 +883,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen) 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); onscreen->winsys = NULL; @@ -912,7 +912,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen) if (glx_context->current_drawable == drawable) return; - _cogl_xlib_trap_errors (&old_state); + _cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state); glXMakeContextCurrent (xlib_renderer->xdpy, drawable, drawable, @@ -926,7 +926,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen) if (glx_context->current_drawable == drawable) return; - _cogl_xlib_trap_errors (&old_state); + _cogl_renderer_xlib_trap_errors (context->display->renderer, &old_state); COGL_NOTE (WINSYS, "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 */ - 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", drawable);