material: Adds _cogl_material_pre_paint_for_layer

This is a counter part for _cogl_material_layer_pre_paint 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:
Robert Bragg 2010-07-28 13:59:34 +01:00
parent 701a693661
commit 94e0619785
2 changed files with 17 additions and 0 deletions

View File

@ -606,6 +606,15 @@ _cogl_material_layer_has_user_matrix (CoglMaterialLayer *layer);
void void
_cogl_material_layer_pre_paint (CoglMaterialLayer *layerr); _cogl_material_layer_pre_paint (CoglMaterialLayer *layerr);
/*
* Calls the pre_paint method on the layer texture if there is
* one. This will determine whether mipmaps are needed based on the
* filter settings.
*/
void
_cogl_material_pre_paint_for_layer (CoglMaterial *material,
int layer_id);
/* /*
* CoglMaterialFlushFlag: * CoglMaterialFlushFlag:
* @COGL_MATERIAL_FLUSH_FALLBACK_MASK: The fallback_layers member is set to * @COGL_MATERIAL_FLUSH_FALLBACK_MASK: The fallback_layers member is set to

View File

@ -5237,6 +5237,14 @@ _cogl_material_layer_pre_paint (CoglMaterialLayer *layer)
} }
} }
void
_cogl_material_pre_paint_for_layer (CoglMaterial *material,
int layer_id)
{
CoglMaterialLayer *layer = _cogl_material_get_layer (material, layer_id);
_cogl_material_layer_pre_paint (layer);
}
CoglMaterialFilter CoglMaterialFilter
cogl_material_layer_get_min_filter (CoglMaterialLayer *layer) cogl_material_layer_get_min_filter (CoglMaterialLayer *layer)
{ {