[mutter/wip/nielsdg/coglhandle-stepped-approach: 1/4] cogl: Remove COGL_HANDLE_DEFINE and friends
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/coglhandle-stepped-approach: 1/4] cogl: Remove COGL_HANDLE_DEFINE and friends
- Date: Wed, 20 Feb 2019 13:54:11 +0000 (UTC)
commit 1fef0016ed5640fd38b138b27acaddd9bffd76f1
Author: Niels De Graef <niels degraef barco com>
Date: Wed Feb 20 14:20:54 2019 +0100
cogl: Remove COGL_HANDLE_DEFINE and friends
This is a cautious first step in removing `CoglHandle` and co. from the
code base.
cogl/cogl/cogl-object-private.h | 24 ------------------------
cogl/cogl/deprecated/cogl-program.c | 4 ++--
cogl/cogl/deprecated/cogl-shader.c | 4 ++--
cogl/cogl/deprecated/cogl-vertex-buffer.c | 8 ++++----
4 files changed, 8 insertions(+), 32 deletions(-)
---
diff --git a/cogl/cogl/cogl-object-private.h b/cogl/cogl/cogl-object-private.h
index 8682c27dc..510d992f2 100644
--- a/cogl/cogl/cogl-object-private.h
+++ b/cogl/cogl/cogl-object-private.h
@@ -280,30 +280,6 @@ cogl_##type_name##_unref (void *object) \
#define COGL_OBJECT_INTERNAL_DEFINE(TypeName, type_name) \
COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE (TypeName, type_name, (void) 0)
-/* For temporary compatability */
-#define COGL_HANDLE_INTERNAL_DEFINE_WITH_CODE(TypeName, type_name, code) \
- \
-COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE (TypeName, type_name, code) \
- \
-static Cogl##TypeName * \
-_cogl_##type_name##_handle_new (CoglHandle handle) \
-{ \
- return _cogl_##type_name##_object_new (handle); \
-}
-
-#define COGL_HANDLE_DEFINE_WITH_CODE(TypeName, type_name, code) \
- \
-COGL_OBJECT_DEFINE_WITH_CODE (TypeName, type_name, code) \
- \
-static Cogl##TypeName * \
-_cogl_##type_name##_handle_new (CoglHandle handle) \
-{ \
- return _cogl_##type_name##_object_new (handle); \
-}
-
-#define COGL_HANDLE_DEFINE(TypeName, type_name) \
- COGL_HANDLE_DEFINE_WITH_CODE (TypeName, type_name, (void) 0)
-
void
_cogl_object_set_user_data (CoglObject *object,
CoglUserDataKey *key,
diff --git a/cogl/cogl/deprecated/cogl-program.c b/cogl/cogl/deprecated/cogl-program.c
index 1cd2f7a50..b8e3301a9 100644
--- a/cogl/cogl/deprecated/cogl-program.c
+++ b/cogl/cogl/deprecated/cogl-program.c
@@ -42,7 +42,7 @@
static void _cogl_program_free (CoglProgram *program);
-COGL_HANDLE_DEFINE (Program, program);
+COGL_OBJECT_DEFINE (Program, program);
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (program);
/* A CoglProgram is effectively just a list of shaders that will be
@@ -91,7 +91,7 @@ cogl_create_program (void)
g_array_new (FALSE, FALSE, sizeof (CoglProgramUniform));
program->age = 0;
- return _cogl_program_handle_new (program);
+ return _cogl_program_object_new (program);
}
void
diff --git a/cogl/cogl/deprecated/cogl-shader.c b/cogl/cogl/deprecated/cogl-shader.c
index c7e17e1f8..d6304f8de 100644
--- a/cogl/cogl/deprecated/cogl-shader.c
+++ b/cogl/cogl/deprecated/cogl-shader.c
@@ -43,7 +43,7 @@
static void _cogl_shader_free (CoglShader *shader);
-COGL_HANDLE_DEFINE (Shader, shader);
+COGL_OBJECT_DEFINE (Shader, shader);
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (shader);
#ifndef GL_FRAGMENT_SHADER
@@ -90,7 +90,7 @@ cogl_create_shader (CoglShaderType type)
shader->compilation_pipeline = NULL;
shader->type = type;
- return _cogl_shader_handle_new (shader);
+ return _cogl_shader_object_new (shader);
}
static void
diff --git a/cogl/cogl/deprecated/cogl-vertex-buffer.c b/cogl/cogl/deprecated/cogl-vertex-buffer.c
index d4b837aca..9a53fac95 100644
--- a/cogl/cogl/deprecated/cogl-vertex-buffer.c
+++ b/cogl/cogl/deprecated/cogl-vertex-buffer.c
@@ -122,9 +122,9 @@ static void _cogl_vertex_buffer_free (CoglVertexBuffer *buffer);
static void _cogl_vertex_buffer_indices_free (CoglVertexBufferIndices *buffer_indices);
static CoglUserDataKey _cogl_vertex_buffer_pipeline_priv_key;
-COGL_HANDLE_DEFINE (VertexBuffer, vertex_buffer);
+COGL_OBJECT_DEFINE (VertexBuffer, vertex_buffer);
COGL_OBJECT_DEFINE_DEPRECATED_REF_COUNTING (vertex_buffer);
-COGL_HANDLE_DEFINE (VertexBufferIndices, vertex_buffer_indices);
+COGL_OBJECT_DEFINE (VertexBufferIndices, vertex_buffer_indices);
CoglHandle
cogl_vertex_buffer_new (unsigned int n_vertices)
@@ -139,7 +139,7 @@ cogl_vertex_buffer_new (unsigned int n_vertices)
n_vertices, NULL);
/* return COGL_INVALID_HANDLE; */
- return _cogl_vertex_buffer_handle_new (buffer);
+ return _cogl_vertex_buffer_object_new (buffer);
}
unsigned int
@@ -1665,7 +1665,7 @@ _cogl_vertex_buffer_indices_new_real (CoglIndices *indices)
g_slice_alloc (sizeof (CoglVertexBufferIndices));
buffer_indices->indices = indices;
- return _cogl_vertex_buffer_indices_handle_new (buffer_indices);
+ return _cogl_vertex_buffer_indices_object_new (buffer_indices);
}
CoglHandle
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]