[mutter/wip/nielsdg/coglhandle-stepped-approach: 1/2] cogl: Remove cogl_handle_ref/unref



commit 0455f3f02fd2e8c5df850f8b1761b3be0e8128f6
Author: Niels De Graef <niels degraef barco com>
Date:   Wed Feb 20 14:51:12 2019 +0100

    cogl: Remove cogl_handle_ref/unref
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/451

 clutter/clutter/clutter-effect.c                    |  4 ++--
 clutter/clutter/clutter-offscreen-effect.c          | 14 +++++++-------
 clutter/clutter/clutter-shader-effect.c             |  8 ++++----
 clutter/clutter/deprecated/clutter-cairo-texture.c  |  2 +-
 clutter/clutter/deprecated/clutter-texture.c        |  6 +++---
 cogl/cogl/cogl-context.c                            |  2 +-
 cogl/cogl/cogl-object-private.h                     |  4 ++--
 cogl/cogl/cogl-object.c                             | 12 ------------
 cogl/cogl/cogl-pipeline-state.c                     |  4 ++--
 cogl/cogl/cogl-pipeline.c                           |  4 ++--
 cogl/cogl/cogl-types.h                              | 21 ---------------------
 cogl/cogl/cogl.symbols                              |  2 --
 cogl/cogl/deprecated/cogl-program.c                 |  8 ++++----
 cogl/cogl/deprecated/cogl-vertex-buffer.c           |  2 +-
 cogl/tests/conform/test-blend-strings.c             |  6 +++---
 cogl/tests/conform/test-just-vertex-shader.c        | 10 +++++-----
 cogl/tests/conform/test-materials.c                 | 12 ++++++------
 cogl/tests/conform/test-multitexture.c              |  6 +++---
 cogl/tests/conform/test-pipeline-uniforms.c         |  4 ++--
 cogl/tests/conform/test-readpixels.c                |  4 ++--
 cogl/tests/conform/test-texture-mipmaps.c           |  4 ++--
 cogl/tests/conform/test-texture-rectangle.c         |  4 ++--
 cogl/tests/conform/test-vertex-buffer-contiguous.c  |  6 +++---
 cogl/tests/conform/test-vertex-buffer-interleved.c  |  2 +-
 cogl/tests/conform/test-vertex-buffer-mutability.c  |  2 +-
 cogl/tests/conform/test-viewport.c                  |  4 ++--
 cogl/tests/conform/test-wrap-modes.c                |  2 +-
 .../clutter/interactive/test-cogl-multitexture.c    | 12 ++++++------
 src/tests/clutter/interactive/test-cogl-offscreen.c |  4 ++--
 .../clutter/interactive/test-cogl-point-sprites.c   |  4 ++--
 .../clutter/interactive/test-cogl-shader-glsl.c     |  4 ++--
 .../clutter/interactive/test-cogl-tex-convert.c     |  2 +-
 .../clutter/interactive/test-cogl-tex-polygon.c     |  6 +++---
 src/tests/clutter/interactive/test-cogl-tex-tile.c  |  2 +-
 .../clutter/interactive/test-cogl-vertex-buffer.c   |  4 ++--
 35 files changed, 81 insertions(+), 116 deletions(-)
