From 2cef2b6b1e08f49869df46dae1ec9261961d3498 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 14 Dec 2020 11:09:52 -0300 Subject: [PATCH] clutter/paint-node: Rename multitex_coords to coords The array will be used not only for multitexture, but also for multirectangle operations. Rename it to be generic enough to cover both cases. Part-of: --- clutter/clutter/clutter-paint-node-private.h | 2 +- clutter/clutter/clutter-paint-node.c | 15 +++++++-------- clutter/clutter/clutter-paint-nodes.c | 8 ++++---- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/clutter/clutter/clutter-paint-node-private.h b/clutter/clutter/clutter-paint-node-private.h index 6d5d5c09d..ee2b89439 100644 --- a/clutter/clutter/clutter-paint-node-private.h +++ b/clutter/clutter/clutter-paint-node-private.h @@ -90,7 +90,7 @@ struct _ClutterPaintOperation { PaintOpCode opcode; - GArray *multitex_coords; + GArray *coords; union { float texrect[8]; diff --git a/clutter/clutter/clutter-paint-node.c b/clutter/clutter/clutter-paint-node.c index 734c62411..116cfa833 100644 --- a/clutter/clutter/clutter-paint-node.c +++ b/clutter/clutter/clutter-paint-node.c @@ -778,8 +778,7 @@ clutter_paint_operation_clear (ClutterPaintOperation *op) break; case PAINT_OP_MULTITEX_RECT: - if (op->multitex_coords != NULL) - g_array_unref (op->multitex_coords); + g_clear_pointer (&op->coords, g_array_unref); break; case PAINT_OP_PRIMITIVE: @@ -819,11 +818,11 @@ clutter_paint_op_init_multitex_rect (ClutterPaintOperation *op, clutter_paint_operation_clear (op); op->opcode = PAINT_OP_MULTITEX_RECT; - op->multitex_coords = g_array_sized_new (FALSE, FALSE, - sizeof (float), - tex_coords_len); + op->coords = g_array_sized_new (FALSE, FALSE, + sizeof (float), + tex_coords_len); - g_array_append_vals (op->multitex_coords, tex_coords, tex_coords_len); + g_array_append_vals (op->coords, tex_coords, tex_coords_len); op->op.texrect[0] = rect->x1; op->op.texrect[1] = rect->y1; @@ -1062,9 +1061,9 @@ clutter_paint_node_to_json (ClutterPaintNode *node) json_builder_set_member_name (builder, "texrect"); json_builder_begin_array (builder); - for (j = 0; i < op->multitex_coords->len; j++) + for (j = 0; i < op->coords->len; j++) { - float coord = g_array_index (op->multitex_coords, float, j); + float coord = g_array_index (op->coords, float, j); json_builder_add_double_value (builder, coord); } diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c index 965bceaf1..db42f2f3f 100644 --- a/clutter/clutter/clutter-paint-nodes.c +++ b/clutter/clutter/clutter-paint-nodes.c @@ -474,8 +474,8 @@ clutter_pipeline_node_draw (ClutterPaintNode *node, op->op.texrect[1], op->op.texrect[2], op->op.texrect[3], - (float*) op->multitex_coords->data, - op->multitex_coords->len); + (float *) op->coords->data, + op->coords->len); break; case PAINT_OP_PRIMITIVE: @@ -1447,8 +1447,8 @@ clutter_layer_node_post_draw (ClutterPaintNode *node, op->op.texrect[1], op->op.texrect[2], op->op.texrect[3], - (float*) op->multitex_coords->data, - op->multitex_coords->len); + (float *) op->coords->data, + op->coords->len); break; case PAINT_OP_PRIMITIVE: