+10

dh


On 5/16/21 1:36 PM, Carsten Haitzler wrote:
raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=96e7e42fbb3ab4421e62cff9d49af3759f5ca44b

commit 96e7e42fbb3ab4421e62cff9d49af3759f5ca44b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sun May 16 18:36:30 2021 +0100

     fps debug - slim code a bit and order events so they do go up and right
---
  src/bin/e_comp.c        | 51 +++++++++---------------------------
  src/bin/e_comp_canvas.c | 69 ++++++++++++++++++++++++++++++-------------------
  2 files changed, 54 insertions(+), 66 deletions(-)

diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index fdaa8bebd..caec70e00 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -427,11 +427,11 @@ e_comp_frame_event_add(int info[4], double t)
  E_API void
  e_comp_client_frame_add(Evas_Object *obj EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-   double t = ecore_time_get();
-
-   info[0] = E_COMP_FRAME_EVENT_CLIENT_DAMAGE;
-   e_comp_frame_event_add(info, t);
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_CLIENT_DAMAGE, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
  }
static inline void
@@ -604,13 +604,13 @@ e_comp_fps_update(void)
                    else if (info0 == E_COMP_FRAME_EVENT_RENDER_BEGIN)
                      _e_comp_fps_draw_point(pix, pixstride, pixw, 3, 
0xffff4433, px);
                    else if (info0 == E_COMP_FRAME_EVENT_IDLE_ENTER)
-                    _e_comp_fps_draw_point(pix, pixstride, pixw, 4, 
0xff994499, px);
-                  else if (info0 == E_COMP_FRAME_EVENT_IDLE_EXIT)
-                    _e_comp_fps_draw_point(pix, pixstride, pixw, 5, 
0xffff88ff, px);
+                    _e_comp_fps_draw_point(pix, pixstride, pixw, 4, 
0xffff88ff, px);
                    else if (info0 == E_COMP_FRAME_EVENT_HANDLE_DAMAGE)
-                    _e_comp_fps_draw_point(pix, pixstride, pixw, 6, 
0xff44ff22, px);
+                    _e_comp_fps_draw_point(pix, pixstride, pixw, 5, 
0xff44ff22, px);
                    else if (info0 == E_COMP_FRAME_EVENT_CLIENT_DAMAGE)
-                    _e_comp_fps_draw_point(pix, pixstride, pixw, 7, 
0xff4466ff, px);
+                    _e_comp_fps_draw_point(pix, pixstride, pixw, 6, 
0xff4466ff, px);
+                  else if (info0 == E_COMP_FRAME_EVENT_IDLE_EXIT)
+                    _e_comp_fps_draw_point(pix, pixstride, pixw, 7, 
0xff994499, px);
                 }
               for (t = 0.0; t < 10.0; t += (1.0 / 60.0))
                 {
@@ -662,37 +662,10 @@ _e_comp_cb_update(void)
     _e_comp_fps_update();
     if (conf->fps_show)
       {
-        double t = ecore_loop_time_get();
-        int info[4] = { 0, 0, 0, 0 };
-
-        info[0] = E_COMP_FRAME_EVENT_HANDLE_DAMAGE;
-        e_comp_frame_event_add(info, t);
+        int info[4] = { E_COMP_FRAME_EVENT_HANDLE_DAMAGE, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_loop_time_get());
          e_comp_fps_update();
       }
-   /*
-      if (doframeinfo == -1)
-      {
-      doframeinfo = 0;
-      if (getenv("DFI")) doframeinfo = 1;
-      }
-      if (doframeinfo)
-      {
-      static double t0 = 0.0;
-      double td, t;
-
-      t = ecore_time_get();
-      td = t - t0;
-      if (td > 0.0)
-      {
-      int fps, i;
-
-      fps = 1.0 / td;
-      for (i = 0; i < fps; i+= 2) putchar('=');
-      printf(" : %3.3f", 1.0 / td);
-      }
-      t0 = t;
-      }
-    */
  nocomp:
     ec = _e_comp_fullscreen_check();
     if (ec)
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index 0abd886e0..de53573bc 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -72,37 +72,45 @@ _e_comp_canvas_render_post_job(void *data EINA_UNUSED)
  static void
  _e_comp_canvas_render_track_pre(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 
void *event_info EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-
-   info[0] = E_COMP_FRAME_EVENT_RENDER_BEGIN;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_RENDER_BEGIN, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
  }
static void
  _e_comp_canvas_render_track_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 
void *event_info EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-
-   info[0] = E_COMP_FRAME_EVENT_RENDER_END;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_RENDER_END, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
  }
static void
  _e_comp_canvas_render_track_flush_pre(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, void *event_info EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-
-   info[0] = E_COMP_FRAME_EVENT_RENDER2_BEGIN;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_RENDER2_BEGIN, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
  }
static void
  _e_comp_canvas_render_track_flush_post(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, void *event_info EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-
-   info[0] = E_COMP_FRAME_EVENT_RENDER2_END;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_RENDER2_END, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
  }
static void
@@ -455,14 +463,15 @@ _e_comp_canvas_cb_zone_sort(const void *data1, const void 
*data2)
  static void
  _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void 
*event_info EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-   double t = ecore_time_get();
     E_Comp_Cb cb;
     Eina_List *l;
     E_Comp_Config *conf = e_comp_config_get();
- info[0] = E_COMP_FRAME_EVENT_RENDER_BEGIN;
-   e_comp_frame_event_add(info, t);
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_RENDER_BEGIN, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
e_comp->rendering = EINA_TRUE; @@ -479,18 +488,24 @@ _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *even
  static Eina_Bool
  _e_comp_canvas_cb_idle_enterer(void *data EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-   info[0] = E_COMP_FRAME_EVENT_IDLE_ENTER;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+     {
+        int info[4] = { E_COMP_FRAME_EVENT_IDLE_ENTER, 0, 0, 0 };
+        e_comp_frame_event_add(info, ecore_time_get());
+     }
     return EINA_TRUE;
  }
static Eina_Bool
  _e_comp_canvas_cb_idle_exiter(void *data EINA_UNUSED)
  {
-   int info[4] = { 0, 0, 0, 0 };
-   info[0] = E_COMP_FRAME_EVENT_IDLE_EXIT;
-   e_comp_frame_event_add(info, ecore_time_get());
+   E_Comp_Config *conf = e_comp_config_get();
+   if (conf->fps_show)
+   {
+      int info[4] = { E_COMP_FRAME_EVENT_IDLE_EXIT, 0, 0, 0 };
+      e_comp_frame_event_add(info, ecore_time_get());
+   }
     return EINA_TRUE;
  }
@@ -521,7 +536,7 @@ e_comp_canvas_init(int w, int h)
     if (!inited)
       {
          inited = 1;
-        ecore_idle_enterer_add(_e_comp_canvas_cb_idle_enterer, NULL);
+        ecore_idle_enterer_before_add(_e_comp_canvas_cb_idle_enterer, NULL);
          ecore_idle_exiter_add(_e_comp_canvas_cb_idle_exiter, NULL);
       }
     evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_PRE, 
_e_comp_canvas_render_track_pre, NULL);



_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to