mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
pipeline: inline _get_parent and _get_authority
This moves _cogl_pipeline_get_parent and _cogl_pipeline_get_authority into cogl-pipeline-private.h so they can be inlined since they have been seen to get quite high in profiles. Given that they both contain such small amounts of code the function call overhead is significant.
This commit is contained in:
parent
3fa91efea8
commit
9ff191bd3b
@ -604,6 +604,23 @@ _cogl_pipeline_init_default_pipeline (void);
|
||||
void
|
||||
_cogl_pipeline_init_default_layers (void);
|
||||
|
||||
static inline CoglPipeline *
|
||||
_cogl_pipeline_get_parent (CoglPipeline *pipeline)
|
||||
{
|
||||
CoglPipelineNode *parent_node = COGL_PIPELINE_NODE (pipeline)->parent;
|
||||
return COGL_PIPELINE (parent_node);
|
||||
}
|
||||
|
||||
static inline CoglPipeline *
|
||||
_cogl_pipeline_get_authority (CoglPipeline *pipeline,
|
||||
unsigned long difference)
|
||||
{
|
||||
CoglPipeline *authority = pipeline;
|
||||
while (!(authority->differences & difference))
|
||||
authority = _cogl_pipeline_get_parent (authority);
|
||||
return authority;
|
||||
}
|
||||
|
||||
/*
|
||||
* SECTION:cogl-pipeline-internals
|
||||
* @short_description: Functions for creating custom primitives that make use
|
||||
|
@ -551,23 +551,6 @@ _cogl_pipeline_get_real_blend_enabled (CoglPipeline *pipeline)
|
||||
return pipeline->real_blend_enable;
|
||||
}
|
||||
|
||||
inline CoglPipeline *
|
||||
_cogl_pipeline_get_parent (CoglPipeline *pipeline)
|
||||
{
|
||||
CoglPipelineNode *parent_node = COGL_PIPELINE_NODE (pipeline)->parent;
|
||||
return COGL_PIPELINE (parent_node);
|
||||
}
|
||||
|
||||
CoglPipeline *
|
||||
_cogl_pipeline_get_authority (CoglPipeline *pipeline,
|
||||
unsigned long difference)
|
||||
{
|
||||
CoglPipeline *authority = pipeline;
|
||||
while (!(authority->differences & difference))
|
||||
authority = _cogl_pipeline_get_parent (authority);
|
||||
return authority;
|
||||
}
|
||||
|
||||
/* XXX: Think twice before making this non static since it is used
|
||||
* heavily and we expect the compiler to inline it...
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user