Re: [E-devel] [EGIT] [core/efl] master 01/01: ecore evas - wl - detect timestamsp too far in the past and complain

Christopher Michael <[email protected]> Sat, 11 Dec 2021 23:58:02 -0500
Newsgroups gmane.comp.window-managers.enlightenment.devel
Message-ID <[email protected]>
comment inline

On 12/10/21 05:56, Carsten Haitzler wrote:
> raster pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=f6c99bd806f1a10dd37bad95355e62cebc1a0f2d
>
> commit f6c99bd806f1a10dd37bad95355e62cebc1a0f2d
> Author: Carsten Haitzler <[email protected]>
> Date:   Fri Dec 10 10:54:32 2021 +0000
>
>      ecore evas - wl - detect timestamsp too far in the past and complain
>      
>      this has all sorts of nasty side effects by rewinding time far too
>      much and thus causing timers to expire early and so on - these
>      timestamps are MEANT to be like a frame vsync time... they thus should
>      be like normally 0.02sec or so in the past or less... (0.008s on
>      average) so at 0.1 sec complain and ignore the old timestamp. weston
>      does this and sends us timestmaps 0.33sec in the past ... and its not
>      nice.
>      
>      @fix
> ---
>   .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c        | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
> index e9569f650d..5f354a1bd8 100644
> --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
> +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
> @@ -42,12 +42,20 @@ _anim_cb_tick(Ecore_Wl2_Window *win EINA_UNUSED, uint32_t timestamp, void *data)
>      Ecore_Evas *ee = data;
>      Ecore_Evas_Engine_Wl_Data *edata;
>      double t;//, rt;
> +   double tnow = ecore_time_get();


Not sure the above assignment would qualify as EFL lol ... Variables at 
top and one line :P

That being said, Awesome fix Mate !! :) Thank You !!

dh



>      /* static double pt = 0.0, prt = 0.0; */
>   
>      edata = ee->engine.data;
>   
>      if (!edata->ticking) return;
>      t = ((double)timestamp / 1000.0);
> +   if ((t - tnow) < -0.1)
> +     {
> +        fprintf(stderr,
> +                "ecore_evas: _anim_cb_tick() -> tick too far in past - %1.5f sec behind\n",
> +                tnow - t);
> +        t = tnow;
> +     }
>      ecore_loop_time_set(t);
>      /* rt = ecore_time_get(); */
>      /* printf("ECORE_EVAS: wl client anim tick %p | %p - %1.5f @ %1.5f delt=%1.5f | %1.5f\n", ee, edata, t, ecore_time_get(), t - pt, rt - prt); */
>