From f93e50a2819426c6c921ea7da8d0b232e5ad8285 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. --- cogl/cogl-shader.h | 8 ++++++-- cogl/cogl-texture.h | 4 ++-- cogl/cogl-vertex-buffer.h | 4 ++-- pango/cogl-pango-display-list.c | 8 ++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cogl/cogl-shader.h b/cogl/cogl-shader.h index b36e93e57..c3bcfe2d0 100644 --- a/cogl/cogl-shader.h +++ b/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/cogl/cogl-texture.h b/cogl/cogl-texture.h index cf75ed01c..4f9a40ce8 100644 --- a/cogl/cogl-texture.h +++ b/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/cogl/cogl-vertex-buffer.h b/cogl/cogl-vertex-buffer.h index 787f333e6..05d92b6f5 100644 --- a/cogl/cogl-vertex-buffer.h +++ b/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/pango/cogl-pango-display-list.c b/pango/cogl-pango-display-list.c index 469258388..965418a35 100644 --- a/pango/cogl-pango-display-list.c +++ b/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);