clutter/root-node: Require non-null framebuffer on construction

It's the only way it's used, and it removes a usage of deprecated Cogl
implicit stack API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
This commit is contained in:
Jonas Ådahl 2019-11-22 10:12:58 +01:00 committed by Georges Basile Stavracas Neto
parent 5145b33e01
commit 61026d181b

View File

@ -165,6 +165,8 @@ clutter_root_node_new (CoglFramebuffer *framebuffer,
{
ClutterRootNode *res;
g_return_val_if_fail (framebuffer, NULL);
res = _clutter_paint_node_create (CLUTTER_TYPE_ROOT_NODE);
cogl_color_init_from_4ub (&res->clear_color,
@ -174,11 +176,7 @@ clutter_root_node_new (CoglFramebuffer *framebuffer,
clear_color->alpha);
cogl_color_premultiply (&res->clear_color);
if (G_LIKELY (framebuffer != NULL))
res->framebuffer = cogl_object_ref (framebuffer);
else
res->framebuffer = cogl_object_ref (cogl_get_draw_framebuffer ());
res->framebuffer = cogl_object_ref (framebuffer);
res->clear_flags = clear_flags;
return (ClutterPaintNode *) res;