This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch edje-vector-intergration
in repository efl.
View the commit online.
commit 7bd9ef46663adb9a51841464d6210527bb53c167
Author: [email protected] <[email protected]>
AuthorDate: Wed Apr 29 09:40:18 2026 -0600
edje: end-to-end override render test for state dispatch (Task 4.6)
Add edje_vg_render_box_a_hover test to exercise the full override pipeline:
parse EDC with inherit+override, load, dispatch STATE_SET via signal,
dup-base tree, apply stroke.width override, rematerialize, and assert
override took effect on the materialized Efl_VG shape.
The test probes stroke width (not fill color) because the materializer
applies both fill.color and node-level color via efl_gfx_color_set in
sequence, so node-color overwrites fill-color and efl_gfx_color_get
returns the node value (default white), not the fill RGBA. Phase 6
must fix this ordering so fill and node-level colors remain independent
for correct color-class resolution. Captured in project memory.
53/53 tests pass. Phase 4 is now complete.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
src/tests/edje/data/test_vector_states.edc | 6 ++
src/tests/edje/edje_test_vector_states.c | 113 +++++++++++++++++++++++++++++
2 files changed, 119 insertions(+)
diff --git a/src/tests/edje/data/test_vector_states.edc b/src/tests/edje/data/test_vector_states.edc
index 1e1e4288de..79b873736f 100644
--- a/src/tests/edje/data/test_vector_states.edc
+++ b/src/tests/edje/data/test_vector_states.edc
@@ -56,6 +56,12 @@ collections {
}
}
} }
+ programs {
+ program { signal: "test,hover"; source: "test";
+ action: STATE_SET "hover" 0.0;
+ target: "vg";
+ }
+ }
}
/* Task 4.4: inherit + per-target merge fixture.
* The default description sets visible and stroke.width on "body".
diff --git a/src/tests/edje/edje_test_vector_states.c b/src/tests/edje/edje_test_vector_states.c
index 6b0a7d3e24..a7f3f5c913 100644
--- a/src/tests/edje/edje_test_vector_states.c
+++ b/src/tests/edje/edje_test_vector_states.c
@@ -766,6 +766,118 @@ EFL_START_TEST(edje_vg_tree_apply_override_unresolved_noop)
}
EFL_END_TEST
+/*
+ * edje_vg_render_box_a_hover (Task 4.6)
+ *
+ * End-to-end override render test for ui/box_a_hover.
+ *
+ * This test exercises the full override path:
+ * 1. Load the group (default state: tile_a base tree, no overrides).
+ * 2. Assert that in the default state the body shape's stroke width is 1.0
+ * — tile_a has no explicit stroke, so the node default (1.0) is used.
+ * 3. Emit the "test,hover" signal which triggers a STATE_SET "hover" 0.0
+ * program on the "vg" part.
+ * 4. Recalc + render — _edje_vector_recalc_apply must now see overrides on
+ * the chosen description, dup the base tree, apply the override
+ * (stroke.width: 4), and rematerialize.
+ * 5. Assert that the body shape's stroke width is now 4.0.
+ *
+ * Stroke width is chosen as the assertion field because it is independently
+ * queryable via efl_gfx_shape_stroke_width_get and is not affected by the
+ * node-level color-overwrite ordering (fill.color and n->color both go
+ * through efl_gfx_color_set — fill first, then node-level white overwrites;
+ * stroke width has its own distinct setter/getter).
+ *
+ * This test proves Phase 4.4 (inherit-merge of override lists) and Phase 4.5
+ * (runtime dup-and-apply on recalc) work correctly end-to-end.
+ */
+EFL_START_TEST(edje_vg_render_box_a_hover)
+{
+ const char *edj = TESTS_BUILD_DIR "/data/test_vector_states.edj";
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *obj;
+ Evas_Object *vg_part;
+ Efl_Canvas_Vg_Node *vg_root;
+ Efl_Canvas_Vg_Node *body_node;
+ double sw;
+
+ /* --- Setup: buffer canvas, edje object, load group --- */
+ ee = ecore_evas_buffer_new(VG_RENDER_W, VG_RENDER_H);
+ fail_if(!ee);
+ ecore_evas_show(ee);
+ ecore_evas_manual_render_set(ee, EINA_TRUE);
+
+ evas = ecore_evas_get(ee);
+ fail_if(!evas);
+
+ obj = edje_object_add(evas);
+ fail_if(!obj);
+
+ fail_unless(edje_object_file_set(obj, edj, "ui/box_a_hover"));
+
+ evas_object_resize(obj, VG_RENDER_W, VG_RENDER_H);
+ evas_object_move(obj, 0, 0);
+ evas_object_show(obj);
+
+ edje_object_calc_force(obj);
+ ecore_evas_manual_render(ee);
+
+ /* --- Default state checks --- */
+ vg_part = (Evas_Object *)edje_object_part_object_get(obj, "vg");
+ fail_if(!vg_part);
+
+ vg_root = efl_canvas_vg_object_root_node_get(vg_part);
+ fail_if(vg_root == NULL);
+ fail_if(!efl_isa(vg_root, EFL_CANVAS_VG_CONTAINER_CLASS));
+
+ body_node = efl_canvas_vg_container_child_get(vg_root, "body");
+ fail_if(body_node == NULL);
+ fail_if(!efl_isa(body_node, EFL_CANVAS_VG_SHAPE_CLASS));
+
+ /* Default: tile_a has no explicit stroke width, so the materialized shape
+ * inherits the node default of 1.0 (set by _edje_vg_node_new). */
+ sw = efl_gfx_shape_stroke_width_get(body_node);
+ ck_assert_msg(sw >= 0.5 && sw <= 1.5,
+ "Default state stroke width %.2f != expected ~1.0", sw);
+
+ /* --- Switch to hover state via signal --- */
+ edje_object_signal_emit(obj, "test,hover", "test");
+ edje_object_message_signal_process(obj);
+
+ /* Recalc drives _edje_vector_recalc_apply with the new chosen_desc
+ * (hover), which has overrides. The override path dups the base tree
+ * and applies stroke.width: 4 before rematerializing. */
+ edje_object_calc_force(obj);
+ ecore_evas_manual_render(ee);
+
+ /* --- Hover state: override must have been applied --- */
+ /* After rematerialization the vg_part's root_node pointer may have changed
+ * (a fresh Efl_VG hierarchy is built each recalc in the override path);
+ * re-fetch both root and body to get the new objects. */
+ vg_root = efl_canvas_vg_object_root_node_get(vg_part);
+ fail_if(vg_root == NULL);
+ fail_if(!efl_isa(vg_root, EFL_CANVAS_VG_CONTAINER_CLASS));
+
+ body_node = efl_canvas_vg_container_child_get(vg_root, "body");
+ fail_if(body_node == NULL);
+ fail_if(!efl_isa(body_node, EFL_CANVAS_VG_SHAPE_CLASS));
+
+ /* The hover override sets stroke.width: 4 on "body".
+ * _edje_vg_tree_apply_override copies ovr->payload.shape.stroke_width
+ * onto the working node, then _shape_to_efl_vg calls
+ * efl_gfx_shape_stroke_width_set. Verify the override landed. */
+ sw = efl_gfx_shape_stroke_width_get(body_node);
+ ck_assert_msg(sw >= 3.5 && sw <= 4.5,
+ "Hover state stroke width %.2f != expected ~4.0 (override not applied)",
+ sw);
+
+ /* --- Cleanup --- */
+ evas_object_del(obj);
+ ecore_evas_free(ee);
+}
+EFL_END_TEST
+
void
edje_test_vector_states(TCase *tc)
{
@@ -779,4 +891,5 @@ edje_test_vector_states(TCase *tc)
tcase_add_test(tc, edje_vg_tree_dup_independent);
tcase_add_test(tc, edje_vg_tree_apply_override_visible);
tcase_add_test(tc, edje_vg_tree_apply_override_unresolved_noop);
+ tcase_add_test(tc, edje_vg_render_box_a_hover);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.