This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch vtorri_putenv
in repository expedite.
View the commit online.
commit 22b611944697f5b68844a9689027427521d543ca
Author: [email protected] <[email protected]>
AuthorDate: Fri Apr 3 21:17:56 2026 -0600
Add VG multi-shape gradient transform test
---
src/bin/meson.build | 1 +
src/bin/tests.h | 1 +
src/bin/vg_gradient_multi_shape_transform.c | 179 ++++++++++++++++++++++++++++
3 files changed, 181 insertions(+)
diff --git a/src/bin/meson.build b/src/bin/meson.build
index 78c2882..68f687a 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -127,6 +127,7 @@ expedite_sources = [ 'main.c',
'vg_basic_network.c',
'vg_basic_composite.c',
'vg_scaled.c',
+ 'vg_gradient_multi_shape_transform.c',
'snapshot_widgets_file_icons.c' ]
executable('expedite',
diff --git a/src/bin/tests.h b/src/bin/tests.h
index bc6c564..972eafe 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -120,6 +120,7 @@
#include "vg_basic_network.c"
#include "vg_basic_composite.c"
#include "vg_scaled.c"
+#include "vg_gradient_multi_shape_transform.c"
#include "snapshot_widgets_file_icons.c"
#if 0 // test disabled - evas having code disabled
#include "image_mask_14.c"
diff --git a/src/bin/vg_gradient_multi_shape_transform.c b/src/bin/vg_gradient_multi_shape_transform.c
new file mode 100644
index 0000000..490d336
--- /dev/null
+++ b/src/bin/vg_gradient_multi_shape_transform.c
@@ -0,0 +1,179 @@
+#undef FNAME
+#undef NAME
+#undef ICON
+
+/* metadata */
+#define FNAME vg_gradient_multi_shape_transform_start
+#define NAME "VG Gradient Multi-Shape Transform"
+#define ICON "vector.png"
+
+#ifndef PROTO
+# ifndef UI
+# include "main.h"
+
+/* standard var */
+static int done = 0;
+
+/* private data */
+static Eo *o_shapes[OBNUM];
+
+static const Efl_Gfx_Gradient_Stop stops1[3] = {
+ { 0, 255, 0, 0, 255 }, /* Red */
+ { 0.5, 0, 255, 0, 255 }, /* Green */
+ { 1, 0, 0, 255, 255 } /* Blue */
+};
+
+static const Efl_Gfx_Gradient_Stop stops2[3] = {
+ { 0, 255, 255, 0, 255 }, /* Yellow */
+ { 0.5, 255, 0, 255, 255 }, /* Magenta */
+ { 1, 0, 255, 255, 255 } /* Cyan */
+};
+
+/* setup
+ * Creates a VG container with multiple shapes, each having independent
+ * transforms. This exercises the per-shape transform matrix code path.
+ *
+ * Shape 1: Rectangle with horizontal gradient, no transform (identity)
+ * Shape 2: Rectangle with horizontal gradient, rotated 90 degrees
+ *
+ * Expected: Shape 1 shows horizontal gradient (red to blue)
+ * Shape 2 shows vertical gradient (yellow to cyan) due to rotation
+ *
+ * Bug behavior (before fix): Both shapes show horizontal gradients because
+ * only the last shape's transform is used.
+ */
+static void _setup(void)
+{
+ unsigned int i;
+ Eina_Matrix3 matrix;
+
+ for (i = 0; i < OBNUM; i++)
+ {
+ Efl_VG *root, *shape1, *shape2, *grad1, *grad2;
+ Eo *vector;
+ double w = 70, h = 70, stroke_w = 3;
+
+ vector = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, evas);
+ o_shapes[i] = vector;
+ efl_gfx_entity_size_set(vector, EINA_SIZE2D(w * 3 + 20, h + stroke_w * 2));
+ efl_gfx_entity_position_set(vector, EINA_POSITION2D(0, 0));
+ efl_gfx_entity_visible_set(vector, EINA_TRUE);
+
+ /* Create container root node - multiple shapes will be children */
+ root = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, vector);
+
+ /* Shape 1: Rectangle with gradient, IDENTITY transform (horizontal gradient) */
+ grad1 = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, root);
+ efl_gfx_gradient_stop_set(grad1, stops1, 3);
+ efl_gfx_gradient_spread_set(grad1, EFL_GFX_GRADIENT_SPREAD_PAD);
+ /* Gradient goes left-to-right (horizontal) */
+ efl_gfx_gradient_linear_start_set(grad1, stroke_w, stroke_w);
+ efl_gfx_gradient_linear_end_set(grad1, stroke_w + w, stroke_w);
+
+ shape1 = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root);
+ efl_gfx_path_append_rect(shape1, stroke_w, stroke_w, w, h, 10, 10);
+ efl_canvas_vg_shape_fill_set(shape1, grad1);
+ efl_gfx_shape_stroke_width_set(shape1, stroke_w);
+ efl_gfx_shape_stroke_color_set(shape1, 128, 0, 0, 128);
+ efl_gfx_shape_stroke_join_set(shape1, EFL_GFX_JOIN_ROUND);
+ /* No transform = identity, gradient remains horizontal */
+
+ /* Shape 2: Rectangle with gradient, ROTATED 90 degrees (vertical gradient) */
+ grad2 = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, root);
+ efl_gfx_gradient_stop_set(grad2, stops2, 3);
+ efl_gfx_gradient_spread_set(grad2, EFL_GFX_GRADIENT_SPREAD_PAD);
+ /* Gradient also defined left-to-right (horizontal) */
+ efl_gfx_gradient_linear_start_set(grad2, stroke_w, stroke_w);
+ efl_gfx_gradient_linear_end_set(grad2, stroke_w + w, stroke_w);
+
+ shape2 = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, root);
+ efl_gfx_path_append_rect(shape2, stroke_w * 2 + w + 10, stroke_w, w, h, 10, 10);
+ efl_canvas_vg_shape_fill_set(shape2, grad2);
+ efl_gfx_shape_stroke_width_set(shape2, stroke_w);
+ efl_gfx_shape_stroke_color_set(shape2, 0, 128, 0, 128);
+ efl_gfx_shape_stroke_join_set(shape2, EFL_GFX_JOIN_ROUND);
+
+ /* Apply 90-degree rotation to shape2
+ * This should make the horizontal gradient appear vertical
+ * If the bug is present, the transform is ignored and gradient stays horizontal */
+ eina_matrix3_identity(&matrix);
+ /* Rotate around center of shape */
+ eina_matrix3_translate(&matrix, stroke_w * 2 + w + 10 + w/2, stroke_w + h/2);
+ eina_matrix3_rotate(&matrix, M_PI / 2); /* 90 degrees */
+ eina_matrix3_translate(&matrix, -(stroke_w * 2 + w + 10 + w/2), -(stroke_w + h/2));
+ efl_canvas_vg_node_transformation_set(shape2, &matrix);
+
+ /* Set root as the VG object root node */
+ efl_canvas_vg_object_root_node_set(vector, root);
+ }
+ done = 0;
+}
+
+/* cleanup */
+static void _cleanup(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < OBNUM; i++) efl_del(o_shapes[i]);
+}
+
+/* loop - do things */
+static void _loop(double t, int f)
+{
+ int i;
+ Evas_Coord x, y, w = 200, h = 200;
+ for (i = 0; i < OBNUM; i++)
+ {
+ x = (win_w / 2) - (w / 2);
+ x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
+ y = (win_h / 2) - (h / 2);
+ y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
+ efl_gfx_entity_position_set(o_shapes[i], EINA_POSITION2D(x, y));
+ }
+ FPS_STD(NAME);
+}
+
+/* prepend special key handlers if interactive (before STD) */
+static void _key(const char *key)
+{
+ KEY_STD;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* template stuff - ignore */
+# endif
+#endif
+
+#ifdef UI
+_ui_menu_item_add(ICON, NAME, FNAME);
+#endif
+
+#ifdef PROTO
+void FNAME(void);
+#endif
+
+#ifndef PROTO
+# ifndef UI
+void FNAME(void)
+{
+ ui_func_set(_key, _loop, _setup);
+}
+# endif
+#endif
+#undef FNAME
+#undef NAME
+#undef ICON
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.