---
diff --git a/clutter/clutter/clutter-effect.c b/clutter/clutter/clutter-effect.c
index a7c06d919..47c11a53a 100644
--- a/clutter/clutter/clutter-effect.c
+++ b/clutter/clutter/clutter-effect.c
@@ -100,13 +100,13 @@
  *    // Clear the previous state //
  *    if (self->rect_1)
  *      {
- *        cogl_handle_unref (self->rect_1);
+ *        cogl_object_unref (self->rect_1);
  *        self->rect_1 = NULL;
  *      }
  *
  *    if (self->rect_2)
  *      {
- *        cogl_handle_unref (self->rect_2);
+ *        cogl_object_unref (self->rect_2);
  *        self->rect_2 = NULL;
  *      }
  *
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index cb554f44c..54f5fbb7e 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -119,7 +119,7 @@ clutter_offscreen_effect_set_actor (ClutterActorMeta *meta,
   /* clear out the previous state */
   if (priv->offscreen != NULL)
     {
-      cogl_handle_unref (priv->offscreen);
+      cogl_object_unref (priv->offscreen);
       priv->offscreen = NULL;
     }
 
@@ -199,13 +199,13 @@ update_fbo (ClutterEffect *effect,
 
   if (priv->texture != NULL)
     {
-      cogl_handle_unref (priv->texture);
+      cogl_object_unref (priv->texture);
       priv->texture = NULL;
     }
 
   if (priv->offscreen != NULL)
     {
-      cogl_handle_unref (priv->offscreen);
+      cogl_object_unref (priv->offscreen);
       priv->offscreen = NULL;
     }
 
@@ -224,7 +224,7 @@ update_fbo (ClutterEffect *effect,
     {
       g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
 
-      cogl_handle_unref (priv->target);
+      cogl_object_unref (priv->target);
       priv->target = NULL;
 
       priv->target_width = 0;
@@ -487,13 +487,13 @@ clutter_offscreen_effect_finalize (GObject *gobject)
   ClutterOffscreenEffectPrivate *priv = self->priv;
 
   if (priv->offscreen)
-    cogl_handle_unref (priv->offscreen);
+    cogl_object_unref (priv->offscreen);
 
   if (priv->target)
-    cogl_handle_unref (priv->target);
+    cogl_object_unref (priv->target);
 
   if (priv->texture)
-    cogl_handle_unref (priv->texture);
+    cogl_object_unref (priv->texture);
 
   G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->finalize (gobject);
 }
diff --git a/clutter/clutter/clutter-shader-effect.c b/clutter/clutter/clutter-shader-effect.c
index c659dab12..4a36f973d 100644
--- a/clutter/clutter/clutter-shader-effect.c
+++ b/clutter/clutter/clutter-shader-effect.c
@@ -179,14 +179,14 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
 
   if (priv->shader != COGL_INVALID_HANDLE)
     {
-      cogl_handle_unref (priv->shader);
+      cogl_object_unref (priv->shader);
 
       priv->shader = COGL_INVALID_HANDLE;
     }
 
   if (priv->program != COGL_INVALID_HANDLE)
     {
-      cogl_handle_unref (priv->program);
+      cogl_object_unref (priv->program);
 
       priv->program = COGL_INVALID_HANDLE;
     }
@@ -387,10 +387,10 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
             }
         }
 
-      priv->shader = cogl_handle_ref (class_priv->shader);
+      priv->shader = cogl_object_ref (class_priv->shader);
 
       if (class_priv->program != COGL_INVALID_HANDLE)
-        priv->program = cogl_handle_ref (class_priv->program);
+        priv->program = cogl_object_ref (class_priv->program);
     }
 }
 
diff --git a/clutter/clutter/deprecated/clutter-cairo-texture.c 
b/clutter/clutter/deprecated/clutter-cairo-texture.c
index a24602979..8d67af038 100644
--- a/clutter/clutter/deprecated/clutter-cairo-texture.c
+++ b/clutter/clutter/deprecated/clutter-cairo-texture.c
@@ -507,7 +507,7 @@ clutter_cairo_texture_create_surface (ClutterCairoTexture *self,
                                              cairo_stride,
                                              cairo_data);
   clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (self), cogl_texture);
-  cogl_handle_unref (cogl_texture);
+  cogl_object_unref (cogl_texture);
 
   return surface;
 }
diff --git a/clutter/clutter/deprecated/clutter-texture.c b/clutter/clutter/deprecated/clutter-texture.c
index b4a60cc8c..203e84f43 100644
--- a/clutter/clutter/deprecated/clutter-texture.c
+++ b/clutter/clutter/deprecated/clutter-texture.c
@@ -1229,7 +1229,7 @@ clutter_texture_get_cogl_material (ClutterTexture *texture)
  * Replaces the underlying Cogl material drawn by this actor with
  * @cogl_material. A reference to the material is taken so if the
  * handle is no longer needed it should be deref'd with
- * cogl_handle_unref. Texture data is attached to the material so
+ * cogl_object_unref. Texture data is attached to the material so
  * calling this function also replaces the Cogl
  * texture. #ClutterTexture requires that the material have a texture
  * layer so you should set one on the material before calling this
@@ -1302,7 +1302,7 @@ get_first_layer_index (CoglPipeline *pipeline, int *layer_index)
  *
  * Retrieves the handle to the underlying COGL texture used for drawing
  * the actor. No extra reference is taken so if you need to keep the
- * handle then you should call cogl_handle_ref() on it.
+ * handle then you should call cogl_object_ref() on it.
  *
  * The texture handle returned is the first layer of the material
  * handle used by the #ClutterTexture. If you need to access the other
@@ -1342,7 +1342,7 @@ clutter_texture_get_cogl_texture (ClutterTexture *texture)
  *
  * Replaces the underlying COGL texture drawn by this actor with
  * @cogl_tex. A reference to the texture is taken so if the handle is
- * no longer needed it should be deref'd with cogl_handle_unref.
+ * no longer needed it should be deref'd with cogl_object_unref.
  *
  * Since: 0.8
  *
diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c
index 3fea916e7..b57800e97 100644
--- a/cogl/cogl/cogl-context.c
+++ b/cogl/cogl/cogl-context.c
@@ -432,7 +432,7 @@ _cogl_context_free (CoglContext *context)
   _cogl_free_framebuffer_stack (context->framebuffer_stack);
 
   if (context->current_path)
-    cogl_handle_unref (context->current_path);
+    cogl_object_unref (context->current_path);
 
   if (context->default_gl_texture_2d_tex)
     cogl_object_unref (context->default_gl_texture_2d_tex);
diff --git a/cogl/cogl/cogl-object-private.h b/cogl/cogl/cogl-object-private.h
index 8682c27dc..57760bb8c 100644
--- a/cogl/cogl/cogl-object-private.h
+++ b/cogl/cogl/cogl-object-private.h
@@ -253,7 +253,7 @@ cogl_##type_name##_ref (void *object)                           \
                                                                 \
   _COGL_OBJECT_DEBUG_REF (TypeName, object);                    \
                                                                 \
-  cogl_handle_ref (object);                                     \
+  cogl_object_ref (object);                                     \
                                                                 \
   return object;                                                \
 }                                                               \
@@ -271,7 +271,7 @@ cogl_##type_name##_unref (void *object)                         \
                                                                 \
   _COGL_OBJECT_DEBUG_UNREF (TypeName, object);                  \
                                                                 \
-  cogl_handle_unref (object);                                   \
+  cogl_object_unref (object);                                   \
 }
 
 #define COGL_OBJECT_DEFINE(TypeName, type_name)                 \
diff --git a/cogl/cogl/cogl-object.c b/cogl/cogl/cogl-object.c
index 301254548..b96f19817 100644
--- a/cogl/cogl/cogl-object.c
+++ b/cogl/cogl/cogl-object.c
@@ -52,12 +52,6 @@ cogl_object_ref (void *object)
   return object;
 }
 
-CoglHandle
-cogl_handle_ref (CoglHandle handle)
-{
-  return cogl_object_ref (handle);
-}
-
 void
 _cogl_object_default_unref (void *object)
 {
@@ -115,12 +109,6 @@ cogl_object_unref (void *obj)
   unref_func (obj);
 }
 
-void
-cogl_handle_unref (CoglHandle handle)
-{
-  cogl_object_unref (handle);
-}
-
 GType
 cogl_handle_get_type (void)
 {
diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c
index 245e2c872..58281f97f 100644
--- a/cogl/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl/cogl-pipeline-state.c
@@ -1131,10 +1131,10 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
     }
 
   if (program != COGL_INVALID_HANDLE)
-    cogl_handle_ref (program);
+    cogl_object_ref (program);
   if (authority == pipeline &&
       pipeline->big_state->user_program != COGL_INVALID_HANDLE)
-    cogl_handle_unref (pipeline->big_state->user_program);
+    cogl_object_unref (pipeline->big_state->user_program);
   pipeline->big_state->user_program = program;
 
   pipeline->dirty_real_blend_enable = TRUE;
diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c
index 68f5e3471..efd7d5222 100644
--- a/cogl/cogl/cogl-pipeline.c
+++ b/cogl/cogl/cogl-pipeline.c
@@ -435,7 +435,7 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
 
   if (pipeline->differences & COGL_PIPELINE_STATE_USER_SHADER &&
       pipeline->big_state->user_program)
