[mutter/wip/nielsdg/coglhandle-stepped-approach: 4/4] cogl: Remove COGL_INVALID_HANDLE
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/coglhandle-stepped-approach: 4/4] cogl: Remove COGL_INVALID_HANDLE
- Date: Wed, 20 Feb 2019 16:41:39 +0000 (UTC)
commit 06bfb6d41cbfe5433c4b8f2ed24da4463c73fcc9
Author: Niels De Graef <niels degraef barco com>
Date: Wed Feb 20 14:53:01 2019 +0100
cogl: Remove COGL_INVALID_HANDLE
Just use `NULL`, which is the normal C convention
https://gitlab.gnome.org/GNOME/mutter/merge_requests/451
clutter/clutter/clutter-backend.c | 4 +--
clutter/clutter/clutter-offscreen-effect.c | 4 +--
clutter/clutter/clutter-shader-effect.c | 30 +++++++++----------
clutter/clutter/deprecated/clutter-cairo-texture.c | 2 +-
clutter/clutter/deprecated/clutter-shader.c | 34 +++++++++++-----------
clutter/tests/interactive/test-cogl-offscreen.c | 4 +--
clutter/tests/interactive/test-cogl-shader-glsl.c | 2 +-
clutter/tests/interactive/test-cogl-tex-foreign.c | 2 +-
clutter/tests/interactive/test-cogl-tex-polygon.c | 4 +--
cogl/cogl/cogl-pipeline-state.c | 8 ++---
cogl/cogl/cogl-pipeline-state.h | 2 +-
cogl/cogl/cogl-pipeline.c | 8 ++---
cogl/cogl/cogl-types.h | 8 -----
cogl/cogl/deprecated/cogl-material-compat.h | 4 +--
cogl/cogl/deprecated/cogl-program.c | 6 ++--
cogl/cogl/deprecated/cogl-shader.c | 4 +--
cogl/cogl/deprecated/cogl-shader.h | 4 +--
cogl/cogl/deprecated/cogl-vertex-buffer.c | 12 ++++----
cogl/tests/conform/test-just-vertex-shader.c | 4 +--
19 files changed, 69 insertions(+), 77 deletions(-)
---
diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c
index 2b9c3d1a1..5bb9d4e32 100644
--- a/clutter/clutter/clutter-backend.c
+++ b/clutter/clutter/clutter-backend.c
@@ -693,7 +693,7 @@ clutter_backend_init (ClutterBackend *self)
self->units_per_em = -1.0;
self->units_serial = 1;
- self->dummy_onscreen = COGL_INVALID_HANDLE;
+ self->dummy_onscreen = NULL;
}
void
@@ -1164,7 +1164,7 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend)
void
_clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
{
- if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
+ if (backend->dummy_onscreen == NULL)
{
CoglError *internal_error = NULL;
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index aa00bb228..f1ca0ea1c 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -485,7 +485,7 @@ clutter_offscreen_effect_init (ClutterOffscreenEffect *self)
* used instead of clutter_offscreen_effect_get_target() when the
* effect subclass wants to paint using its own material.
*
- * Return value: (transfer none): a #CoglHandle or %COGL_INVALID_HANDLE. The
+ * Return value: (transfer none): a #CoglHandle or %NULL. The
* returned texture is owned by Clutter and it should not be
* modified or freed
*
@@ -550,7 +550,7 @@ clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect)
* Calls the create_texture() virtual function of the @effect
*
* Return value: (transfer full): a handle to a Cogl texture, or
- * %COGL_INVALID_HANDLE. The returned handle has its reference
+ * %NULL. The returned handle has its reference
* count increased.
*
* Since: 1.4
diff --git a/clutter/clutter/clutter-shader-effect.c b/clutter/clutter/clutter-shader-effect.c
index 615e77862..149da057f 100644
--- a/clutter/clutter/clutter-shader-effect.c
+++ b/clutter/clutter/clutter-shader-effect.c
@@ -177,18 +177,18 @@ clutter_shader_effect_clear (ClutterShaderEffect *self,
{
ClutterShaderEffectPrivate *priv = self->priv;
- if (priv->shader != COGL_INVALID_HANDLE)
+ if (priv->shader != NULL)
{
cogl_object_unref (priv->shader);
- priv->shader = COGL_INVALID_HANDLE;
+ priv->shader = NULL;
}
- if (priv->program != COGL_INVALID_HANDLE)
+ if (priv->program != NULL)
{
cogl_object_unref (priv->program);
- priv->program = COGL_INVALID_HANDLE;
+ priv->program = NULL;
}
if (reset_uniforms && priv->uniforms != NULL)
@@ -208,7 +208,7 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect)
gpointer key, value;
gsize size;
- if (priv->program == COGL_INVALID_HANDLE)
+ if (priv->program == NULL)
return;
if (priv->uniforms == NULL)
@@ -333,7 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
default:
g_assert_not_reached ();
- return COGL_INVALID_HANDLE;
+ return NULL;
}
}
@@ -353,7 +353,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
CLUTTER_TYPE_SHADER_EFFECT,
ClutterShaderEffectClassPrivate);
- if (class_priv->shader == COGL_INVALID_HANDLE)
+ if (class_priv->shader == NULL)
{
gchar *source;
@@ -389,7 +389,7 @@ clutter_shader_effect_try_static_source (ClutterShaderEffect *self)
priv->shader = cogl_object_ref (class_priv->shader);
- if (class_priv->program != COGL_INVALID_HANDLE)
+ if (class_priv->program != NULL)
priv->program = cogl_object_ref (class_priv->program);
}
}
@@ -404,13 +404,13 @@ clutter_shader_effect_paint_target (ClutterOffscreenEffect *effect)
/* If the source hasn't been set then we'll try to get it from the
static source instead */
- if (priv->shader == COGL_INVALID_HANDLE)
+ if (priv->shader == NULL)
clutter_shader_effect_try_static_source (self);
/* we haven't been prepared or we don't have support for
* GLSL shaders in Clutter
*/
- if (priv->program == COGL_INVALID_HANDLE)
+ if (priv->program == NULL)
goto out;
CLUTTER_NOTE (SHADER, "Applying the shader effect of type '%s'",
@@ -533,7 +533,7 @@ clutter_shader_effect_new (ClutterShaderType shader_type)
* Retrieves a pointer to the shader's handle
*
* Return value: (transfer none): a pointer to the shader's handle,
- * or %COGL_INVALID_HANDLE
+ * or %NULL
*
* Since: 1.4
*/
@@ -541,7 +541,7 @@ CoglHandle
clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
{
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
- COGL_INVALID_HANDLE);
+ NULL);
return effect->priv->shader;
}
@@ -553,7 +553,7 @@ clutter_shader_effect_get_shader (ClutterShaderEffect *effect)
* Retrieves a pointer to the program's handle
*
* Return value: (transfer none): a pointer to the program's handle,
- * or %COGL_INVALID_HANDLE
+ * or %NULL
*
* Since: 1.4
*/
@@ -561,7 +561,7 @@ CoglHandle
clutter_shader_effect_get_program (ClutterShaderEffect *effect)
{
g_return_val_if_fail (CLUTTER_IS_SHADER_EFFECT (effect),
- COGL_INVALID_HANDLE);
+ NULL);
return effect->priv->program;
}
@@ -891,7 +891,7 @@ clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
priv = effect->priv;
- if (priv->shader != COGL_INVALID_HANDLE)
+ if (priv->shader != NULL)
return TRUE;
priv->shader = clutter_shader_effect_create_shader (effect);
diff --git a/clutter/clutter/deprecated/clutter-cairo-texture.c
b/clutter/clutter/deprecated/clutter-cairo-texture.c
index 8d67af038..f8e513728 100644
--- a/clutter/clutter/deprecated/clutter-cairo-texture.c
+++ b/clutter/clutter/deprecated/clutter-cairo-texture.c
@@ -294,7 +294,7 @@ clutter_cairo_texture_context_destroy (void *data)
cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (cairo));
if (cairo_width == 0 ||
cairo_height == 0 ||
- cogl_texture == COGL_INVALID_HANDLE)
+ cogl_texture == NULL)
{
draw_context_destroy (ctxt);
return;
diff --git a/clutter/clutter/deprecated/clutter-shader.c b/clutter/clutter/deprecated/clutter-shader.c
index 1bb4d0b2a..c5aa8e52e 100644
--- a/clutter/clutter/deprecated/clutter-shader.c
+++ b/clutter/clutter/deprecated/clutter-shader.c
@@ -98,20 +98,20 @@ clutter_shader_release_internal (ClutterShader *shader)
if (!priv->compiled)
return;
- g_assert (priv->program != COGL_INVALID_HANDLE);
+ g_assert (priv->program != NULL);
- if (priv->vertex_shader != COGL_INVALID_HANDLE)
+ if (priv->vertex_shader != NULL)
cogl_object_unref (priv->vertex_shader);
- if (priv->fragment_shader != COGL_INVALID_HANDLE)
+ if (priv->fragment_shader != NULL)
cogl_object_unref (priv->fragment_shader);
- if (priv->program != COGL_INVALID_HANDLE)
+ if (priv->program != NULL)
cogl_object_unref (priv->program);
- priv->vertex_shader = COGL_INVALID_HANDLE;
- priv->fragment_shader = COGL_INVALID_HANDLE;
- priv->program = COGL_INVALID_HANDLE;
+ priv->vertex_shader = NULL;
+ priv->fragment_shader = NULL;
+ priv->program = NULL;
priv->compiled = FALSE;
}
@@ -313,9 +313,9 @@ clutter_shader_init (ClutterShader *self)
priv->vertex_source = NULL;
priv->fragment_source = NULL;
- priv->program = COGL_INVALID_HANDLE;
- priv->vertex_shader = COGL_INVALID_HANDLE;
- priv->fragment_shader = COGL_INVALID_HANDLE;
+ priv->program = NULL;
+ priv->vertex_shader = NULL;
+ priv->fragment_shader = NULL;
}
/**
@@ -456,7 +456,7 @@ clutter_shader_get_cogl_shader (ClutterShader *shader,
return shader->priv->vertex_shader;
}
- return COGL_INVALID_HANDLE;
+ return NULL;
}
static gboolean
@@ -465,7 +465,7 @@ clutter_shader_glsl_bind (ClutterShader *self,
GError **error)
{
ClutterShaderPrivate *priv = self->priv;
- CoglHandle shader = COGL_INVALID_HANDLE;
+ CoglHandle shader = NULL;
switch (shader_type)
{
@@ -484,7 +484,7 @@ clutter_shader_glsl_bind (ClutterShader *self,
break;
}
- g_assert (shader != COGL_INVALID_HANDLE);
+ g_assert (shader != NULL);
cogl_shader_compile (shader);
if (!cogl_shader_is_compiled (shader))
@@ -524,7 +524,7 @@ bind_glsl_shader (ClutterShader *self,
priv->program = cogl_create_program ();
- if (priv->vertex_source != COGL_INVALID_HANDLE)
+ if (priv->vertex_source != NULL)
{
res = clutter_shader_glsl_bind (self,
CLUTTER_VERTEX_SHADER,
@@ -537,7 +537,7 @@ bind_glsl_shader (ClutterShader *self,
}
}
- if (priv->fragment_source != COGL_INVALID_HANDLE)
+ if (priv->fragment_source != NULL)
{
res = clutter_shader_glsl_bind (self,
CLUTTER_FRAGMENT_SHADER,
@@ -685,7 +685,7 @@ clutter_shader_set_is_enabled (ClutterShader *shader,
if (priv->is_enabled)
cogl_program_use (priv->program);
else
- cogl_program_use (COGL_INVALID_HANDLE);
+ cogl_program_use (NULL);
g_object_notify_by_pspec (G_OBJECT (shader), obj_props[PROP_ENABLED]);
}
@@ -744,7 +744,7 @@ clutter_shader_set_uniform (ClutterShader *shader,
G_VALUE_HOLDS_INT (value));
priv = shader->priv;
- g_return_if_fail (priv->program != COGL_INVALID_HANDLE);
+ g_return_if_fail (priv->program != NULL);
location = cogl_program_get_uniform_location (priv->program, name);
diff --git a/clutter/tests/interactive/test-cogl-offscreen.c b/clutter/tests/interactive/test-cogl-offscreen.c
index fb2c34384..861fa81c6 100644
--- a/clutter/tests/interactive/test-cogl-offscreen.c
+++ b/clutter/tests/interactive/test-cogl-offscreen.c
@@ -256,7 +256,7 @@ test_coglbox_map (ClutterActor *actor)
cogl_pop_framebuffer ();
- if (priv->offscreen_id == COGL_INVALID_HANDLE)
+ if (priv->offscreen_id == NULL)
printf ("Failed creating offscreen to texture!\n");
}
@@ -281,7 +281,7 @@ test_coglbox_init (TestCoglbox *self)
COGL_TEXTURE_NONE,
COGL_PIXEL_FORMAT_RGB_888);
- if (priv->texture_id == COGL_INVALID_HANDLE)
+ if (priv->texture_id == NULL)
printf ("Failed creating texture with size!\n");
}
diff --git a/clutter/tests/interactive/test-cogl-shader-glsl.c
b/clutter/tests/interactive/test-cogl-shader-glsl.c
index a269aa476..ed4cf3e92 100644
--- a/clutter/tests/interactive/test-cogl-shader-glsl.c
+++ b/clutter/tests/interactive/test-cogl-shader-glsl.c
@@ -320,7 +320,7 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
COGL_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_ANY,
&error);
- if (redhand == COGL_INVALID_HANDLE)
+ if (redhand == NULL)
g_error ("image load failed: %s", error->message);
material = cogl_material_new ();
diff --git a/clutter/tests/interactive/test-cogl-tex-foreign.c
b/clutter/tests/interactive/test-cogl-tex-foreign.c
index e2cfa30df..941420855 100644
--- a/clutter/tests/interactive/test-cogl-tex-foreign.c
+++ b/clutter/tests/interactive/test-cogl-tex-foreign.c
@@ -219,7 +219,7 @@ test_coglbox_init (TestCoglbox *self)
2, 2, 0, 0,
COGL_PIXEL_FORMAT_RGB_888);
- if (priv->cogl_handle == COGL_INVALID_HANDLE)
+ if (priv->cogl_handle == NULL)
{
printf ("Failed creating texture from foreign!\n");
return;
diff --git a/clutter/tests/interactive/test-cogl-tex-polygon.c
b/clutter/tests/interactive/test-cogl-tex-polygon.c
index d79230c28..9ae3cbda9 100644
--- a/clutter/tests/interactive/test-cogl-tex-polygon.c
+++ b/clutter/tests/interactive/test-cogl-tex-polygon.c
@@ -259,7 +259,7 @@ test_coglbox_init (TestCoglbox *self)
COGL_TEXTURE_NONE,
COGL_PIXEL_FORMAT_ANY,
&error);
- if (priv->sliced_tex == COGL_INVALID_HANDLE)
+ if (priv->sliced_tex == NULL)
{
if (error)
{
@@ -276,7 +276,7 @@ test_coglbox_init (TestCoglbox *self)
COGL_TEXTURE_NO_SLICING,
COGL_PIXEL_FORMAT_ANY,
&error);
- if (priv->not_sliced_tex == COGL_INVALID_HANDLE)
+ if (priv->not_sliced_tex == NULL)
{
if (error)
{
diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c
index cb84f1ccc..2ad339e04 100644
--- a/cogl/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl/cogl-pipeline-state.c
@@ -1081,7 +1081,7 @@ cogl_pipeline_get_user_program (CoglPipeline *pipeline)
{
CoglPipeline *authority;
- _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), COGL_INVALID_HANDLE);
+ _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), NULL);
authority =
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_USER_SHADER);
@@ -1116,7 +1116,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
*/
_cogl_pipeline_pre_change_notify (pipeline, state, NULL, FALSE);
- if (program != COGL_INVALID_HANDLE)
+ if (program != NULL)
_cogl_pipeline_set_progend (pipeline, COGL_PIPELINE_PROGEND_UNDEFINED);
/* If we are the current authority see if we can revert to one of our
@@ -1141,10 +1141,10 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
_cogl_pipeline_prune_redundant_ancestry (pipeline);
}
- if (program != COGL_INVALID_HANDLE)
+ if (program != NULL)
cogl_object_ref (program);
if (authority == pipeline &&
- pipeline->big_state->user_program != COGL_INVALID_HANDLE)
+ pipeline->big_state->user_program != NULL)
cogl_object_unref (pipeline->big_state->user_program);
pipeline->big_state->user_program = program;
diff --git a/cogl/cogl/cogl-pipeline-state.h b/cogl/cogl/cogl-pipeline-state.h
index d87a32cda..c3db13763 100644
--- a/cogl/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl/cogl-pipeline-state.h
@@ -609,7 +609,7 @@ cogl_pipeline_set_color_mask (CoglPipeline *pipeline,
* Queries what user program has been associated with the given
* @pipeline using cogl_pipeline_set_user_program().
*
- * Return value: (transfer none): The current user program or %COGL_INVALID_HANDLE.
+ * Return value: (transfer none): The current user program or %NULL.
*
* Since: 2.0
* Stability: Unstable
diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c
index 21c2f6614..6cda407e3 100644
--- a/cogl/cogl/cogl-pipeline.c
+++ b/cogl/cogl/cogl-pipeline.c
@@ -183,7 +183,7 @@ _cogl_pipeline_init_default_pipeline (void)
blend_state->blend_src_factor_rgb = GL_ONE;
blend_state->blend_dst_factor_rgb = GL_ONE_MINUS_SRC_ALPHA;
- big_state->user_program = COGL_INVALID_HANDLE;
+ big_state->user_program = NULL;
cogl_depth_state_init (&big_state->depth_state);
@@ -756,7 +756,7 @@ _cogl_pipeline_change_implies_transparency (CoglPipeline *pipeline,
*
* TODO: check that it isn't just a vertex shader!
*/
- if (_cogl_pipeline_get_user_program (pipeline) != COGL_INVALID_HANDLE)
+ if (_cogl_pipeline_get_user_program (pipeline) != NULL)
return TRUE;
}
@@ -1004,7 +1004,7 @@ _cogl_pipeline_copy_differences (CoglPipeline *dest,
big_state->user_program =
cogl_object_ref (src->big_state->user_program);
else
- big_state->user_program = COGL_INVALID_HANDLE;
+ big_state->user_program = NULL;
}
if (differences & COGL_PIPELINE_STATE_DEPTH)
@@ -2603,7 +2603,7 @@ _cogl_pipeline_apply_legacy_state (CoglPipeline *pipeline)
/* A program explicitly set on the pipeline has higher precedence than
* one associated with the context using cogl_program_use() */
if (ctx->current_program &&
- cogl_pipeline_get_user_program (pipeline) == COGL_INVALID_HANDLE)
+ cogl_pipeline_get_user_program (pipeline) == NULL)
cogl_pipeline_set_user_program (pipeline, ctx->current_program);
if (ctx->legacy_depth_test_enabled)
diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h
index 72d412ee2..6aa5ba248 100644
--- a/cogl/cogl/cogl-types.h
+++ b/cogl/cogl/cogl-types.h
@@ -80,14 +80,6 @@ typedef struct { \
*/
typedef void * CoglHandle;
-/**
- * COGL_INVALID_HANDLE:
- *
- * A COGL handle that is not valid, used for unitialized handles as well as
- * error conditions.
- */
-#define COGL_INVALID_HANDLE NULL
-
#define COGL_TYPE_HANDLE (cogl_handle_get_type ())
GType
cogl_handle_get_type (void) G_GNUC_CONST;
diff --git a/cogl/cogl/deprecated/cogl-material-compat.h b/cogl/cogl/deprecated/cogl-material-compat.h
index 22a6dd589..8fc42667e 100644
--- a/cogl/cogl/deprecated/cogl-material-compat.h
+++ b/cogl/cogl/deprecated/cogl-material-compat.h
@@ -704,7 +704,7 @@ cogl_material_get_point_size (CoglMaterial *material);
* @material using cogl_material_set_user_program().
*
* Return value: (transfer none): The current user program
- * or %COGL_INVALID_HANDLE.
+ * or %NULL.
*
* Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead instead
@@ -1022,7 +1022,7 @@ cogl_material_layer_get_type (CoglMaterialLayer *layer);
* Extracts a texture handle for a specific layer.
*
* <note>In the future Cogl may support purely GLSL based layers; for those
- * layers this function which will likely return %COGL_INVALID_HANDLE if you
+ * layers this function which will likely return %NULL if you
* try to get the texture handle from them. Considering this scenario, you
* should call cogl_material_layer_get_type() first in order check it is of
* type %COGL_MATERIAL_LAYER_TYPE_TEXTURE before calling this function.</note>
diff --git a/cogl/cogl/deprecated/cogl-program.c b/cogl/cogl/deprecated/cogl-program.c
index a8086c84e..73bc54868 100644
--- a/cogl/cogl/deprecated/cogl-program.c
+++ b/cogl/cogl/deprecated/cogl-program.c
@@ -133,7 +133,7 @@ cogl_program_use (CoglHandle handle)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- _COGL_RETURN_IF_FAIL (handle == COGL_INVALID_HANDLE ||
+ _COGL_RETURN_IF_FAIL (handle == NULL ||
cogl_is_program (handle));
if (ctx->current_program == 0 && handle != 0)
@@ -141,9 +141,9 @@ cogl_program_use (CoglHandle handle)
else if (handle == 0 && ctx->current_program != 0)
ctx->legacy_state_set--;
- if (handle != COGL_INVALID_HANDLE)
+ if (handle != NULL)
cogl_object_ref (handle);
- if (ctx->current_program != COGL_INVALID_HANDLE)
+ if (ctx->current_program != NULL)
cogl_object_unref (ctx->current_program);
ctx->current_program = handle;
}
diff --git a/cogl/cogl/deprecated/cogl-shader.c b/cogl/cogl/deprecated/cogl-shader.c
index d6304f8de..e11c4918a 100644
--- a/cogl/cogl/deprecated/cogl-shader.c
+++ b/cogl/cogl/deprecated/cogl-shader.c
@@ -71,7 +71,7 @@ cogl_create_shader (CoglShaderType type)
{
CoglShader *shader;
- _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
+ _COGL_GET_CONTEXT (ctx, NULL);
switch (type)
{
@@ -81,7 +81,7 @@ cogl_create_shader (CoglShaderType type)
default:
g_warning ("Unexpected shader type (0x%08lX) given to "
"cogl_create_shader", (unsigned long) type);
- return COGL_INVALID_HANDLE;
+ return NULL;
}
shader = g_slice_new (CoglShader);
diff --git a/cogl/cogl/deprecated/cogl-shader.h b/cogl/cogl/deprecated/cogl-shader.h
index 91733c8f6..a327c5634 100644
--- a/cogl/cogl/deprecated/cogl-shader.h
+++ b/cogl/cogl/deprecated/cogl-shader.h
@@ -457,10 +457,10 @@ cogl_program_link (CoglHandle handle);
/**
* cogl_program_use:
- * @handle: a #CoglHandle for a shader program or %COGL_INVALID_HANDLE.
+ * @handle: a #CoglHandle for a shader program or %NULL.
*
* Activate a specific shader program replacing that part of the GL
- * rendering pipeline, if passed in %COGL_INVALID_HANDLE the default
+ * rendering pipeline, if passed in %NULL the default
* behavior of GL is reinstated.
*
* This function affects the global state of the current Cogl
diff --git a/cogl/cogl/deprecated/cogl-vertex-buffer.c b/cogl/cogl/deprecated/cogl-vertex-buffer.c
index a14f38bc6..26c91b269 100644
--- a/cogl/cogl/deprecated/cogl-vertex-buffer.c
+++ b/cogl/cogl/deprecated/cogl-vertex-buffer.c
@@ -138,7 +138,7 @@ cogl_vertex_buffer_new (unsigned int n_vertices)
buffer->primitive = cogl_primitive_new (COGL_VERTICES_MODE_TRIANGLES,
n_vertices, NULL);
- /* return COGL_INVALID_HANDLE; */
+ /* return NULL; */
return _cogl_vertex_buffer_object_new (buffer);
}
@@ -1675,7 +1675,7 @@ cogl_vertex_buffer_indices_new (CoglIndicesType indices_type,
{
CoglIndices *indices;
- _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
+ _COGL_GET_CONTEXT (ctx, NULL);
indices = cogl_indices_new (ctx, indices_type, indices_array, indices_len);
return _cogl_vertex_buffer_indices_new_real (indices);
@@ -1749,11 +1749,11 @@ _cogl_vertex_buffer_free (CoglVertexBuffer *buffer)
CoglHandle
cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
{
- _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
+ _COGL_GET_CONTEXT (ctx, NULL);
if (n_indices <= 256 / 4 * 6)
{
- if (ctx->quad_buffer_indices_byte == COGL_INVALID_HANDLE)
+ if (ctx->quad_buffer_indices_byte == NULL)
{
/* NB: cogl_get_quad_indices takes n_quads not n_indices... */
CoglIndices *indices = cogl_get_rectangle_indices (ctx, 256 / 4);
@@ -1770,10 +1770,10 @@ cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
ctx->quad_buffer_indices_len < n_indices)
{
cogl_object_unref (ctx->quad_buffer_indices);
- ctx->quad_buffer_indices = COGL_INVALID_HANDLE;
+ ctx->quad_buffer_indices = NULL;
}
- if (ctx->quad_buffer_indices == COGL_INVALID_HANDLE)
+ if (ctx->quad_buffer_indices == NULL)
{
/* NB: cogl_get_quad_indices takes n_quads not n_indices... */
CoglIndices *indices =
diff --git a/cogl/tests/conform/test-just-vertex-shader.c b/cogl/tests/conform/test-just-vertex-shader.c
index c7512961b..9455e3412 100644
--- a/cogl/tests/conform/test-just-vertex-shader.c
+++ b/cogl/tests/conform/test-just-vertex-shader.c
@@ -91,7 +91,7 @@ paint_legacy (TestState *state)
/* Draw it again using the program. It should look exactly the same */
cogl_program_use (program);
cogl_rectangle (50, 0, 100, 50);
- cogl_program_use (COGL_INVALID_HANDLE);
+ cogl_program_use (NULL);
cogl_object_unref (material);
cogl_object_unref (program);
@@ -163,7 +163,7 @@ paint (TestState *state)
cogl_object_unref (program);
cogl_rectangle (50, 0, 100, 50);
- cogl_pipeline_set_user_program (pipeline, COGL_INVALID_HANDLE);
+ cogl_pipeline_set_user_program (pipeline, NULL);
cogl_object_unref (pipeline);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]