Make _cogl_pipeline_get_layer_texture public

There was no other way to get a pointer to the texture attached to a
pipeline layer apart from the using the CoglMaterial API but I think
this was just an oversight so we should add this in. It is already
maked in the sections file for the gtk-doc.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2012-02-05 21:04:14 +01:00
parent ec1bb4ce39
commit 55427a18a6
5 changed files with 21 additions and 13 deletions

View File

@ -323,7 +323,7 @@ validate_layer_cb (CoglPipeline *pipeline,
void *user_data)
{
CoglTexture *texture =
_cogl_pipeline_get_layer_texture (pipeline, layer_index);
cogl_pipeline_get_layer_texture (pipeline, layer_index);
ValidateLayerState *state = user_data;
gboolean status = TRUE;

View File

@ -121,8 +121,8 @@ _cogl_pipeline_layer_get_texture_real (CoglPipelineLayer *layer)
}
CoglTexture *
_cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
int layer_index)
cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
int layer_index)
{
CoglPipelineLayer *layer =
_cogl_pipeline_get_layer (pipeline, layer_index);
@ -1418,8 +1418,6 @@ cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
}
}
/* FIXME: deprecate and replace with
* cogl_pipeline_get_layer_texture() instead. */
CoglTexture *
_cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer)
{

View File

@ -142,6 +142,20 @@ cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
int layer_index,
CoglTexture *texture);
/**
* cogl_pipeline_get_layer_texture:
* @pipeline: A #CoglPipeline object
* @layer_index: the index of the layer
*
* Return value: the texture that was set for the given layer of the
* pipeline or %NULL if no texture was set.
* Stability: unstable
* Since: 1.10
*/
CoglTexture *
cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
int layer_index);
/**
* cogl_pipeline_remove_layer:
* @pipeline: A #CoglPipeline object

View File

@ -960,10 +960,6 @@ _cogl_pipeline_find_equivalent_parent (CoglPipeline *pipeline,
CoglPipelineState pipeline_state,
CoglPipelineLayerState layer_state);
CoglTexture *
_cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
int layer_index);
void
_cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
int layer_index,

View File

@ -308,7 +308,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
state->i++;
texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
/* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */
if (!texture)
@ -534,7 +534,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
*/
_cogl_pipeline_pre_paint_for_layer (pipeline, layer_index);
texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
/* NULL textures are handled by
* _cogl_pipeline_flush_gl_state */
@ -697,7 +697,7 @@ _cogl_rectangles_with_multitexture_coords (
/* If multitexturing failed or we are drawing with a sliced texture
* then we only support a single layer so we pluck out the texture
* from the first pipeline layer... */
texture = _cogl_pipeline_get_layer_texture (pipeline, state.first_layer);
texture = cogl_pipeline_get_layer_texture (pipeline, state.first_layer);
if (rects[i].tex_coords)
tex_coords = rects[i].tex_coords;
@ -904,7 +904,7 @@ append_tex_coord_attributes_cb (CoglPipeline *pipeline,
/* NULL textures will be handled in
* _cogl_pipeline_flush_layers_gl_state but there is no need to worry
* about scaling texture coordinates in this case */
texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
if (texture != NULL)
_cogl_texture_transform_coords_to_gl (texture, &tx, &ty);