material: Adds _cogl_material_get_layer_texture
This is a counter part for _cogl_material_layer_get_texture which takes a layer index instead of a direct CoglMaterialLayer pointer. The aim is to phase out code that directly iterates the internal layer pointers of a material since the layer pointers can change if any property of any layer is changed making direct layer pointers very fragile.
This commit is contained in:
parent
a74c26d8d1
commit
1bed79d19a
@ -926,6 +926,10 @@ _cogl_material_layer_get_authority (CoglMaterialLayer *layer,
|
|||||||
CoglHandle
|
CoglHandle
|
||||||
_cogl_material_layer_get_texture (CoglMaterialLayer *layer);
|
_cogl_material_layer_get_texture (CoglMaterialLayer *layer);
|
||||||
|
|
||||||
|
CoglHandle
|
||||||
|
_cogl_material_get_layer_texture (CoglMaterial *material,
|
||||||
|
int layer_index);
|
||||||
|
|
||||||
typedef gboolean (*CoglMaterialInternalLayerCallback) (CoglMaterialLayer *layer,
|
typedef gboolean (*CoglMaterialInternalLayerCallback) (CoglMaterialLayer *layer,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
|
@ -1970,6 +1970,15 @@ _cogl_material_layer_get_texture (CoglMaterialLayer *layer)
|
|||||||
return authority->texture;
|
return authority->texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CoglHandle
|
||||||
|
_cogl_material_get_layer_texture (CoglMaterial *material,
|
||||||
|
int layer_index)
|
||||||
|
{
|
||||||
|
CoglMaterialLayer *layer =
|
||||||
|
_cogl_material_get_layer (material, layer_index);
|
||||||
|
return _cogl_material_layer_get_texture (layer);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cogl_material_prune_empty_layer_difference (CoglMaterial *layers_authority,
|
_cogl_material_prune_empty_layer_difference (CoglMaterial *layers_authority,
|
||||||
CoglMaterialLayer *layer)
|
CoglMaterialLayer *layer)
|
||||||
|
Loading…
Reference in New Issue
Block a user