-    cogl_handle_unref (pipeline->big_state->user_program);
+    cogl_object_unref (pipeline->big_state->user_program);
 
   if (pipeline->differences & COGL_PIPELINE_STATE_UNIFORMS)
     {
@@ -990,7 +990,7 @@ _cogl_pipeline_copy_differences (CoglPipeline *dest,
     {
       if (src->big_state->user_program)
         big_state->user_program =
-          cogl_handle_ref (src->big_state->user_program);
+          cogl_object_ref (src->big_state->user_program);
       else
         big_state->user_program = COGL_INVALID_HANDLE;
     }
diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h
index 718f4c4b5..67b07ab01 100644
--- a/cogl/cogl/cogl-types.h
+++ b/cogl/cogl/cogl-types.h
@@ -92,27 +92,6 @@ typedef void * CoglHandle;
 GType
 cogl_handle_get_type (void) G_GNUC_CONST;
 
-/**
- * cogl_handle_ref:
- * @handle: a #CoglHandle
- *
- * Increases the reference count of @handle by 1
- *
- * Return value: (transfer none): the handle, with its reference count increased
- */
-CoglHandle
-cogl_handle_ref (CoglHandle handle);
-
-/**
- * cogl_handle_unref:
- * @handle: a #CoglHandle
- *
- * Drecreases the reference count of @handle by 1; if the reference
- * count reaches 0, the resources allocated by @handle will be freed
- */
-void
-cogl_handle_unref (CoglHandle handle);
-
 /* We forward declare this in cogl-types to avoid circular dependencies
  * between cogl-matrix.h, cogl-euler.h and cogl-quaterion.h */
 typedef struct _CoglMatrix      CoglMatrix;
diff --git a/cogl/cogl/cogl.symbols b/cogl/cogl/cogl.symbols
index 2b59f9f21..df268d81d 100644
--- a/cogl/cogl/cogl.symbols
+++ b/cogl/cogl/cogl.symbols
@@ -340,8 +340,6 @@ cogl_gtype_matrix_get_type
 #endif
 
 cogl_handle_get_type
-cogl_handle_ref
-cogl_handle_unref
 
 cogl_has_feature
 cogl_has_features
diff --git a/cogl/cogl/deprecated/cogl-program.c b/cogl/cogl/deprecated/cogl-program.c
index ecd54d7e1..ed07af7d9 100644
--- a/cogl/cogl/deprecated/cogl-program.c
+++ b/cogl/cogl/deprecated/cogl-program.c
@@ -60,7 +60,7 @@ _cogl_program_free (CoglProgram *program)
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
   /* Unref all of the attached shaders and destroy the list */
-  g_slist_free_full (program->attached_shaders, cogl_handle_unref);
+  g_slist_free_full (program->attached_shaders, cogl_object_unref);
 
   for (i = 0; i < program->custom_uniforms->len; i++)
     {
@@ -113,7 +113,7 @@ cogl_program_attach_shader (CoglHandle program_handle,
 
   program->attached_shaders
     = g_slist_prepend (program->attached_shaders,
-                       cogl_handle_ref (shader_handle));
+                       cogl_object_ref (shader_handle));
 
   program->age++;
 }
@@ -140,9 +140,9 @@ cogl_program_use (CoglHandle handle)
     ctx->legacy_state_set--;
 
   if (handle != COGL_INVALID_HANDLE)
-    cogl_handle_ref (handle);
+    cogl_object_ref (handle);
   if (ctx->current_program != COGL_INVALID_HANDLE)
-    cogl_handle_unref (ctx->current_program);
+    cogl_object_unref (ctx->current_program);
   ctx->current_program = handle;
 }
 
diff --git a/cogl/cogl/deprecated/cogl-vertex-buffer.c b/cogl/cogl/deprecated/cogl-vertex-buffer.c
index 7da369cc1..709a9a101 100644
--- a/cogl/cogl/deprecated/cogl-vertex-buffer.c
+++ b/cogl/cogl/deprecated/cogl-vertex-buffer.c
@@ -1769,7 +1769,7 @@ cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
       if (ctx->quad_buffer_indices &&
           ctx->quad_buffer_indices_len < n_indices)
         {
-          cogl_handle_unref (ctx->quad_buffer_indices);
+          cogl_object_unref (ctx->quad_buffer_indices);
           ctx->quad_buffer_indices = COGL_INVALID_HANDLE;
         }
 
diff --git a/cogl/tests/conform/test-blend-strings.c b/cogl/tests/conform/test-blend-strings.c
index bf7f1be0e..92672736f 100644
--- a/cogl/tests/conform/test-blend-strings.c
+++ b/cogl/tests/conform/test-blend-strings.c
@@ -142,7 +142,7 @@ test_blend_paint (TestState  *state,
                   y * QUAD_WIDTH,
                   x * QUAD_WIDTH + QUAD_WIDTH,
                   y * QUAD_WIDTH + QUAD_WIDTH);
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 
   /*
    * Now blend a rectangle over our well defined destination:
@@ -168,7 +168,7 @@ test_blend_paint (TestState  *state,
                   y * QUAD_WIDTH,
                   x * QUAD_WIDTH + QUAD_WIDTH,
                   y * QUAD_WIDTH + QUAD_WIDTH);
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 
   /* See what we got... */
 
@@ -268,7 +268,7 @@ test_tex_combine (TestState *state,
                   x * QUAD_WIDTH + QUAD_WIDTH,
                   y * QUAD_WIDTH + QUAD_WIDTH);
 
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
   cogl_object_unref (tex0);
   cogl_object_unref (tex1);
 
diff --git a/cogl/tests/conform/test-just-vertex-shader.c b/cogl/tests/conform/test-just-vertex-shader.c
index a6ec9975d..2d0c20567 100644
--- a/cogl/tests/conform/test-just-vertex-shader.c
+++ b/cogl/tests/conform/test-just-vertex-shader.c
@@ -82,7 +82,7 @@ paint_legacy (TestState *state)
   cogl_program_attach_shader (program, shader);
   cogl_program_link (program);
 
-  cogl_handle_unref (shader);
+  cogl_object_unref (shader);
 
   /* Draw something using the material */
   cogl_set_source (material);
@@ -93,8 +93,8 @@ paint_legacy (TestState *state)
   cogl_rectangle (50, 0, 100, 50);
   cogl_program_use (COGL_INVALID_HANDLE);
 
-  cogl_handle_unref (material);
-  cogl_handle_unref (program);
+  cogl_object_unref (material);
+  cogl_object_unref (program);
 }
 
 static void
