1
0
Fork 0

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
This commit is contained in:
Jonas Ådahl 2024-06-07 23:48:40 +02:00 committed by Sebastian Wick
parent a1163385db
commit 2d48ca8aa1

View file

@ -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;
}