1
0
Fork 0

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
This commit is contained in:
Jonas Ådahl 2019-11-22 10:23:23 +01:00 committed by Georges Basile Stavracas Neto
parent f11170fecb
commit 8329c6b069

View file

@ -405,10 +405,7 @@ clutter_pipeline_node_pre_draw (ClutterPaintNode *node,
if (node->operations != NULL && if (node->operations != NULL &&
pnode->pipeline != NULL) pnode->pipeline != NULL)
{ return TRUE;
cogl_push_source (pnode->pipeline);
return TRUE;
}
return FALSE; return FALSE;
} }
@ -453,18 +450,20 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
break; break;
case PAINT_OP_TEX_RECT: case PAINT_OP_TEX_RECT:
cogl_rectangle_with_texture_coords (op->op.texrect[0], cogl_framebuffer_draw_textured_rectangle (fb,
op->op.texrect[1], pnode->pipeline,
op->op.texrect[2], op->op.texrect[0],
op->op.texrect[3], op->op.texrect[1],
op->op.texrect[4], op->op.texrect[2],
op->op.texrect[5], op->op.texrect[3],
op->op.texrect[6], op->op.texrect[4],
op->op.texrect[7]); op->op.texrect[5],
op->op.texrect[6],
op->op.texrect[7]);
break; break;
case PAINT_OP_MULTITEX_RECT: case PAINT_OP_MULTITEX_RECT:
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (), cogl_framebuffer_draw_multitextured_rectangle (fb,
pnode->pipeline, pnode->pipeline,
op->op.texrect[0], op->op.texrect[0],
op->op.texrect[1], op->op.texrect[1],
@ -475,7 +474,7 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
break; break;
case PAINT_OP_PATH: case PAINT_OP_PATH:
cogl_path_fill (op->op.path); cogl_framebuffer_fill_path (fb, pnode->pipeline, op->op.path);
break; break;
case PAINT_OP_PRIMITIVE: case PAINT_OP_PRIMITIVE:
@ -491,7 +490,6 @@ static void
clutter_pipeline_node_post_draw (ClutterPaintNode *node, clutter_pipeline_node_post_draw (ClutterPaintNode *node,
ClutterPaintContext *paint_context) ClutterPaintContext *paint_context)
{ {
cogl_pop_source ();
} }
static JsonNode * static JsonNode *
@ -1328,20 +1326,20 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
case PAINT_OP_TEX_RECT: case PAINT_OP_TEX_RECT:
/* now we need to paint the texture */ /* now we need to paint the texture */
cogl_push_source (lnode->state); cogl_framebuffer_draw_textured_rectangle (fb,
cogl_rectangle_with_texture_coords (op->op.texrect[0], lnode->state,
op->op.texrect[1], op->op.texrect[0],
op->op.texrect[2], op->op.texrect[1],
op->op.texrect[3], op->op.texrect[2],
op->op.texrect[4], op->op.texrect[3],
op->op.texrect[5], op->op.texrect[4],
op->op.texrect[6], op->op.texrect[5],
op->op.texrect[7]); op->op.texrect[6],
cogl_pop_source (); op->op.texrect[7]);
break; break;
case PAINT_OP_MULTITEX_RECT: case PAINT_OP_MULTITEX_RECT:
cogl_framebuffer_draw_multitextured_rectangle (cogl_get_draw_framebuffer (), cogl_framebuffer_draw_multitextured_rectangle (fb,
lnode->state, lnode->state,
op->op.texrect[0], op->op.texrect[0],
op->op.texrect[1], op->op.texrect[1],
@ -1352,9 +1350,7 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
break; break;
case PAINT_OP_PATH: case PAINT_OP_PATH:
cogl_push_source (lnode->state); cogl_framebuffer_fill_path (fb, lnode->state, op->op.path);
cogl_path_fill (op->op.path);
cogl_pop_source ();
break; break;
case PAINT_OP_PRIMITIVE: case PAINT_OP_PRIMITIVE: