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 0af2874f5d116e220afda02ea5517b176ff2c48e
Author: [email protected] <[email protected]>
AuthorDate: Wed Apr 29 09:34:35 2026 -0600
edje: wire per-state vector overrides into runtime recalc
This commit materializes Phase 4.5's override infrastructure into the
runtime by updating _edje_vector_recalc_apply to consult
chosen_desc->vg.overrides during part recalculation.
When overrides are present: the base tree (immutable, cached in Edje_File)
is duplicated via _edje_vg_tree_dup, each override is applied in sequence
via _edje_vg_tree_apply_override on the working copy, the result is
materialized to Efl_VG via _edje_vg_tree_to_efl_vg, and the working tree
is freed before setting the root node.
When overrides are absent: the existing Phase 3 fast path is preserved,
materializing the base tree directly with no overhead. Unmodified themes
incur zero cost. This makes Phase 4 backward compatible and avoids
dup-and-apply churn on static-render descriptions (the vast majority).
The dup is safe because _edje_vg_tree_dup produces a fully independent
tree; mutations never touch immutable base. The materializer deep-copies
properties into Efl objects and doesn't retain pointers into the source,
so freeing working before root_node_set is sound.
Updated Phase 5 TODO: clarified what Phase 4 added (dup-and-apply flow)
and what Phase 5 must deliver (materialized-Efl_VG cache for 60fps
transition performance on every recalc tick).
52/52 tests pass; valgrind shows no new leaks.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
src/lib/edje/edje_calc.c | 55 ++++++++++++++++++++++++++++++++++++------------
1 file changed, 42 insertions(+), 13 deletions(-)
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 16242e39bd..3fb4b751be 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3283,7 +3283,9 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN
if (chosen_desc->vg.tree_id >= 0)
{
Edje_Real_Part_Vector *rpv = ep->typedata.vector;
- const Edje_Vg_Tree *t;
+ const Edje_Vg_Tree *base;
+ Edje_Vg_Tree *working = NULL;
+ const Edje_Vg_Tree *materialize_src;
Eina_Rect viewbox;
if (!ed->file->vector_dir ||
@@ -3295,22 +3297,49 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN
return;
}
- t = &ed->file->vector_dir->trees[chosen_desc->vg.tree_id];
+ base = &ed->file->vector_dir->trees[chosen_desc->vg.tree_id];
- /* Cache the tree pointer; useful for Phase 4's override path and for
- class-dirty invalidation in Phase 6. */
- rpv->cached_base_tree = t;
+ /* Cache the tree pointer; useful for class-dirty invalidation in
+ Phase 6. */
+ rpv->cached_base_tree = base;
rpv->cached_tree_id = chosen_desc->vg.tree_id;
- viewbox = EINA_RECT(t->vbx, t->vby, t->vbw, t->vbh);
+ viewbox = EINA_RECT(base->vbx, base->vby, base->vbw, base->vbh);
+
+ /* Phase 4: when per-description overrides are present, dup the base
+ tree, apply each override in order, then materialise the working
+ copy. When there are no overrides, skip the dup and materialise the
+ immutable base tree directly (fast path, unchanged from Phase 3). */
+ if (chosen_desc->vg.overrides)
+ {
+ Eina_List *l;
+ Edje_Vg_Override *ovr;
+
+ working = _edje_vg_tree_dup(base);
+ if (!working)
+ {
+ ERR("Failed to dup base tree for override application (tree_id=%d)",
+ chosen_desc->vg.tree_id);
+ return;
+ }
+ EINA_LIST_FOREACH(chosen_desc->vg.overrides, l, ovr)
+ _edje_vg_tree_apply_override(working, ovr);
+ materialize_src = working;
+ }
+ else
+ {
+ materialize_src = base;
+ }
+
+ /* TODO Phase 5: cache the materialised Efl_VG to avoid the
+ dup-and-walk cost on every recalc. Cache key:
+ (tree_id, override-list-hash, classes_dirty). Phase 4 added the
+ dup-and-apply-overrides flow; Phase 5 needs the materialised cache
+ for transition perf at 60fps. */
+ root = _edje_vg_tree_to_efl_vg(materialize_src);
+
+ if (working) _edje_vg_tree_free(working);
- /* TODO Phase 4/5: cache the materialised Efl_VG tree to avoid
- re-walking the entire Edje_Vg_Tree on every recalc when the
- description is unchanged. Cache key: (tree_id, classes_dirty,
- override-list-hash). Phase 4 introduces the per-node override
- list; Phase 5 needs the cache for 60fps transition performance
- where this function fires on every animator tick. */
- root = _edje_vg_tree_to_efl_vg(t);
if (!root)
{
ERR("Failed to materialise vector tree id=%d", chosen_desc->vg.tree_id);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.