Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_evas
Modified Files:
ecore_evas.c
Log Message:
debugging - but more important - configure.in fix!
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ecore_evas.c 20 Feb 2004 07:06:27 -0000 1.8
+++ ecore_evas.c 16 Mar 2004 23:52:46 -0000 1.9
@@ -5,6 +5,34 @@
#include "Ecore_Evas.h"
static int _ecore_evas_init_count = 0;
+static int _ecore_evas_fps_debug = 0;
+static double _ecore_evas_fps_min = 0;
+static double _ecore_evas_fps_avg_min = 0;
+static int _ecore_evas_fps_avg_count = 1;
+static Ecore_Timer *_ecore_evas_fps_timer = NULL;
+
+static int
+_ecore_evas_cb_fps_debug_timer(void *data)
+{
+ static int frame_count = 0;
+ static double fps_count = 0.0;
+ static double pt = 0.0;
+ double t, fps;
+
+ t = ecore_time_get();
+ frame_count++;
+ if (pt == 0.0)
+ {
+ pt = t;
+ return 1;
+ }
+ if (t == pt) return 1;
+ fps = 1.0 / (t - pt);
+ if (fps > (2 * _ecore_evas_fps_avg_min)) return 1;
+ printf("ECORE_EVAS_FPS_DEBUG: FPS = %3.3f\n", fps);
+ pt = t;
+ return 1;
+}
/**
* Init the Evas system.
@@ -17,6 +45,23 @@
{
_ecore_evas_init_count++;
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
+ if (getenv("ECORE_EVAS_FPS_DEBUG"))
+ {
+ if (getenv("ECORE_EVAS_FPS_MIN"))
+ _ecore_evas_fps_min = atof(getenv("ECORE_EVAS_FPS_MIN"));
+ if (getenv("ECORE_EVAS_FPS_AVERAGE_MIN"))
+ _ecore_evas_fps_avg_min = atof(getenv("ECORE_EVAS_FPS_AVERAGE_MIN"));
+ if (getenv("ECORE_EVAS_FPS_AVERAGE_COUNT"))
+ _ecore_evas_fps_avg_count = atof(getenv("ECORE_EVAS_FPS_AVERAGE_COUNT"));
+ _ecore_evas_fps_debug = 1;
+ printf("%3.3f: %3.3f: %i\n",
+ _ecore_evas_fps_min,
+ _ecore_evas_fps_avg_min,
+ _ecore_evas_fps_avg_count);
+ _ecore_evas_fps_timer = ecore_timer_add(1.0 / (_ecore_evas_fps_avg_min * 2),
+ _ecore_evas_cb_fps_debug_timer,
+ NULL);
+ }
return _ecore_evas_init_count;
}
@@ -54,7 +99,12 @@
void
ecore_evas_free(Ecore_Evas *ee)
{
- if (!ee) return;
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_free");
+ return;
+ }
ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE);
if (ee->driver) free(ee->driver);
if (ee->name) free(ee->name);
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs