material: add internal layer filter getters

This adds internal _cogl_material_get_layer_filters and
_cogl_material_get_layer_{min,mag}_filter functions which can be used to
query the filters associated with a layer using a layer_index, as
opposed to a layer pointer. Accessing layer pointers is considered
deprecated so we need to provide layer_index based replacements.
This commit is contained in:
Robert Bragg 2010-10-18 19:00:50 +01:00
parent 0330a7a2e6
commit a74c26d8d1
2 changed files with 59 additions and 0 deletions

View File

@ -873,6 +873,20 @@ _cogl_material_layer_get_filters (CoglMaterialLayer *layer,
CoglMaterialFilter *min_filter,
CoglMaterialFilter *mag_filter);
void
_cogl_material_get_layer_filters (CoglMaterial *material,
int layer_index,
CoglMaterialFilter *min_filter,
CoglMaterialFilter *mag_filter);
CoglMaterialFilter
_cogl_material_get_layer_min_filter (CoglMaterial *material,
int layer_index);
CoglMaterialFilter
_cogl_material_get_layer_mag_filter (CoglMaterial *material,
int layer_index);
void
_cogl_material_texture_storage_change_notify (CoglHandle texture);

View File

@ -5210,6 +5210,51 @@ _cogl_material_layer_get_filters (CoglMaterialLayer *layer,
*mag_filter = authority->mag_filter;
}
void
_cogl_material_get_layer_filters (CoglMaterial *material,
int layer_index,
CoglMaterialFilter *min_filter,
CoglMaterialFilter *mag_filter)
{
CoglMaterialLayer *layer;
CoglMaterialLayer *authority;
g_return_if_fail (cogl_is_material (material));
layer = _cogl_material_get_layer (material, layer_index);
authority =
_cogl_material_layer_get_authority (layer,
COGL_MATERIAL_LAYER_STATE_FILTERS);
*min_filter = authority->min_filter;
*mag_filter = authority->mag_filter;
}
CoglMaterialFilter
_cogl_material_get_layer_min_filter (CoglMaterial *material,
int layer_index)
{
CoglMaterialFilter min_filter;
CoglMaterialFilter mag_filter;
_cogl_material_get_layer_filters (material, layer_index,
&min_filter, &mag_filter);
return min_filter;
}
CoglMaterialFilter
_cogl_material_get_layer_mag_filter (CoglMaterial *material,
int layer_index)
{
CoglMaterialFilter min_filter;
CoglMaterialFilter mag_filter;
_cogl_material_get_layer_filters (material, layer_index,
&min_filter, &mag_filter);
return mag_filter;
}
void
_cogl_material_layer_pre_paint (CoglMaterialLayer *layer)
{