cogl/node: Stop taking a custom unparent function

As all the use cases end up chaining up anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
This commit is contained in:
Bilal Elmoussaoui 2023-09-19 08:48:08 +02:00 committed by Marge Bot
parent 6efd4a2282
commit 80ce052a47
4 changed files with 4 additions and 23 deletions

View File

@ -67,12 +67,9 @@ struct _CoglNode
void void
_cogl_pipeline_node_init (CoglNode *node); _cogl_pipeline_node_init (CoglNode *node);
typedef void (*CoglNodeUnparentVFunc) (CoglNode *node);
void void
_cogl_pipeline_node_set_parent_real (CoglNode *node, _cogl_pipeline_node_set_parent_real (CoglNode *node,
CoglNode *parent, CoglNode *parent,
CoglNodeUnparentVFunc unparent,
gboolean take_strong_reference); gboolean take_strong_reference);
void void

View File

@ -46,7 +46,6 @@ _cogl_pipeline_node_init (CoglNode *node)
void void
_cogl_pipeline_node_set_parent_real (CoglNode *node, _cogl_pipeline_node_set_parent_real (CoglNode *node,
CoglNode *parent, CoglNode *parent,
CoglNodeUnparentVFunc unparent,
gboolean take_strong_reference) gboolean take_strong_reference)
{ {
/* NB: the old parent may indirectly be keeping the new parent alive /* NB: the old parent may indirectly be keeping the new parent alive
@ -61,7 +60,7 @@ _cogl_pipeline_node_set_parent_real (CoglNode *node,
cogl_object_ref (parent); cogl_object_ref (parent);
if (node->parent) if (node->parent)
unparent (node); _cogl_pipeline_node_unparent_real (node);
_cogl_list_insert (&parent->children, &node->link); _cogl_list_insert (&parent->children, &node->link);

View File

@ -436,13 +436,6 @@ init_layer_state:
return layer; return layer;
} }
static void
_cogl_pipeline_layer_unparent (CoglNode *layer)
{
/* Chain up */
_cogl_pipeline_node_unparent_real (layer);
}
static void static void
_cogl_pipeline_layer_set_parent (CoglPipelineLayer *layer, _cogl_pipeline_layer_set_parent (CoglPipelineLayer *layer,
CoglPipelineLayer *parent) CoglPipelineLayer *parent)
@ -450,7 +443,6 @@ _cogl_pipeline_layer_set_parent (CoglPipelineLayer *layer,
/* Chain up */ /* Chain up */
_cogl_pipeline_node_set_parent_real (COGL_NODE (layer), _cogl_pipeline_node_set_parent_real (COGL_NODE (layer),
COGL_NODE (parent), COGL_NODE (parent),
_cogl_pipeline_layer_unparent,
TRUE); TRUE);
} }
@ -699,7 +691,7 @@ _cogl_pipeline_layer_equal (CoglPipelineLayer *layer0,
static void static void
_cogl_pipeline_layer_free (CoglPipelineLayer *layer) _cogl_pipeline_layer_free (CoglPipelineLayer *layer)
{ {
_cogl_pipeline_layer_unparent (COGL_NODE (layer)); _cogl_pipeline_node_unparent_real (COGL_NODE (layer));
if (layer->differences & COGL_PIPELINE_LAYER_STATE_TEXTURE_DATA && if (layer->differences & COGL_PIPELINE_LAYER_STATE_TEXTURE_DATA &&
layer->texture != NULL) layer->texture != NULL)

View File

@ -148,12 +148,6 @@ _cogl_pipeline_init_default_pipeline (void)
ctx->default_pipeline = _cogl_pipeline_object_new (pipeline); ctx->default_pipeline = _cogl_pipeline_object_new (pipeline);
} }
static void
_cogl_pipeline_unparent (CoglNode *pipeline)
{
/* Chain up */
_cogl_pipeline_node_unparent_real (pipeline);
}
static gboolean static gboolean
recursively_free_layer_caches_cb (CoglNode *node, recursively_free_layer_caches_cb (CoglNode *node,
@ -194,7 +188,6 @@ _cogl_pipeline_set_parent (CoglPipeline *pipeline,
/* Chain up */ /* Chain up */
_cogl_pipeline_node_set_parent_real (COGL_NODE (pipeline), _cogl_pipeline_node_set_parent_real (COGL_NODE (pipeline),
COGL_NODE (parent), COGL_NODE (parent),
_cogl_pipeline_unparent,
take_strong_reference); take_strong_reference);
/* Since we just changed the ancestry of the pipeline its cache of /* Since we just changed the ancestry of the pipeline its cache of
@ -340,7 +333,7 @@ destroy_weak_children_cb (CoglNode *node,
NULL); NULL);
pipeline->destroy_callback (pipeline, pipeline->destroy_data); pipeline->destroy_callback (pipeline, pipeline->destroy_data);
_cogl_pipeline_unparent (COGL_NODE (pipeline)); _cogl_pipeline_node_unparent_real (COGL_NODE (pipeline));
} }
return TRUE; return TRUE;
@ -359,7 +352,7 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
g_assert (_cogl_list_empty (&COGL_NODE (pipeline)->children)); g_assert (_cogl_list_empty (&COGL_NODE (pipeline)->children));
_cogl_pipeline_unparent (COGL_NODE (pipeline)); _cogl_pipeline_node_unparent_real (COGL_NODE (pipeline));
if (pipeline->differences & COGL_PIPELINE_STATE_USER_SHADER && if (pipeline->differences & COGL_PIPELINE_STATE_USER_SHADER &&
pipeline->big_state->user_program) pipeline->big_state->user_program)