From 317414ab26e0043d2d60d8cb924224168f3a2997 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 29 Jan 2019 12:55:11 -0200 Subject: [PATCH] clutter/paint-nodes: Push/pop framebuffer Unfortunately, many parts of GNOME Shell and Mutter and Clutter still use the implicit Cogl1 API. As such, it as a transition between the old and new APIs, it is important to keep the implicit draw framebuffer updated. ClutterRootNode does not keep it updated though, and it might lead to problems when rendering offscreen textures. Fix that by pushing and popping the root node framebuffer on pre- and post-draw, respectively. https://gitlab.gnome.org/GNOME/mutter/merge_requests/405 --- clutter/clutter/clutter-paint-nodes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index 74e544b51..d5efd5864 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -108,6 +108,8 @@ clutter_root_node_pre_draw (ClutterPaintNode *node) { ClutterRootNode *rnode = (ClutterRootNode *) node; + cogl_push_framebuffer (rnode->framebuffer); + cogl_framebuffer_clear (rnode->framebuffer, rnode->clear_flags, &rnode->clear_color); @@ -118,6 +120,7 @@ clutter_root_node_pre_draw (ClutterPaintNode *node) static void clutter_root_node_post_draw (ClutterPaintNode *node) { + cogl_pop_framebuffer (); } static void