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
This commit is contained in:
Georges Basile Stavracas Neto 2019-01-29 12:55:11 -02:00
parent b63e104561
commit 317414ab26

View File

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