CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/12/08 09:11:25
Modified files: . : ChangeLog server : Makefile.am testsuite : Makefile.am testsuite/swfdec: PASSING utilities : processor.cpp Added files: server : ManualClock.h Removed files: testsuite : ManualClock.h Log message: Virtual time is here, happyness and cheer CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5111&r2=1.5112 http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.134&r2=1.135 http://cvs.savannah.gnu.org/viewcvs/gnash/server/ManualClock.h?cvsroot=gnash&rev=1.1 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/Makefile.am?cvsroot=gnash&r1=1.48&r2=1.49 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/ManualClock.h?cvsroot=gnash&r1=1.1&r2=0 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.71&r2=1.72 http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.74&r2=1.75 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5111 retrieving revision 1.5112 diff -u -b -r1.5111 -r1.5112 --- ChangeLog 7 Dec 2007 18:13:12 -0000 1.5111 +++ ChangeLog 8 Dec 2007 09:11:24 -0000 1.5112 @@ -1,3 +1,10 @@ +2007-12-08 Sandro Santilli <[EMAIL PROTECTED]> + + * ManualClock.h: moved from testsuite to server + * utilities/processor.cpp: use a manual clock for running + tests. + * testsuite/swfdec/PASSING: setinterval-arguments succeeded. + 2007-12-07 Sandro Santilli <[EMAIL PROTECTED]> * gui/NullGui.cpp (run): stop keeping CPU busy for nothing. Index: server/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/server/Makefile.am,v retrieving revision 1.134 retrieving revision 1.135 diff -u -b -r1.134 -r1.135 --- server/Makefile.am 7 Dec 2007 11:45:37 -0000 1.134 +++ server/Makefile.am 8 Dec 2007 09:11:24 -0000 1.135 @@ -18,7 +18,7 @@ # # -# $Id: Makefile.am,v 1.134 2007/12/07 11:45:37 strk Exp $ +# $Id: Makefile.am,v 1.135 2007/12/08 09:11:24 strk Exp $ AUTOMAKE_OPTIONS = @@ -124,6 +124,7 @@ URLAccessManager.h \ VirtualClock.h \ SystemClock.h \ + ManualClock.h \ array.h \ as_environment.h \ as_function.h \ Index: testsuite/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/testsuite/Makefile.am,v retrieving revision 1.48 retrieving revision 1.49 diff -u -b -r1.48 -r1.49 --- testsuite/Makefile.am 7 Dec 2007 15:34:37 -0000 1.48 +++ testsuite/Makefile.am 8 Dec 2007 09:11:25 -0000 1.49 @@ -29,7 +29,6 @@ MovieTester.cpp \ FuzzyPixel.cpp \ FuzzyPixel.h \ - ManualClock.h \ $(NULL) libtestsuite_la_LIBADD = \ $(RENDERER_LIBS) \ Index: testsuite/swfdec/PASSING =================================================================== RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v retrieving revision 1.71 retrieving revision 1.72 diff -u -b -r1.71 -r1.72 --- testsuite/swfdec/PASSING 3 Dec 2007 08:15:46 -0000 1.71 +++ testsuite/swfdec/PASSING 8 Dec 2007 09:11:25 -0000 1.72 @@ -493,6 +493,7 @@ set-overwrite-global-5.swf:2b7b907f9333d9a3c70572bf1cbeed88 set-overwrite-global-6.swf:b49be2d21710ded0c665774c5377b3b5 set-overwrite-global-7.swf:0800f9cb345cef741e02d47c4769453e +setinterval-arguments.swf:bf5653c905e58846b5a9ee8841c3bcb3 setinterval-clear.swf:7897b1f201377d65dbffe1ae8182479a settarget-5.swf:2fdaa96ec67a1041d36d552f91a41cd4 settarget-6.swf:78786db5ba63f78996f63001501d46fe Index: utilities/processor.cpp =================================================================== RCS file: /sources/gnash/gnash/utilities/processor.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -u -b -r1.74 -r1.75 --- utilities/processor.cpp 7 Dec 2007 15:34:37 -0000 1.74 +++ utilities/processor.cpp 8 Dec 2007 09:11:25 -0000 1.75 @@ -16,7 +16,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: processor.cpp,v 1.74 2007/12/07 15:34:37 strk Exp $ */ +/* $Id: processor.cpp,v 1.75 2007/12/08 09:11:25 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -44,7 +44,7 @@ #include "debugger.h" #include "VM.h" #include "noseek_fd_adapter.h" -#include "SystemClock.h" +#include "ManualClock.h" extern "C"{ #include <unistd.h> @@ -329,11 +329,17 @@ exit(1); } - long localDelay = delay == -1 ? long(1000000/md->get_frame_rate())+1 : delay; // microseconds + float fps = md->get_frame_rate(); + long fpsDelay = long(1000000/fps); + long clockAdvance = fpsDelay/1000; + long localDelay = delay == -1 ? fpsDelay : delay; // microseconds + + printf("Will sleep %ld microseconds between iterations - fps is %g, clockAdvance is %lu\n", localDelay, fps, clockAdvance); // TODO: use a fake clock if running at different then FPS rate - SystemClock cl; + ManualClock cl; gnash::movie_root& m = VM::init(*md, cl).getRoot(); + cl.advance(10); // pretend we spent 10 milliseconds before getting to executing first frame md->completeLoad(); @@ -361,6 +367,8 @@ // safety margin on scaled shapes. size_t last_frame = m.get_current_frame(); + //printf("advancing clock by %lu\n", clockAdvance); + cl.advance(clockAdvance); m.advance(0.010f); if ( quitrequested ) @@ -439,6 +447,7 @@ resetLastAdvanceTimer(); } + printf("iteration, timer: %lu, localDelay: %ld\n", cl.elapsed(), localDelay); usleep(localDelay); } Index: server/ManualClock.h =================================================================== RCS file: server/ManualClock.h diff -N server/ManualClock.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ server/ManualClock.h 8 Dec 2007 09:11:24 -0000 1.1 @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * + */ + +#ifndef _GNASH_MANUAL_CLOCK_HH +#define _GNASH_MANUAL_CLOCK_HH + +#include "VirtualClock.h" // for inheritance + +namespace gnash { + +/// A manually advanced clock +class ManualClock : public VirtualClock +{ +public: + + /// Construct a manual clock + ManualClock() + : + _elapsed(0) + {} + + // see dox in VirtualClock.h + unsigned long elapsed() const + { + return _elapsed; + } + + // see dox in VirtualClock.h + void restart() + { + _elapsed=0; + } + + /// Advance the clock by the given amount of milliseconds + void advance(unsigned long amount) + { + _elapsed += amount; + } + +private: + + unsigned long _elapsed; +}; + + +} // namespace gnash + +#endif // _GNASH_MANUAL_CLOCK_HH Index: testsuite/ManualClock.h =================================================================== RCS file: testsuite/ManualClock.h diff -N testsuite/ManualClock.h --- testsuite/ManualClock.h 7 Dec 2007 15:34:37 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * - */ - -#ifndef _GNASH_MANUAL_CLOCK_HH -#define _GNASH_MANUAL_CLOCK_HH - -#include "VirtualClock.h" // for inheritance - -namespace gnash { - -/// A manually advanced clock -class ManualClock : public VirtualClock -{ -public: - - /// Construct a manual clock - ManualClock() - : - _elapsed(0) - {} - - // see dox in VirtualClock.h - unsigned long elapsed() const - { - return _elapsed; - } - - // see dox in VirtualClock.h - void restart() - { - _elapsed=0; - } - - /// Advance the clock by the given amount of milliseconds - void advance(unsigned long amount) - { - _elapsed += amount; - } - -private: - - unsigned long _elapsed; -}; - - -} // namespace gnash - -#endif // _GNASH_MANUAL_CLOCK_HH _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit