1
0
Fork 0

replace _xlib_add_filter use with _cogl_renderer API

Instead of using _cogl_xlib_add/remove_filter we now use
_cogl_renderer_add/remove_native_filter. The _cogl_xlib_add_filter API
was only required as a stop gap while EGL support was still in Clutter
because in that case we were using the stub winsys and didn't have a
CoglRenderer.
This commit is contained in:
Robert Bragg 2011-05-27 12:30:23 +01:00
parent 8c35a6bb7c
commit 5022ec54d2
4 changed files with 17 additions and 48 deletions

View file

@ -91,7 +91,7 @@ cogl_renderer_handle_native_event (CoglRenderer *renderer,
#define cogl_renderer_add_native_filter cogl_renderer_add_native_filter_EXP #define cogl_renderer_add_native_filter cogl_renderer_add_native_filter_EXP
/* /*
* _cogl_renderer_add_native_filter: * cogl_renderer_add_native_filter:
* *
* Adds a callback function that will receive all native events. The * Adds a callback function that will receive all native events. The
* function can stop further processing of the event by return * function can stop further processing of the event by return
@ -107,10 +107,10 @@ cogl_renderer_add_native_filter (CoglRenderer *renderer,
#define cogl_renderer_remove_native_filter \ #define cogl_renderer_remove_native_filter \
cogl_renderer_remove_native_filter_EXP cogl_renderer_remove_native_filter_EXP
/* /*
* _cogl_renderer_remove_native_filter: * cogl_renderer_remove_native_filter:
* *
* Removes a callback that was previously added with * Removes a callback that was previously added with
* _cogl_renderer_add_native_filter(). * cogl_renderer_add_native_filter().
*/ */
void void
cogl_renderer_remove_native_filter (CoglRenderer *renderer, cogl_renderer_remove_native_filter (CoglRenderer *renderer,

View file

@ -46,25 +46,4 @@ _cogl_xlib_query_damage_extension (void);
int int
_cogl_xlib_get_damage_base (void); _cogl_xlib_get_damage_base (void);
/*
* _cogl_xlib_add_filter:
*
* Adds a callback function that will receive all X11 events. The
* function can stop further processing of the event by return
* %COGL_XLIB_FILTER_REMOVE.
*/
void
_cogl_xlib_add_filter (CoglNativeFilterFunc func,
void *data);
/*
* _cogl_xlib_remove_filter:
*
* Removes a callback that was previously added with
* _cogl_xlib_add_filter().
*/
void
_cogl_xlib_remove_filter (CoglNativeFilterFunc func,
void *data);
#endif /* __COGL_XLIB_PRIVATE_H */ #endif /* __COGL_XLIB_PRIVATE_H */

View file

@ -81,24 +81,6 @@ cogl_xlib_handle_event (XEvent *xevent)
return cogl_renderer_handle_native_event (ctx->display->renderer, xevent); return cogl_renderer_handle_native_event (ctx->display->renderer, xevent);
} }
void
_cogl_xlib_add_filter (CoglNativeFilterFunc func,
void *data)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
cogl_renderer_add_native_filter (ctx->display->renderer, func, data);
}
void
_cogl_xlib_remove_filter (CoglNativeFilterFunc func,
void *data)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
cogl_renderer_remove_native_filter (ctx->display->renderer, func, data);
}
void void
_cogl_xlib_query_damage_extension (void) _cogl_xlib_query_damage_extension (void)
{ {

View file

@ -234,13 +234,16 @@ _cogl_texture_pixmap_x11_filter (void *native_event, void *data)
} }
static void static void
set_damage_object_internal (CoglTexturePixmapX11 *tex_pixmap, set_damage_object_internal (CoglContext *ctx,
CoglTexturePixmapX11 *tex_pixmap,
Damage damage, Damage damage,
CoglTexturePixmapX11ReportLevel report_level) CoglTexturePixmapX11ReportLevel report_level)
{ {
if (tex_pixmap->damage) if (tex_pixmap->damage)
{ {
_cogl_xlib_remove_filter (_cogl_texture_pixmap_x11_filter, tex_pixmap); cogl_renderer_remove_native_filter (ctx->display->renderer,
_cogl_texture_pixmap_x11_filter,
tex_pixmap);
if (tex_pixmap->damage_owned) if (tex_pixmap->damage_owned)
{ {
@ -253,7 +256,9 @@ set_damage_object_internal (CoglTexturePixmapX11 *tex_pixmap,
tex_pixmap->damage_report_level = report_level; tex_pixmap->damage_report_level = report_level;
if (damage) if (damage)
_cogl_xlib_add_filter (_cogl_texture_pixmap_x11_filter, tex_pixmap); cogl_renderer_add_native_filter (ctx->display->renderer,
_cogl_texture_pixmap_x11_filter,
tex_pixmap);
} }
CoglHandle CoglHandle
@ -310,7 +315,8 @@ cogl_texture_pixmap_x11_new (guint32 pixmap,
Damage damage = XDamageCreate (display, Damage damage = XDamageCreate (display,
pixmap, pixmap,
XDamageReportBoundingBox); XDamageReportBoundingBox);
set_damage_object_internal (tex_pixmap, set_damage_object_internal (ctxt,
tex_pixmap,
damage, damage,
COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX); COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX);
tex_pixmap->damage_owned = TRUE; tex_pixmap->damage_owned = TRUE;
@ -450,7 +456,7 @@ cogl_texture_pixmap_x11_set_damage_object (CoglHandle handle,
damage_base = _cogl_xlib_get_damage_base (); damage_base = _cogl_xlib_get_damage_base ();
if (damage_base >= 0) if (damage_base >= 0)
set_damage_object_internal (tex_pixmap, damage, report_level); set_damage_object_internal (ctxt, tex_pixmap, damage, report_level);
} }
static void static void
@ -922,7 +928,9 @@ _cogl_texture_pixmap_x11_get_height (CoglTexture *tex)
static void static void
_cogl_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap) _cogl_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap)
{ {
set_damage_object_internal (tex_pixmap, 0, 0); _COGL_GET_CONTEXT (ctxt, NO_RETVAL);
set_damage_object_internal (ctxt, tex_pixmap, 0, 0);
if (tex_pixmap->image) if (tex_pixmap->image)
XDestroyImage (tex_pixmap->image); XDestroyImage (tex_pixmap->image);