From 8f63ca6ffc95a8b4e3f5190114301d06fecea857 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 13 Sep 2010 22:56:44 +0100 Subject: [PATCH] arbfp: rename get_arbfp_authority clarifying semantics This renames the get_arbfp_authority function to get_arbfp_authority_no_check to clarify that the function doesn't validate that the authority cache is still valid by looking at the age of the referenced material. The function should only be used when we *know* the cache has already been checked. --- cogl/cogl-material-arbfp.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cogl/cogl-material-arbfp.c b/cogl/cogl-material-arbfp.c index bfce68c9c..7a81a846d 100644 --- a/cogl/cogl-material-arbfp.c +++ b/cogl/cogl-material-arbfp.c @@ -371,8 +371,12 @@ _cogl_material_backend_arbfp_start (CoglMaterial *material, return TRUE; } +/* The "no_check" refers to the fact that this doesn't check that the + * cache is still valid by looking at the age of the referenced + * material. This should only be used where we *know* the cache has + * already been checked. */ static CoglMaterial * -get_arbfp_authority (CoglMaterial *material) +get_arbfp_authority_no_check (CoglMaterial *material) { CoglMaterialBackendARBfpPrivate *priv = material->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; @@ -551,7 +555,7 @@ setup_arg (CoglMaterial *material, GLint op, CoglMaterialBackendARBfpArg *arg) { - CoglMaterial *arbfp_authority = get_arbfp_authority (material); + CoglMaterial *arbfp_authority = get_arbfp_authority_no_check (material); CoglMaterialBackendARBfpPrivate *priv = arbfp_authority->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; static const char *tmp_name[3] = { "tmp0", "tmp1", "tmp2" }; @@ -692,7 +696,7 @@ append_function (CoglMaterial *material, CoglMaterialBackendARBfpArg *args, int n_args) { - CoglMaterial *arbfp_authority = get_arbfp_authority (material); + CoglMaterial *arbfp_authority = get_arbfp_authority_no_check (material); CoglMaterialBackendARBfpPrivate *priv = arbfp_authority->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; const char *mask_name; @@ -859,7 +863,7 @@ _cogl_material_backend_arbfp_add_layer (CoglMaterial *material, CoglMaterialLayer *layer, unsigned long layers_difference) { - CoglMaterial *arbfp_authority = get_arbfp_authority (material); + CoglMaterial *arbfp_authority = get_arbfp_authority_no_check (material); CoglMaterialBackendARBfpPrivate *priv = arbfp_authority->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; CoglMaterialLayer *combine_authority = @@ -942,7 +946,7 @@ _cogl_material_backend_arbfp_add_layer (CoglMaterial *material, gboolean _cogl_material_backend_arbfp_passthrough (CoglMaterial *material) { - CoglMaterial *arbfp_authority = get_arbfp_authority (material); + CoglMaterial *arbfp_authority = get_arbfp_authority_no_check (material); CoglMaterialBackendARBfpPrivate *priv = arbfp_authority->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; @@ -957,7 +961,7 @@ static gboolean _cogl_material_backend_arbfp_end (CoglMaterial *material, unsigned long materials_difference) { - CoglMaterial *arbfp_authority = get_arbfp_authority (material); + CoglMaterial *arbfp_authority = get_arbfp_authority_no_check (material); CoglMaterialBackendARBfpPrivate *priv = arbfp_authority->backend_privs[COGL_MATERIAL_BACKEND_ARBFP]; GLuint gl_program;