From 61026d181b693d4ae3fcbb2f7dea343452402877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 22 Nov 2019 10:12:58 +0100 Subject: [PATCH] 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 --- clutter/clutter/clutter-paint-nodes.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index a0692e6b6..51ebf0739 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -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;