@@ -152,7 +152,7 @@ paint (TestState *state)
   cogl_program_attach_shader (program, shader);
   cogl_program_link (program);
 
-  cogl_handle_unref (shader);
+  cogl_object_unref (shader);
 
   /* Draw something without the program */
   cogl_set_source (pipeline);
@@ -160,7 +160,7 @@ paint (TestState *state)
 
   /* Draw it again using the program. It should look exactly the same */
   cogl_pipeline_set_user_program (pipeline, program);
-  cogl_handle_unref (program);
+  cogl_object_unref (program);
 
   cogl_rectangle (50, 0, 100, 50);
   cogl_pipeline_set_user_program (pipeline, COGL_INVALID_HANDLE);
diff --git a/cogl/tests/conform/test-materials.c b/cogl/tests/conform/test-materials.c
index e058b098a..2f1edf06c 100644
--- a/cogl/tests/conform/test-materials.c
+++ b/cogl/tests/conform/test-materials.c
@@ -68,7 +68,7 @@ test_material_with_primitives (TestState *state,
                            COGL_VERTICES_MODE_TRIANGLE_FAN,
                            0, /* first */
                            4); /* count */
-  cogl_handle_unref (vbo);
+  cogl_object_unref (vbo);
 
   cogl_pop_matrix ();
 
@@ -89,7 +89,7 @@ test_invalid_texture_layers (TestState *state, int x, int y)
 
   cogl_set_source (material);
 
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 
   /* We expect a white fallback material to be used */
   test_material_with_primitives (state, x, y, 0xffffffff);
@@ -156,9 +156,9 @@ test_using_all_layers (TestState *state, int x, int y)
 
   cogl_set_source (material);
 
-  cogl_handle_unref (material);
-  cogl_handle_unref (white_texture);
-  cogl_handle_unref (red_texture);
+  cogl_object_unref (material);
+  cogl_object_unref (white_texture);
+  cogl_object_unref (red_texture);
 
   /* We expect the final fragment to be red */
   test_material_with_primitives (state, x, y, 0xff0000ff);
@@ -184,7 +184,7 @@ test_invalid_texture_layers_with_constant_colors (TestState *state,
 
   cogl_set_source (material);
 
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 
   /* We expect the final fragments to be green */
   test_material_with_primitives (state, x, y, 0x0000ffff);
diff --git a/cogl/tests/conform/test-multitexture.c b/cogl/tests/conform/test-multitexture.c
index 4e130574c..0968527eb 100644
--- a/cogl/tests/conform/test-multitexture.c
+++ b/cogl/tests/conform/test-multitexture.c
@@ -149,9 +149,9 @@ on_paint (ClutterActor *actor, TestState *state)
   cogl_rectangle_with_multitexture_coords (0, 0, QUAD_WIDTH, QUAD_WIDTH,
                                            tex_coords, 8);
 
-  cogl_handle_unref (material);
-  cogl_handle_unref (tex0);
-  cogl_handle_unref (tex1);
+  cogl_object_unref (material);
+  cogl_object_unref (tex0);
+  cogl_object_unref (tex1);
 
   /* See what we got... */
 
diff --git a/cogl/tests/conform/test-pipeline-uniforms.c b/cogl/tests/conform/test-pipeline-uniforms.c
index ab447b1e5..d2b5e8f4d 100644
--- a/cogl/tests/conform/test-pipeline-uniforms.c
+++ b/cogl/tests/conform/test-pipeline-uniforms.c
@@ -101,8 +101,8 @@ create_pipeline_for_shader (TestState *state, const char *shader_source)
 
   cogl_pipeline_set_user_program (pipeline, program);
 
-  cogl_handle_unref (shader);
-  cogl_handle_unref (program);
+  cogl_object_unref (shader);
+  cogl_object_unref (program);
 
   return pipeline;
 }
