[cogl] replace _xlib_add_filter use with _cogl_renderer API
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] replace _xlib_add_filter use with _cogl_renderer API
- Date: Wed, 1 Jun 2011 19:48:32 +0000 (UTC)
commit 5022ec54d2dfea28d5b4edbe0183cd6312035f93
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-renderer.h | 6 +++---
cogl/cogl-xlib-private.h | 21 ---------------------
cogl/cogl-xlib.c | 18 ------------------
cogl/winsys/cogl-texture-pixmap-x11.c | 20 ++++++++++++++------
4 files changed, 17 insertions(+), 48 deletions(-)
---
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index 53285ec..38b7fe9 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -91,7 +91,7 @@ cogl_renderer_handle_native_event (CoglRenderer *renderer,
#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
* 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 \
cogl_renderer_remove_native_filter_EXP
/*
- * _cogl_renderer_remove_native_filter:
+ * cogl_renderer_remove_native_filter:
*
* Removes a callback that was previously added with
- * _cogl_renderer_add_native_filter().
+ * cogl_renderer_add_native_filter().
*/
void
cogl_renderer_remove_native_filter (CoglRenderer *renderer,
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..961af29 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.c
+++ b/cogl/winsys/cogl-texture-pixmap-x11.c
@@ -234,13 +234,16 @@ _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 (ctx->display->renderer,
+ _cogl_texture_pixmap_x11_filter,
+ tex_pixmap);
if (tex_pixmap->damage_owned)
{
@@ -253,7 +256,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 +315,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 +456,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 +928,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]