[cogl/wip/wayland-compositor: 18/18] replace _xlib_add_filter use with _cogl_renderer API
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/wayland-compositor: 18/18] replace _xlib_add_filter use with _cogl_renderer API
- Date: Fri, 27 May 2011 11:42:15 +0000 (UTC)
commit cf196d4fe30a98a13fd41745bd05d404c72f0b1d
Author: Robert Bragg <robert linux intel com>
Date: Fri May 27 12:30:23 2011 +0100
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.
cogl/cogl-xlib-private.h | 21 ---------------------
cogl/cogl-xlib.c | 18 ------------------
cogl/winsys/cogl-texture-pixmap-x11.c | 19 +++++++++++++------
3 files changed, 13 insertions(+), 45 deletions(-)
---
diff --git a/cogl/cogl-xlib-private.h b/cogl/cogl-xlib-private.h
index a7077b2..ef48170 100644
--- a/cogl/cogl-xlib-private.h
+++ b/cogl/cogl-xlib-private.h
@@ -46,25 +46,4 @@ _cogl_xlib_query_damage_extension (void);
int
_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 */
diff --git a/cogl/cogl-xlib.c b/cogl/cogl-xlib.c
index 6f999b3..e70992f 100644
--- a/cogl/cogl-xlib.c
+++ b/cogl/cogl-xlib.c
@@ -82,24 +82,6 @@ cogl_xlib_handle_event (XEvent *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
_cogl_xlib_query_damage_extension (void)
{
int damage_error;
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c
index 01657d1..30ac4a0 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.c
+++ b/cogl/winsys/cogl-texture-pixmap-x11.c
@@ -234,13 +234,15 @@ _cogl_texture_pixmap_x11_filter (void *native_event, void *data)
}
static void
-set_damage_object_internal (CoglTexturePixmapX11 *tex_pixmap,
+set_damage_object_internal (CoglContext *ctx,
+ CoglTexturePixmapX11 *tex_pixmap,
Damage damage,
CoglTexturePixmapX11ReportLevel report_level)
{
if (tex_pixmap->damage)
{
- _cogl_xlib_remove_filter (_cogl_texture_pixmap_x11_filter, tex_pixmap);
+ _cogl_renderer_remove_native_filter (_cogl_texture_pixmap_x11_filter,
+ tex_pixmap);
if (tex_pixmap->damage_owned)
{
@@ -253,7 +255,9 @@ set_damage_object_internal (CoglTexturePixmapX11 *tex_pixmap,
tex_pixmap->damage_report_level = report_level;
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
@@ -310,7 +314,8 @@ cogl_texture_pixmap_x11_new (guint32 pixmap,
Damage damage = XDamageCreate (display,
pixmap,
XDamageReportBoundingBox);
- set_damage_object_internal (tex_pixmap,
+ set_damage_object_internal (ctxt,
+ tex_pixmap,
damage,
COGL_TEXTURE_PIXMAP_X11_DAMAGE_BOUNDING_BOX);
tex_pixmap->damage_owned = TRUE;
@@ -450,7 +455,7 @@ cogl_texture_pixmap_x11_set_damage_object (CoglHandle handle,
damage_base = _cogl_xlib_get_damage_base ();
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
@@ -922,7 +927,9 @@ _cogl_texture_pixmap_x11_get_height (CoglTexture *tex)
static void
_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)
XDestroyImage (tex_pixmap->image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]