diff --git a/cogl/tests/conform/test-readpixels.c b/cogl/tests/conform/test-readpixels.c
index a24f3f8f0..a180ec329 100644
--- a/cogl/tests/conform/test-readpixels.c
+++ b/cogl/tests/conform/test-readpixels.c
@@ -81,7 +81,7 @@ on_paint (ClutterActor *actor, void *state)
   g_free (pixels);
 
   cogl_pop_framebuffer ();
-  cogl_handle_unref (offscreen);
+  cogl_object_unref (offscreen);
 
   /* Now verify reading back from an onscreen framebuffer...
    */
@@ -122,7 +122,7 @@ on_paint (ClutterActor *actor, void *state)
 
   g_free (pixelsc);
 
-  cogl_handle_unref (tex);
+  cogl_object_unref (tex);
 
   /* Restore the viewport and matrices state */
   cogl_set_viewport (saved_viewport[0],
diff --git a/cogl/tests/conform/test-texture-mipmaps.c b/cogl/tests/conform/test-texture-mipmaps.c
index 20978d478..ab239f3d7 100644
--- a/cogl/tests/conform/test-texture-mipmaps.c
+++ b/cogl/tests/conform/test-texture-mipmaps.c
@@ -54,7 +54,7 @@ on_paint (ClutterActor *actor, TestState *state)
   tex = make_texture ();
   material = cogl_material_new ();
   cogl_material_set_layer (material, 0, tex);
-  cogl_handle_unref (tex);
+  cogl_object_unref (tex);
 
   /* Render a 1x1 pixel quad without mipmaps */
   cogl_set_source (material);
@@ -68,7 +68,7 @@ on_paint (ClutterActor *actor, TestState *state)
                                    COGL_MATERIAL_FILTER_NEAREST);
   cogl_rectangle (1, 0, 2, 1);
 
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 
   /* Read back the two pixels we rendered */
   cogl_read_pixels (0, 0, 2, 1,
diff --git a/cogl/tests/conform/test-texture-rectangle.c b/cogl/tests/conform/test-texture-rectangle.c
index 4d968bb1e..2f50b1a6f 100644
--- a/cogl/tests/conform/test-texture-rectangle.c
+++ b/cogl/tests/conform/test-texture-rectangle.c
@@ -149,12 +149,12 @@ draw_frame (TestState *state)
   /* Flush the rendering now so we can safely delete the texture */
   cogl_flush ();
 
-  cogl_handle_unref (material_rect);
+  cogl_object_unref (material_rect);
 
   /* Cogl doesn't destroy foreign textures so we have to do it manually */
   cogl_texture_get_gl_texture (tex_rect, &gl_tex, NULL);
   glDeleteTextures (1, &gl_tex);
-  cogl_handle_unref (tex_rect);
+  cogl_object_unref (tex_rect);
 }
 
 static void
