[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h
From: |
Udo Giacomozzi |
Subject: |
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h |
Date: |
Tue, 03 Jul 2007 08:07:08 +0000 |
CVSROOT: /cvsroot/gnash
Module name: gnash
Changes by: Udo Giacomozzi <udog> 07/07/03 08:07:07
Modified files:
. : ChangeLog
gui : gui.cpp gui.h
Log message:
add min/avg/max fps printing
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3646&r2=1.3647
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.55&r2=1.56
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.3646
retrieving revision 1.3647
diff -u -b -r1.3646 -r1.3647
--- ChangeLog 3 Jul 2007 05:46:03 -0000 1.3646
+++ ChangeLog 3 Jul 2007 08:07:07 -0000 1.3647
@@ -1,3 +1,7 @@
+2007-07-03 Udo Giacomozzi <address@hidden>
+
+ * gui/gui.{cpp,h}: add min/avg/max fps printing
+
2007-07-03 Sandro Santilli <address@hidden>
* backend/render_handler_tri.{cpp,h}: (tri_cache_manager): dont leak
Index: gui/gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- gui/gui.cpp 2 Jul 2007 22:48:20 -0000 1.85
+++ gui/gui.cpp 3 Jul 2007 08:07:07 -0000 1.86
@@ -590,7 +590,10 @@
// at each fpsCounterTick call...
uint64_t interval_ms = (uint64_t)(fps_timer_interval * 1000.0);
- if (fps_counter_total==1) fps_timer = current_timer;
+ if (fps_counter_total==1) {
+ fps_timer = current_timer;
+ fps_start_timer = current_timer;
+ }
++fps_counter;
@@ -598,9 +601,23 @@
float secs = (current_timer - fps_timer) / 1000.0;
+ float rate = fps_counter/secs;
+
+ // first FPS message?
+ if (fps_timer == fps_start_timer) { // they're ints, so we can compare
+ fps_rate_min = rate;
+ fps_rate_max = rate;
+ } else {
+ fps_rate_min = fmin(fps_rate_min, rate);
+ fps_rate_max = fmax(fps_rate_max, rate);
+ }
+
+ float avg = fps_counter_total / ((current_timer - fps_start_timer) /
1000.0);
+
//log_msg("Effective frame rate: %0.2f fps", (float)(fps_counter/secs));
- printf("Effective frame rate: %0.2f fps (%u frames total)\n",
- (float)(fps_counter/secs), fps_counter_total);
+ printf("Effective frame rate: %0.2f fps (min %0.2f, avg %0.2f, max %0.2f, "
+ "%u frames total)\n", rate, fps_rate_min, avg, fps_rate_max,
+ fps_counter_total);
fps_counter = 0;
fps_timer = current_timer;
Index: gui/gui.h
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- gui/gui.h 2 Jul 2007 18:32:53 -0000 1.55
+++ gui/gui.h 3 Jul 2007 08:07:07 -0000 1.56
@@ -298,12 +298,13 @@
#ifdef GNASH_FPS_DEBUG
unsigned int fps_counter;
+ float fps_rate_min, fps_rate_max;
// Number of calls to fpsCounterTick, which is also
// the number of calls to movie_advance()
unsigned int fps_counter_total;
- uint64_t fps_timer;
+ uint64_t fps_timer, fps_start_timer;
/// The time, in seconds, between prints (which also resets the fps
counter).
//
- [Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h,
Udo Giacomozzi <=