From 2d48ca8aa110e0befdce68ae97e03b0a28bb703e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 7 Jun 2024 23:48:40 +0200 Subject: [PATCH] clutter/paint-nodes: Copy instead of ref passed pipelines A ClutterPipelineNode took a reference to the passed pipeline and used it during the lifetime of the paint node. In theory this meant that a paint node pipeline could be changed, and reused, affecting the previous paint node drawing. Referencing instead of copying also meant the ClutterPipelineNode isn't able to itself manipulate the pipeline any further. Fix both of these issues by copying, instead of adding a reference to, the passed pipeline. While resulting in some additional allocation over head, it means we can now eventually handle color transformations automatically for ClutterPipelineNode's. Part-of: --- clutter/clutter/clutter-paint-nodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index 148f26355..d7baf0116 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -500,7 +500,7 @@ clutter_pipeline_node_new (CoglPipeline *pipeline) res = _clutter_paint_node_create (CLUTTER_TYPE_PIPELINE_NODE); if (pipeline != NULL) - res->pipeline = g_object_ref (pipeline); + res->pipeline = cogl_pipeline_copy (pipeline); return (ClutterPaintNode *) res; }