diff --git a/cogl/tests/conform/test-vertex-buffer-contiguous.c 
b/cogl/tests/conform/test-vertex-buffer-contiguous.c
index 12f440338..2afbf4bde 100644
--- a/cogl/tests/conform/test-vertex-buffer-contiguous.c
+++ b/cogl/tests/conform/test-vertex-buffer-contiguous.c
@@ -245,9 +245,9 @@ test_vertex_buffer_contiguous (TestUtilsGTestFixture *fixture,
 
   clutter_main ();
 
-  cogl_handle_unref (state.buffer);
-  cogl_handle_unref (state.material);
-  cogl_handle_unref (state.texture);
+  cogl_object_unref (state.buffer);
+  cogl_object_unref (state.material);
+  cogl_object_unref (state.texture);
 
   g_source_remove (idle_source);
 
diff --git a/cogl/tests/conform/test-vertex-buffer-interleved.c 
b/cogl/tests/conform/test-vertex-buffer-interleved.c
index 0cefb1c7a..fd1060ef9 100644
--- a/cogl/tests/conform/test-vertex-buffer-interleved.c
+++ b/cogl/tests/conform/test-vertex-buffer-interleved.c
@@ -152,7 +152,7 @@ test_vertex_buffer_interleved (TestUtilsGTestFixture *fixture,
 
   clutter_main ();
 
-  cogl_handle_unref (state.buffer);
+  cogl_object_unref (state.buffer);
 
   g_source_remove (idle_source);
 
diff --git a/cogl/tests/conform/test-vertex-buffer-mutability.c 
b/cogl/tests/conform/test-vertex-buffer-mutability.c
index d742eb643..06932b382 100644
--- a/cogl/tests/conform/test-vertex-buffer-mutability.c
+++ b/cogl/tests/conform/test-vertex-buffer-mutability.c
@@ -188,7 +188,7 @@ test_vertex_buffer_mutability (TestUtilsGTestFixture *fixture,
 
   clutter_main ();
 
-  cogl_handle_unref (state.buffer);
+  cogl_object_unref (state.buffer);
 
   g_source_remove (idle_source);
 
diff --git a/cogl/tests/conform/test-viewport.c b/cogl/tests/conform/test-viewport.c
index 3127510a8..b694b1eac 100644
--- a/cogl/tests/conform/test-viewport.c
+++ b/cogl/tests/conform/test-viewport.c
@@ -335,7 +335,7 @@ on_paint (ClutterActor *actor, void *state)
   cogl_set_viewport (0, 0, 10, 10);
 
   cogl_pop_framebuffer ();
-  cogl_handle_unref (offscreen);
+  cogl_object_unref (offscreen);
 
   /*
    * Verify that the previous onscreen framebuffer's viewport was restored
@@ -361,7 +361,7 @@ on_paint (ClutterActor *actor, void *state)
   cogl_rectangle (-1, 1, 1, -1);
 #endif
 
-  cogl_handle_unref (tex);
+  cogl_object_unref (tex);
 
   /* Finally restore the stage's original state... */
   cogl_pop_matrix ();
diff --git a/cogl/tests/conform/test-wrap-modes.c b/cogl/tests/conform/test-wrap-modes.c
index 22fefb23a..e1985b8e8 100644
--- a/cogl/tests/conform/test-wrap-modes.c
+++ b/cogl/tests/conform/test-wrap-modes.c
@@ -173,7 +173,7 @@ draw_tests_vbo (TestState *state)
       cogl_pop_matrix ();
     }
 
-  cogl_handle_unref (vbo);
+  cogl_object_unref (vbo);
 }
 
 static void
diff --git a/src/tests/clutter/interactive/test-cogl-multitexture.c 
b/src/tests/clutter/interactive/test-cogl-multitexture.c
index 3151b6e08..e877d2b73 100644
--- a/src/tests/clutter/interactive/test-cogl-multitexture.c
+++ b/src/tests/clutter/interactive/test-cogl-multitexture.c
@@ -225,12 +225,12 @@ test_cogl_multitexture_main (int argc, char *argv[])
 
   clutter_main();
 
-  cogl_handle_unref (state->material1);
-  cogl_handle_unref (state->material0);
-  cogl_handle_unref (state->alpha_tex);
-  cogl_handle_unref (state->redhand_tex);
-  cogl_handle_unref (state->light_tex0);
-  cogl_handle_unref (state->light_tex1);
+  cogl_object_unref (state->material1);
+  cogl_object_unref (state->material0);
+  cogl_object_unref (state->alpha_tex);
+  cogl_object_unref (state->redhand_tex);
+  cogl_object_unref (state->light_tex0);
+  cogl_object_unref (state->light_tex1);
   g_free (state);
 
   return 0;
diff --git a/src/tests/clutter/interactive/test-cogl-offscreen.c 
b/src/tests/clutter/interactive/test-cogl-offscreen.c
index 948d978fe..116f03120 100644
--- a/src/tests/clutter/interactive/test-cogl-offscreen.c
+++ b/src/tests/clutter/interactive/test-cogl-offscreen.c
@@ -133,8 +133,8 @@ test_coglbox_dispose (GObject *object)
 
   priv = TEST_COGLBOX_GET_PRIVATE (object);
 
-  cogl_handle_unref (priv->texture_id);
-  cogl_handle_unref (priv->offscreen_id);
+  cogl_object_unref (priv->texture_id);
+  cogl_object_unref (priv->offscreen_id);
 
   G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object);
 }
diff --git a/src/tests/clutter/interactive/test-cogl-point-sprites.c 
b/src/tests/clutter/interactive/test-cogl-point-sprites.c
index cd94966de..9cca9df78 100644
--- a/src/tests/clutter/interactive/test-cogl-point-sprites.c
+++ b/src/tests/clutter/interactive/test-cogl-point-sprites.c
@@ -209,7 +209,7 @@ paint_cb (ClutterActor *stage, Data *data)
   cogl_set_source (data->material);
   cogl_vertex_buffer_draw (vbo, COGL_VERTICES_MODE_POINTS, 0, N_SPARKS);
 
-  cogl_handle_unref (vbo);
+  cogl_object_unref (vbo);
 
   cogl_set_projection_matrix (&old_matrix);
   cogl_pop_matrix ();
@@ -242,7 +242,7 @@ test_cogl_point_sprites_main (int argc, char *argv[])
 
   tex = generate_round_texture ();
   cogl_material_set_layer (data.material, 0, tex);
