diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h index 6caf6a6ff..6720a0274 100644 --- a/cogl/cogl-pipeline-private.h +++ b/cogl/cogl-pipeline-private.h @@ -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); diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c index 3c139ac81..34c01015d 100644 --- a/cogl/cogl-pipeline.c +++ b/cogl/cogl-pipeline.c @@ -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,