gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h
Date: Tue, 25 Sep 2007 15:39:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/25 15:39:48

Modified files:
        .              : ChangeLog 
        gui            : gui.cpp gui.h 

Log message:
                * gui/gui.{cpp,h}: port SKIP_RENDERING_IF_LATE to use 
WallClockTimer.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4406&r2=1.4407
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.64&r2=1.65

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4406
retrieving revision 1.4407
diff -u -b -r1.4406 -r1.4407
--- ChangeLog   25 Sep 2007 14:57:04 -0000      1.4406
+++ ChangeLog   25 Sep 2007 15:39:48 -0000      1.4407
@@ -1,5 +1,9 @@
 2007-09-25 Sandro Santilli <address@hidden>
 
+       * gui/gui.{cpp,h}: port SKIP_RENDERING_IF_LATE to use WallClockTimer.
+
+2007-09-25 Sandro Santilli <address@hidden>
+
        * server/parser/sprite_definition.h (ensure_frame_loaded): don't
          assume the target frame has always been loaded, as we might
          have loaded less frames then advertised in header.

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- gui/gui.cpp 25 Sep 2007 09:44:45 -0000      1.99
+++ gui/gui.cpp 25 Sep 2007 15:39:48 -0000      1.100
@@ -38,7 +38,7 @@
 #include <cstring>
 
 #ifdef SKIP_RENDERING_IF_LATE
-#include <boost/timer.hpp>
+#include "WallClockTimer.h"
 #endif
 
 /// Define this to make sure each frame is fully rendered from ground up
@@ -75,6 +75,7 @@
 // as the mouse moves
 //#define DEBUG_MOUSE_COORDINATES 1
 
+
 namespace gnash {
 
 Gui::Gui() :
@@ -96,7 +97,7 @@
     ,fps_timer_interval(0.0)
 #endif
 #ifdef SKIP_RENDERING_IF_LATE
-    ,estimatedDisplayTime(0.001) // will grow later..
+    ,estimatedDisplayTime(0) // milliseconds (will grow later..)
 #endif // SKIP_RENDERING_IF_LATE
 {
 //    GNASH_REPORT_FUNCTION;
@@ -122,7 +123,7 @@
     ,fps_timer_interval(0.0)
 #endif        
 #ifdef SKIP_RENDERING_IF_LATE
-    ,estimatedDisplayTime(0.001) // will grow later..
+    ,estimatedDisplayTime(0) // milliseconds (will grow later..)
 #endif // SKIP_RENDERING_IF_LATE
 {
 }
@@ -500,7 +501,7 @@
 //     GNASH_REPORT_FUNCTION;
 
 #ifdef SKIP_RENDERING_IF_LATE
-       boost::timer advanceTimer;
+       WallClockTimer advanceTimer;
 #endif // SKIP_RENDERING_IF_LATE
 
        gnash::movie_root* m = gnash::get_current_root();
@@ -529,15 +530,15 @@
 
 #ifdef SKIP_RENDERING_IF_LATE
 
-       double advanceTime = advanceTimer.elapsed(); // in seconds !
+       uint32_t advanceTime = advanceTimer.elapsed(); // in milliseconds !
 
-       double timeSlot = gui->_interval/1000.0; // seconds between advance 
calls (TODO: compute once)
+       uint32_t timeSlot = gui->_interval; // milliseconds between advance 
calls 
 
        if ( advanceTime+gui->estimatedDisplayTime < timeSlot )
        {
                advanceTimer.restart();
                gui->display(m);
-               double displayTime = advanceTimer.elapsed();
+               uint32_t displayTime = advanceTimer.elapsed();
 
                if ( displayTime > gui->estimatedDisplayTime)
                {
@@ -555,7 +556,11 @@
        }
        else
        {
-               //log_debug("We're unable to keep up with FPS speed: 
advanceTime was %g + estimatedDisplayTime (%g) == %g, over a timeSlot of %g", 
advanceTime, gui->estimatedDisplayTime, advanceTime+gui->estimatedDisplayTime, 
timeSlot);
+               log_debug("We're unable to keep up with FPS speed: "
+                       "advanceTime was %u + estimatedDisplayTime (%u) "
+                       "== %u, over a timeSlot of %u",
+                       advanceTime, gui->estimatedDisplayTime,
+                       advanceTime+gui->estimatedDisplayTime, timeSlot);
                // TODO: increment a counter, we don't want to skip too many 
frames
        }
 #else // ndef SKIP_RENDERING_IF_LATE

Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- gui/gui.h   25 Sep 2007 09:44:45 -0000      1.64
+++ gui/gui.h   25 Sep 2007 15:39:48 -0000      1.65
@@ -351,9 +351,9 @@
 #endif // def GNASH_FPS_DEBUG
 
 #ifdef SKIP_RENDERING_IF_LATE
-    /// Estimated max number of seconds required for a call to ::display
+    /// Estimated max number of milliseconds required for a call to ::display
     /// This should be incremented everytime we take more
-    double estimatedDisplayTime;
+    uint32_t estimatedDisplayTime;
 #endif // SKIP_RENDERING_IF_LATE
 
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]