[mutter] clutter/paint-node: Rename multitex_coords to coords
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/paint-node: Rename multitex_coords to coords
- Date: Thu, 17 Dec 2020 03:32:31 +0000 (UTC)
commit 2cef2b6b1e08f49869df46dae1ec9261961d3498
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Dec 14 11:09:52 2020 -0300
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1637>
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 6d5d5c09d5..ee2b894391 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 734c624118..116cfa833e 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 965bceaf1f..db42f2f3f3 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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]