cogl: explicitly mark cogl_<object>_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.
This commit is contained in:
Robert Bragg 2010-02-10 22:47:49 +00:00
parent 7d9b733446
commit f93e50a281
4 changed files with 14 additions and 10 deletions

View File

@ -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:

View File

@ -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 */

View File

@ -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 */

View File

@ -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);