[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/getTime...
From: |
Zou Lunkai |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/getTime... |
Date: |
Fri, 18 May 2007 06:05:38 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Zou Lunkai <zoulunkai> 07/05/18 06:05:38
Modified files:
. : ChangeLog
testsuite/misc-ming.all: getTimer_test.c
server/vm : VM.h VM.cpp ASHandlers.cpp
gui : fb.cpp
server : movie_root.h
Log message:
cleanup ActionGetTimer related stuff
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3260&r2=1.3261
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/getTimer_test.c?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fb.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.52&r2=1.53
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3260
retrieving revision 1.3261
diff -u -b -r1.3260 -r1.3261
--- ChangeLog 18 May 2007 04:00:34 -0000 1.3260
+++ ChangeLog 18 May 2007 06:05:37 -0000 1.3261
@@ -1,3 +1,13 @@
+2007-05-18 Zou Lunkai <address@hidden>
+
+ * testsuite/misc-ming.all/getTimer_test.c
+ * server/vm/VM.{h,cpp}
+ * server/vm/ASHandlers.cpp
+ * gui/fb.cpp
+ cleanup "ActionGetTimer" related stuff.
+ * server/movie_root.h
+ remove unused get_timer, set_timer.
+
2007-05-17 Martin Guy <address@hidden>
* configure.ac: Change package help message format
@@ -39,6 +49,11 @@
2007-05-17 Zou Lunkai <address@hidden>
+ * testsuite/misc-ming.all/getTimer_test.c:
+ make the time dependent tests be more tolerant
+
+2007-05-17 Zou Lunkai <address@hidden>
+
* testsuite/misc-ming.all: getTimer_test.c, Makefile.am
add a new testcase; activate action_execution_order_test9.c
* server/vm/VM.{h,cpp}: add a getStartTime() for VM.
Index: testsuite/misc-ming.all/getTimer_test.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/getTimer_test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/getTimer_test.c 17 May 2007 10:21:14 -0000
1.2
+++ testsuite/misc-ming.all/getTimer_test.c 18 May 2007 06:05:37 -0000
1.3
@@ -16,7 +16,15 @@
*
*/
/*
- * test ActionGetTimer, getTimer returns the time in milliseconds
+ * test ActionGetTimer, getTimer returns the time in milliseconds.
+ *
+ * TODO: use AS method "ifFrameLoaded" to ensure that all frames are loaded
before
+ * testing getTimer().
+ *
+ * Ming seems do not support "ifFrameLoaded" yet:(
+ * Take care that gprocessor does not support frame-rate-control!
+ * Take care that this test might fail if it is loaded from a network
+ * and the loading speed is too slow!
*/
#include <stdlib.h>
@@ -53,30 +61,29 @@
SWFMovie_add(mo, (SWFBlock)dejagnuclip);
SWFMovie_nextFrame(mo); // frame1
+ // get current time in frame2
add_actions(mo, "x1 = getTimer();");
- // check that the timer was properly initialized
- check(mo, "x1 > 0" );
SWFMovie_nextFrame(mo); // frame2
- add_actions(mo, "x2 = getTimer();");
-
// just delay some time here
- add_actions(mo, " for(i=0; i<3000; i++) {} ");
+ add_actions(mo, " for(i=0; i<1000; i++) {} ");
+ // get current time in frame3
+ add_actions(mo, "x2 = getTimer();");
+ SWFMovie_nextFrame(mo); // frame3
// check that the timer is working
+ check(mo, "x1 > 0");
check(mo, "x2 > x1" );
-
// this is dependent on frame rate(current setting is 1 second per frame)
// check(mo, "x2 > 1000");
check(mo, "x2 < 6000");
-
// check that "getTimer" return a intergral number
check(mo, "x2 == Math.ceil(x2)");
check(mo, "x2 == Math.floor(x2)");
- SWFMovie_nextFrame(mo); // frame3
+ SWFMovie_nextFrame(mo); // frame4
add_actions(mo, "_root.totals(); stop();");
- SWFMovie_nextFrame(mo);
+ SWFMovie_nextFrame(mo); // frame5
//Output movie
puts("Saving " OUTPUT_FILENAME );
Index: server/vm/VM.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/vm/VM.h 17 May 2007 09:23:27 -0000 1.7
+++ server/vm/VM.h 18 May 2007 06:05:37 -0000 1.8
@@ -87,7 +87,7 @@
int _swfversion;
/// Time when the VM get started
- static uint64_t _start_time;
+ uint64_t _start_time;
/// Set the current Root movie.
//
@@ -141,8 +141,8 @@
///
int getSWFVersion() const;
- /// Get the time when VM was started
- static uint64_t getStartTime();
+ /// Get the number of milliseconds since VM was started
+ uint64_t getTime();
/// Get version of the player, in a compatible representation
//
Index: server/vm/VM.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/vm/VM.cpp 17 May 2007 09:23:27 -0000 1.7
+++ server/vm/VM.cpp 18 May 2007 06:05:37 -0000 1.8
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: VM.cpp,v 1.7 2007/05/17 09:23:27 zoulunkai Exp $ */
+/* $Id: VM.cpp,v 1.8 2007/05/18 06:05:37 zoulunkai Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -34,7 +34,6 @@
// Pointer to our singleton
std::auto_ptr<VM> VM::_singleton;
-uint64_t VM::_start_time;
VM&
VM::init(movie_definition& movie)
@@ -53,9 +52,6 @@
_singleton->setGlobal(new Global(*_singleton));
assert(_singleton->getGlobal());
- // init singleton start time
- _start_time = tu_timer::get_ticks();
-
return *_singleton;
}
@@ -75,7 +71,8 @@
VM::VM(movie_definition& topmovie)
:
- _swfversion(topmovie.get_version())
+ _swfversion(topmovie.get_version()),
+ _start_time(tu_timer::get_ticks())
{
}
@@ -144,9 +141,9 @@
}
uint64_t
-VM::getStartTime()
+VM::getTime()
{
- return _start_time;
+ return (tu_timer::get_ticks() - _start_time);
}
} // end of namespace gnash
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- server/vm/ASHandlers.cpp 17 May 2007 09:23:27 -0000 1.105
+++ server/vm/ASHandlers.cpp 18 May 2007 06:05:38 -0000 1.106
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ASHandlers.cpp,v 1.105 2007/05/17 09:23:27 zoulunkai Exp $ */
+/* $Id: ASHandlers.cpp,v 1.106 2007/05/18 06:05:38 zoulunkai Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -49,7 +49,6 @@
#include "movie_root.h" // for set_drag_state (ActionStartDragMovie)
#include "debugger.h"
#include "sound_handler.h"
-#include "tu_timer.h" // for tu_timer::get_ticks()
#include <string>
#include <map>
@@ -1427,17 +1426,8 @@
{
// GNASH_REPORT_FUNCTION;
- // Maybe the timer should be associated to the VM
- // rather then to the movie_root...
- //
- // Oh, another thing, rather then calling VM::get().getRoot()
- // we should likely get the movie_root from the environment,
- // to take into account a future support for multiple concurrent
- // VM running in a single process (for example: playing multiple
- // movies in multiple windows using the same executable)
-
as_environment& env = thread.env;
- env.push(floorf(tu_timer::get_ticks() - VM::getStartTime()));
+ env.push(floorf(VM::get().getTime()));
}
void
Index: gui/fb.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/fb.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- gui/fb.cpp 2 May 2007 17:06:00 -0000 1.29
+++ gui/fb.cpp 18 May 2007 06:05:38 -0000 1.30
@@ -352,11 +352,6 @@
timer = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}
- // update global timer (getTimer())
- // (Udo): Just a quick hack. I suggest we solve this in a different way
- gnash::movie_root* m = gnash::get_current_root();
- m->set_timer(timer - start_timer);
-
// advance movie
Gui::advance_movie(this);
}
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/movie_root.h 1 May 2007 18:02:51 -0000 1.52
+++ server/movie_root.h 18 May 2007 06:05:38 -0000 1.53
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: movie_root.h,v 1.52 2007/05/01 18:02:51 strk Exp $ */
+/* $Id: movie_root.h,v 1.53 2007/05/18 06:05:38 zoulunkai Exp $ */
/// \page events_handling Handling of user events
///
@@ -307,15 +307,6 @@
return m_background_color.m_a / 255.0f;
}
- float get_timer() const { return m_timer; }
-
- /// Sets the current movie timer in seconds.
- //
- /// (Udo): I think getTimer() should be handled *completely*
- /// in the AS VM...
- ///
- void set_timer(float value) { m_timer = value; }
-
/// Delegate to current top-level root sprite
void restart() { _movie->restart(); }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/getTime...,
Zou Lunkai <=