This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/122/head
in repository efl.
View the commit online.
commit 827a7dfd6999658faabd30c82e91a2aece2b485a
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Nov 25 16:56:11 2026 -0600
ecore_evas: let a window tick without driving the global animator
An engine may want to tick a window from that window's own display
clock. Such a window must not also drive the process-wide
ecore_animator, nor be picked as the global tick source: the choice
would then depend on which Ecore_Evas was created first, and global
animators would be ticked twice, from two clocks.
Add an animator_tick_local bit. An Ecore_Evas that sets it still ticks
its own animators and its sub-canvases, but leaves the global animators
to the other tick sources. No engine sets it yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/ecore_evas/ecore_evas.c | 43 +++++++++++++++++++--------------
src/lib/ecore_evas/ecore_evas_private.h | 1 +
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index fa663ec34e..2d173f2933 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -3095,8 +3095,8 @@ _ecore_evas_animators_do(Ecore_Evas *ee)
}
}
-EAPI void
-ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_time)
+static void
+_ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_time, Eina_Bool global_tick)
{
Ecore_Evas *subee;
Eina_List *l;
@@ -3122,12 +3122,12 @@ ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_t
EINA_LIST_FOREACH(ee->sub_ecore_evas, l, subee)
{
if (subee->evas)
- ecore_evas_animator_tick(subee, NULL, loop_time);
+ _ecore_evas_animator_tick(subee, NULL, loop_time, global_tick);
}
// We are a source of sync for general animator.
// Let's only trigger the animator once per rendering loop
- if (!ecore_main_loop_animator_ticked_get())
+ if (global_tick && !ecore_main_loop_animator_ticked_get())
{
// FIXME: We might want to enforce also Ecore_Animatore frametime
ecore_animator_custom_tick();
@@ -3136,6 +3136,12 @@ ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_t
DBG("Animator ticked on %p.", ee->evas);
}
+EAPI void
+ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, double loop_time)
+{
+ _ecore_evas_animator_tick(ee, viewport, loop_time, !ee->animator_tick_local);
+}
+
// Per Ecore_Evas ticking
static void
ecore_evas_tick_begin(Ecore_Evas *ee)
@@ -3160,6 +3166,16 @@ ecore_evas_tick_end(Ecore_Evas *ee)
ee->engine.func->fn_animator_unregister(ee);
}
+// An Ecore_Evas that ticks its own window only is never the source of the
+// global animators, whatever functions its engine provides.
+static Eina_Bool
+_ecore_evas_is_global_tick_source(const Ecore_Evas *ee)
+{
+ return ee->engine.func->fn_animator_register &&
+ ee->engine.func->fn_animator_unregister &&
+ !ee->animator_tick_local;
+}
+
// Need all possible tick to tick for animator fallback as we don't
// know if a window is the source of animator
static void
@@ -3168,9 +3184,7 @@ _ecore_evas_custom_tick_begin(void *data EINA_UNUSED)
Ecore_Evas *ee;
EINA_INLIST_FOREACH(ecore_evases, ee)
- if (!ee->deleted &&
- ee->engine.func->fn_animator_register &&
- ee->engine.func->fn_animator_unregister)
+ if (!ee->deleted && _ecore_evas_is_global_tick_source(ee))
ecore_evas_tick_begin(ee);
}
@@ -3180,9 +3194,7 @@ _ecore_evas_custom_tick_end(void *data EINA_UNUSED)
Ecore_Evas *ee;
EINA_INLIST_FOREACH(ecore_evases, ee)
- if (!ee->deleted &&
- ee->engine.func->fn_animator_register &&
- ee->engine.func->fn_animator_unregister)
+ if (!ee->deleted && _ecore_evas_is_global_tick_source(ee))
ecore_evas_tick_end(ee);
}
@@ -3198,11 +3210,8 @@ _ecore_evas_tick_source_find(void)
{
if (!ee->deleted)
{
- if ((ee->engine.func->fn_animator_register) &&
- (ee->engine.func->fn_animator_unregister))
- {
- source = EINA_TRUE;
- }
+ if (_ecore_evas_is_global_tick_source(ee))
+ source = EINA_TRUE;
if (ee->driver)
{
if ((!strcmp(ee->driver, "software_x11")) ||
@@ -3217,9 +3226,7 @@ _ecore_evas_tick_source_find(void)
// actually be the true tick source of all other window. In
// that scenario, we have to forcefully fallback.
EINA_INLIST_FOREACH(ecore_evases, ee)
- if (!ee->deleted &&
- (!ee->engine.func->fn_animator_register ||
- !ee->engine.func->fn_animator_unregister))
+ if (!ee->deleted && !_ecore_evas_is_global_tick_source(ee))
{
source = EINA_FALSE;
break;
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 95901b6809..11854f7657 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -428,6 +428,7 @@ struct _Ecore_Evas
unsigned char animator_registered : 1;
unsigned char animator_ticked : 1;
unsigned char animator_ran : 1;
+ unsigned char animator_tick_local : 1; // ticks its own window only, never the source of the global animators
unsigned char first_frame : 1;
unsigned char self_del : 1;
unsigned char evas_dying : 1;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.