[mutter] clutter/paint-node: Use non-deprecated Cogl API when drawing operations
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/paint-node: Use non-deprecated Cogl API when drawing operations
- Date: Tue, 3 Dec 2019 19:14:38 +0000 (UTC)
commit 8329c6b069861a871f6ad3814ee9dcb8304df27e
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Nov 22 10:23:23 2019 +0100
clutter/paint-node: Use non-deprecated Cogl API when drawing operations
The paint node drawing partly used deprecated Cogl implicit stack APIs.
Port that over to the non-deprecated variants.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
clutter/clutter/clutter-paint-nodes.c | 54 ++++++++++++++++-------------------
1 file changed, 25 insertions(+), 29 deletions(-)
---
diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c
index e9282431f..d7daec777 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -405,10 +405,7 @@ clutter_pipeline_node_pre_draw (ClutterPaintNode *node,
if (node->operations != NULL &&
pnode->pipeline != NULL)
- {
- cogl_push_source (pnode->pipeline);
- return TRUE;
- }
+ return TRUE;
return FALSE;
}
@@ -453,18 +450,20 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
break;
case PAINT_OP_TEX_RECT:
- cogl_rectangle_with_texture_coords (op->op.texrect[0],
- op->op.texrect[1],
- op->op.texrect[2],
- op->op.texrect[3],
- op->op.texrect[4],
- op->op.texrect[5],
- op->op.texrect[6],
- op->op.texrect[7]);
+ cogl_framebuffer_draw_textured_rectangle (fb,
+ pnode->pipeline,
+ op->op.texrect[0],
+ op->op.texrect[1],
+ op->op.texrect[2],
+ op->op.texrect[3],
+ op->op.texrect[4],
+ op->op.texrect[5],
+ op->op.texrect[6],
+ op->op.texrect[7]);
break;
case PAINT_OP_MULTITEX_RECT:
- cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
+ cogl_framebuffer_draw_multitextured_rectangle (fb,
pnode->pipeline,
op->op.texrect[0],
op->op.texrect[1],
@@ -475,7 +474,7 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
break;
case PAINT_OP_PATH:
- cogl_path_fill (op->op.path);
+ cogl_framebuffer_fill_path (fb, pnode->pipeline, op->op.path);
break;
case PAINT_OP_PRIMITIVE:
@@ -491,7 +490,6 @@ static void
clutter_pipeline_node_post_draw (ClutterPaintNode *node,
ClutterPaintContext *paint_context)
{
- cogl_pop_source ();
}
static JsonNode *
@@ -1328,20 +1326,20 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
case PAINT_OP_TEX_RECT:
/* now we need to paint the texture */
- cogl_push_source (lnode->state);
- cogl_rectangle_with_texture_coords (op->op.texrect[0],
- op->op.texrect[1],
- op->op.texrect[2],
- op->op.texrect[3],
- op->op.texrect[4],
- op->op.texrect[5],
- op->op.texrect[6],
- op->op.texrect[7]);
- cogl_pop_source ();
+ cogl_framebuffer_draw_textured_rectangle (fb,
+ lnode->state,
+ op->op.texrect[0],
+ op->op.texrect[1],
+ op->op.texrect[2],
+ op->op.texrect[3],
+ op->op.texrect[4],
+ op->op.texrect[5],
+ op->op.texrect[6],
+ op->op.texrect[7]);
break;
case PAINT_OP_MULTITEX_RECT:
- cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (),
+ cogl_framebuffer_draw_multitextured_rectangle (fb,
lnode->state,
op->op.texrect[0],
op->op.texrect[1],
@@ -1352,9 +1350,7 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
break;
case PAINT_OP_PATH:
- cogl_push_source (lnode->state);
- cogl_path_fill (op->op.path);
- cogl_pop_source ();
+ cogl_framebuffer_fill_path (fb, lnode->state, op->op.path);
break;
case PAINT_OP_PRIMITIVE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]