[mutter] clutter/paint-nodes: Stop using implicit framebuffer stack Cogl API
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/paint-nodes: Stop using implicit framebuffer stack Cogl API
- Date: Tue, 3 Dec 2019 19:14:58 +0000 (UTC)
commit fd0ce66ac18e0e2e5994d9493ff604db4e7f5a5d
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Nov 22 11:30:11 2019 +0100
clutter/paint-nodes: Stop using implicit framebuffer stack Cogl API
Stop using API that uses the implicit Cogl framebuffer stack, (e.g.
cogl_push_matrix()) and replace usage by the corresponding API taking an
explicit framebuffer (e.g. cogl_framebuffer_push_matrix()).
For offscreens etc, the offscreen framebuffer is still pushed to and
popped from the Cogl framebuffer stack, so that paint nodes still draw
to the right framebuffer.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
clutter/clutter/clutter-paint-nodes.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c
index d7daec777..9f3024917 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -1256,6 +1256,7 @@ clutter_layer_node_pre_draw (ClutterPaintNode *node,
ClutterPaintContext *paint_context)
{
ClutterLayerNode *lnode = (ClutterLayerNode *) node;
+ CoglFramebuffer *framebuffer;
CoglMatrix matrix;
/* if we were unable to create an offscreen buffer for this node, then
@@ -1271,7 +1272,8 @@ clutter_layer_node_pre_draw (ClutterPaintNode *node,
/* copy the same modelview from the current framebuffer to the one we
* are going to use
*/
- cogl_get_modelview_matrix (&matrix);
+ framebuffer = cogl_get_draw_framebuffer ();
+ cogl_framebuffer_get_modelview_matrix (framebuffer, &matrix);
cogl_push_framebuffer (lnode->offscreen);
@@ -1291,7 +1293,7 @@ clutter_layer_node_pre_draw (ClutterPaintNode *node,
COGL_BUFFER_BIT_COLOR | COGL_BUFFER_BIT_DEPTH,
0.f, 0.f, 0.f, 0.f);
- cogl_push_matrix ();
+ cogl_framebuffer_push_matrix (lnode->offscreen);
/* every draw operation after this point will happen an offscreen
* framebuffer
@@ -1309,7 +1311,7 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
guint i;
/* switch to the previous framebuffer */
- cogl_pop_matrix ();
+ cogl_framebuffer_pop_matrix (lnode->offscreen);
cogl_pop_framebuffer ();
fb = cogl_get_draw_framebuffer ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]