cogl-pipeline: Add internal API to get the layer matrix
This returns the layer matrix given a pipeline and a layer index. The API is kept as internal because it directly returns a pointer into the layer private data to avoid a copy into an out-param. We might also want to add a public function which does the copy.
This commit is contained in:
parent
e38e9e0355
commit
566831de66
2 changed files with 23 additions and 0 deletions
|
@ -1044,6 +1044,10 @@ CoglPipelineFilter
|
|||
_cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
|
||||
int layer_index);
|
||||
|
||||
const CoglMatrix *
|
||||
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline,
|
||||
int layer_index);
|
||||
|
||||
void
|
||||
_cogl_pipeline_texture_storage_change_notify (CoglHandle texture);
|
||||
|
||||
|
|
|
@ -5141,6 +5141,25 @@ _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
|
|||
sizeof (float) * 4);
|
||||
}
|
||||
|
||||
/* We should probably make a public API version of this that has a
|
||||
matrix out-param. For an internal API it's good to be able to avoid
|
||||
copying the matrix */
|
||||
const CoglMatrix *
|
||||
_cogl_pipeline_get_layer_matrix (CoglPipeline *pipeline, int layer_index)
|
||||
{
|
||||
CoglPipelineLayerState change =
|
||||
COGL_PIPELINE_LAYER_STATE_USER_MATRIX;
|
||||
CoglPipelineLayer *layer;
|
||||
CoglPipelineLayer *authority;
|
||||
|
||||
g_return_val_if_fail (cogl_is_pipeline (pipeline), NULL);
|
||||
|
||||
layer = _cogl_pipeline_get_layer (pipeline, layer_index);
|
||||
|
||||
authority = _cogl_pipeline_layer_get_authority (layer, change);
|
||||
return &authority->big_state->matrix;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
||||
int layer_index,
|
||||
|
|
Loading…
Reference in a new issue