-  cogl_handle_unref (tex);
+  cogl_object_unref (tex);
 
   if (!cogl_material_set_layer_point_sprite_coords_enabled (data.material,
                                                             0, TRUE,
diff --git a/src/tests/clutter/interactive/test-cogl-shader-glsl.c 
b/src/tests/clutter/interactive/test-cogl-shader-glsl.c
index 22c47d0ee..a269aa476 100644
--- a/src/tests/clutter/interactive/test-cogl-shader-glsl.c
+++ b/src/tests/clutter/interactive/test-cogl-shader-glsl.c
@@ -197,7 +197,7 @@ set_shader_num (int new_no)
 
   program = cogl_create_program ();
   cogl_program_attach_shader (program, shader);
-  cogl_handle_unref (shader);
+  cogl_object_unref (shader);
   cogl_program_link (program);
 
   uniform_no = cogl_program_get_uniform_location (program, "tex");
@@ -215,7 +215,7 @@ set_shader_num (int new_no)
   cogl_program_set_uniform_1f (program, uniform_no, 1.0f / image_height);
 
   cogl_material_set_user_program (material, program);
-  cogl_handle_unref (program);
+  cogl_object_unref (program);
 
   shader_no = new_no;
 }
diff --git a/src/tests/clutter/interactive/test-cogl-tex-convert.c 
b/src/tests/clutter/interactive/test-cogl-tex-convert.c
index 0f025d703..0e975a8c1 100644
--- a/src/tests/clutter/interactive/test-cogl-tex-convert.c
+++ b/src/tests/clutter/interactive/test-cogl-tex-convert.c
@@ -137,7 +137,7 @@ test_coglbox_dispose (GObject *object)
   TestCoglboxPrivate *priv;
   
   priv = TEST_COGLBOX_GET_PRIVATE (object);
-  cogl_handle_unref (priv->cogl_tex_id);
+  cogl_object_unref (priv->cogl_tex_id);
   
   G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object);
 }
diff --git a/src/tests/clutter/interactive/test-cogl-tex-polygon.c 
b/src/tests/clutter/interactive/test-cogl-tex-polygon.c
index 2bfc60ae6..2a4e78517 100644
--- a/src/tests/clutter/interactive/test-cogl-tex-polygon.c
+++ b/src/tests/clutter/interactive/test-cogl-tex-polygon.c
@@ -220,7 +220,7 @@ test_coglbox_paint (ClutterActor *self)
 
   cogl_pop_matrix ();
 
-  cogl_handle_unref (material);
+  cogl_object_unref (material);
 }
 
 static void
@@ -235,8 +235,8 @@ test_coglbox_dispose (GObject *object)
   TestCoglboxPrivate *priv;
 
   priv = TEST_COGLBOX_GET_PRIVATE (object);
-  cogl_handle_unref (priv->not_sliced_tex);
-  cogl_handle_unref (priv->sliced_tex);
+  cogl_object_unref (priv->not_sliced_tex);
+  cogl_object_unref (priv->sliced_tex);
 
   G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object);
 }
diff --git a/src/tests/clutter/interactive/test-cogl-tex-tile.c 
b/src/tests/clutter/interactive/test-cogl-tex-tile.c
index 09b2a445f..518e4f0f6 100644
--- a/src/tests/clutter/interactive/test-cogl-tex-tile.c
+++ b/src/tests/clutter/interactive/test-cogl-tex-tile.c
@@ -134,7 +134,7 @@ test_coglbox_dispose (GObject *object)
   TestCoglboxPrivate *priv;
 
   priv = TEST_COGLBOX_GET_PRIVATE (object);
-  cogl_handle_unref (priv->cogl_tex_id);
+  cogl_object_unref (priv->cogl_tex_id);
 
   G_OBJECT_CLASS (test_coglbox_parent_class)->dispose (object);
 }
diff --git a/src/tests/clutter/interactive/test-cogl-vertex-buffer.c 
b/src/tests/clutter/interactive/test-cogl-vertex-buffer.c
index 9683e07f3..65ae9d3c6 100644
--- a/src/tests/clutter/interactive/test-cogl-vertex-buffer.c
+++ b/src/tests/clutter/interactive/test-cogl-vertex-buffer.c
@@ -383,8 +383,8 @@ test_cogl_vertex_buffer_main (int argc, char *argv[])
 
   clutter_main ();
 
-  cogl_handle_unref (state.buffer);
-  cogl_handle_unref (state.indices);
+  cogl_object_unref (state.buffer);
+  cogl_object_unref (state.indices);
 
   return 0;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]