From 5f18fc928d85499d6ee2ac433dde247286e2de4e Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 10 Feb 2010 22:47:49 +0000 Subject: [PATCH] cogl: explicitly mark cogl__ref/unref APIs as deprecated This uses the G_GNUC_DEPRECATED macros to mark the cogl_{texture,vertex_buffer,shader}_ref and unref APIs as deprecated. Since this flagged that cogl-pango-display-list.c and clutter-glx-texture-pixmap.c were still using deprecated _ref/_unref APIs they have now been changed to use the cogl_handle_ref/unref API instead. --- clutter/cogl/cogl/cogl-shader.h | 8 ++++++-- clutter/cogl/cogl/cogl-texture.h | 4 ++-- clutter/cogl/cogl/cogl-vertex-buffer.h | 4 ++-- clutter/cogl/pango/cogl-pango-display-list.c | 8 ++++---- clutter/glx/clutter-glx-texture-pixmap.c | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/clutter/cogl/cogl/cogl-shader.h b/clutter/cogl/cogl/cogl-shader.h index b36e93e57..c3bcfe2d0 100644 --- a/clutter/cogl/cogl/cogl-shader.h +++ b/clutter/cogl/cogl/cogl-shader.h @@ -69,6 +69,8 @@ typedef enum { CoglHandle cogl_create_shader (CoglShaderType shader_type); +#ifndef COGL_DISABLE_DEPRECATED + /** * cogl_shader_ref: * @handle: A #CoglHandle to a shader. @@ -78,7 +80,7 @@ cogl_create_shader (CoglShaderType shader_type); * Returns: @handle */ CoglHandle -cogl_shader_ref (CoglHandle handle); +cogl_shader_ref (CoglHandle handle) G_GNUC_DEPRECATED; /** * cogl_shader_unref: @@ -88,7 +90,9 @@ cogl_shader_ref (CoglHandle handle); * shader object will be destroyed. */ void -cogl_shader_unref (CoglHandle handle); +cogl_shader_unref (CoglHandle handle) G_GNUC_DEPRECATED; + +#endif /* COGL_DISABLE_DEPRECATED */ /** * cogl_is_shader: diff --git a/clutter/cogl/cogl/cogl-texture.h b/clutter/cogl/cogl/cogl-texture.h index cf75ed01c..4f9a40ce8 100644 --- a/clutter/cogl/cogl/cogl-texture.h +++ b/clutter/cogl/cogl/cogl-texture.h @@ -433,7 +433,7 @@ cogl_texture_new_from_buffer_EXP (CoglHandle buffer, * Return value: the @handle. */ CoglHandle -cogl_texture_ref (CoglHandle handle); +cogl_texture_ref (CoglHandle handle) G_GNUC_DEPRECATED; /** * cogl_texture_unref: @@ -444,7 +444,7 @@ cogl_texture_ref (CoglHandle handle); * Deprecated: 1.2: Use cogl_handle_unref() instead */ void -cogl_texture_unref (CoglHandle handle); +cogl_texture_unref (CoglHandle handle) G_GNUC_DEPRECATED; #endif /* COGL_DISABLE_DEPRECATED */ diff --git a/clutter/cogl/cogl/cogl-vertex-buffer.h b/clutter/cogl/cogl/cogl-vertex-buffer.h index 787f333e6..05d92b6f5 100644 --- a/clutter/cogl/cogl/cogl-vertex-buffer.h +++ b/clutter/cogl/cogl/cogl-vertex-buffer.h @@ -385,7 +385,7 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle, * Deprecated: 1.2: Use cogl_handle_ref() instead */ CoglHandle -cogl_vertex_buffer_ref (CoglHandle handle); +cogl_vertex_buffer_ref (CoglHandle handle) G_GNUC_DEPRECATED; /** * cogl_vertex_buffer_unref: @@ -396,7 +396,7 @@ cogl_vertex_buffer_ref (CoglHandle handle); * Deprecated: 1.2: Use cogl_handle_unref() instead */ void -cogl_vertex_buffer_unref (CoglHandle handle); +cogl_vertex_buffer_unref (CoglHandle handle) G_GNUC_DEPRECATED; #endif /* COGL_DISABLE_DEPRECATED */ diff --git a/clutter/cogl/pango/cogl-pango-display-list.c b/clutter/cogl/pango/cogl-pango-display-list.c index 469258388..965418a35 100644 --- a/clutter/cogl/pango/cogl-pango-display-list.c +++ b/clutter/cogl/pango/cogl-pango-display-list.c @@ -144,7 +144,7 @@ _cogl_pango_display_list_add_texture (CoglPangoDisplayList *dl, /* Get rid of the vertex buffer so that it will be recreated */ if (node->d.texture.vertex_buffer != COGL_INVALID_HANDLE) { - cogl_vertex_buffer_unref (node->d.texture.vertex_buffer); + cogl_handle_unref (node->d.texture.vertex_buffer); node->d.texture.vertex_buffer = COGL_INVALID_HANDLE; } } @@ -156,7 +156,7 @@ _cogl_pango_display_list_add_texture (CoglPangoDisplayList *dl, node->type = COGL_PANGO_DISPLAY_LIST_TEXTURE; node->color_override = dl->color_override; node->color = dl->color; - node->d.texture.texture = cogl_texture_ref (texture); + node->d.texture.texture = cogl_handle_ref (texture); node->d.texture.verts = g_array_new (FALSE, FALSE, sizeof (CoglPangoDisplayListVertex)); node->d.texture.vertex_buffer = COGL_INVALID_HANDLE; @@ -392,9 +392,9 @@ _cogl_pango_display_list_node_free (CoglPangoDisplayListNode *node) { g_array_free (node->d.texture.verts, TRUE); if (node->d.texture.texture != COGL_INVALID_HANDLE) - cogl_texture_unref (node->d.texture.texture); + cogl_handle_unref (node->d.texture.texture); if (node->d.texture.vertex_buffer != COGL_INVALID_HANDLE) - cogl_vertex_buffer_unref (node->d.texture.vertex_buffer); + cogl_handle_unref (node->d.texture.vertex_buffer); } g_slice_free (CoglPangoDisplayListNode, node); diff --git a/clutter/glx/clutter-glx-texture-pixmap.c b/clutter/glx/clutter-glx-texture-pixmap.c index 78630c46a..8690189ed 100644 --- a/clutter/glx/clutter-glx-texture-pixmap.c +++ b/clutter/glx/clutter-glx-texture-pixmap.c @@ -380,7 +380,7 @@ create_cogl_texture (ClutterTexture *texture, priv->using_rectangle = using_rectangle; clutter_texture_set_cogl_texture (texture, handle); - cogl_texture_unref(handle); + cogl_handle_unref(handle); return TRUE; }