gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-16-gb0e7094
Date: Sun, 06 Feb 2011 10:22:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  b0e70947d5989293ce1194e7753cd09f1ae10643 (commit)
       via  cce149abd42a0be6fdd0eba2808af5529d54b79d (commit)
       via  4a096050205e0234157ca18936a11f888f468805 (commit)
       via  7596db7729416aac37e489753878a45bff6d44ce (commit)
       via  482f6e5b6949c4db9f70772577e3a51c0a92613e (commit)
       via  7e4eb57c3a04cb00b7582e48208d3d2eb92323c1 (commit)
      from  0ff1d321d1791db01f16964d1cb66b4714a01e08 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=b0e70947d5989293ce1194e7753cd09f1ae10643


commit b0e70947d5989293ce1194e7753cd09f1ae10643
Merge: cce149a 0ff1d32
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Feb 6 10:26:37 2011 +0100

    Merge branch 'master' of git.sv.gnu.org:/srv/git/gnash


http://git.savannah.gnu.org/cgit//commit/?id=cce149abd42a0be6fdd0eba2808af5529d54b79d


commit cce149abd42a0be6fdd0eba2808af5529d54b79d
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 4 14:18:33 2011 +0100

    Render whole scene.

diff --git a/gui/gui.cpp b/gui/gui.cpp
index b5008da..5d92421 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -83,6 +83,9 @@ struct Gui::Display
 {
     Display(Gui& g, movie_root& r) : _g(g), _r(r) {}
     void operator()() const {
+               InvalidatedRanges world_ranges;
+               world_ranges.setWorld();
+               _g.setInvalidatedRegions(world_ranges);
         _g.display(&_r);
     }
 private:

http://git.savannah.gnu.org/cgit//commit/?id=4a096050205e0234157ca18936a11f888f468805


commit 4a096050205e0234157ca18936a11f888f468805
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 4 14:13:09 2011 +0100

    Don't render frames in dump-gnash unless needed.

diff --git a/gui/ScreenShotter.cpp b/gui/ScreenShotter.cpp
index 32a3bb2..98bb472 100644
--- a/gui/ScreenShotter.cpp
+++ b/gui/ScreenShotter.cpp
@@ -101,33 +101,6 @@ ScreenShotter::saveImage(const Renderer& r, const 
std::string& id) const
 }
 
 void
-ScreenShotter::screenShot(const Renderer& r, size_t frameAdvance)
-{
-    // Save an image if a spontaneous screenshot was requested or the
-    // frame is in the list of requested frames.
-    if (_immediate || std::binary_search(_frames.begin(), _frames.end(),
-                frameAdvance)) {
-
-        // Check whether we've rendered an image for this frame.
-        if (_done.find(frameAdvance) != _done.end()) {
-            return;
-        }
-        _done.insert(frameAdvance);
-
-        saveImage(r, boost::lexical_cast<std::string>(frameAdvance));
-        _immediate = false;
-    }
-}
-
-void
-ScreenShotter::last(const Renderer& r) const
-{
-    if (_last) {
-        saveImage(r, "last");
-    }
-}
-
-void
 ScreenShotter::setFrames(const FrameList& frames)
 {
     _frames = frames;
diff --git a/gui/ScreenShotter.h b/gui/ScreenShotter.h
index 74942f2..a65de98 100644
--- a/gui/ScreenShotter.h
+++ b/gui/ScreenShotter.h
@@ -23,6 +23,8 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <set>
+#include <algorithm>
+#include <boost/lexical_cast.hpp>
 
 #include "GnashEnums.h"
 
@@ -57,15 +59,38 @@ public:
         _last = true;
     }
 
-    /// Called on the last frame before exit.
+    struct NoAction { void operator()() const {} };
+
+    /// To be called on the last frame before exit.
+    //
+    /// @param r                The renderer to use to render the image.
+    //
+    /// Which frame is last depends on the execution path of the SWF, whether
+    /// the SWF loops, whether a timeout was requested or a maximum number of
+    /// advances set. Those conditions are not knowable in advance, so
+    /// the last frame is a special case.
+    void last(const Renderer& r) const {
+        last<NoAction>(r);
+    }
+
+    /// To be called on the last frame before exit.
     //
+    /// @tparam Action          The functor to call only when a screenshot is
+    ///                         due. 
     /// @param r                The renderer to use to render the image.
     //
     /// Which frame is last depends on the execution path of the SWF, whether
     /// the SWF loops, whether a timeout was requested or a maximum number of
     /// advances set. Those conditions are not knowable in advance, so
     /// the last frame is a special case.
-    void last(const Renderer& r) const;
+    template<typename Action>
+    void last(const Renderer& r, Action* t = 0) const
+    {
+        if (_last) {
+            if (t) (*t)();
+            saveImage(r, "last");
+        }
+    }
 
     /// Takes a screenshot if required.
     //
@@ -74,7 +99,39 @@ public:
     /// @param frameAdvance     used to check whether a screenshot is required
     ///                         as well as to construct the filename.
     /// @param r                The renderer to use to render the image.
-    void screenShot(const Renderer& r, size_t frameAdvance);
+    void screenShot(const Renderer& r, size_t frameAdvance) {
+        screenShot<NoAction>(r, frameAdvance);
+    }
+
+    /// Takes a screenshot if required.
+    //
+    /// Called on each advance, invoking a functor before any screenshot is
+    /// taken.
+    //
+    /// @tparam Action          The functor to call only when a screenshot is
+    ///                         due. 
+    /// @param frameAdvance     used to check whether a screenshot is required
+    ///                         as well as to construct the filename.
+    /// @param r                The renderer to use to render the image.
+    template<typename Action>
+    void screenShot(const Renderer& r, size_t frameAdvance, Action* t = 0) {
+        // Save an image if a spontaneous screenshot was requested or the
+        // frame is in the list of requested frames.
+        if (_immediate || std::binary_search(_frames.begin(), _frames.end(),
+                    frameAdvance)) {
+
+            // Check whether we've rendered an image for this frame.
+            if (_done.find(frameAdvance) != _done.end()) {
+                return;
+            }
+            if (t) (*t)();
+            _done.insert(frameAdvance);
+
+            saveImage(r, boost::lexical_cast<std::string>(frameAdvance));
+            _immediate = false;
+        }
+        
+    }
 
     /// Request a list of frames to be rendered to image files.
     void setFrames(const FrameList& frames);
diff --git a/gui/dump/dump.cpp b/gui/dump/dump.cpp
index e5a1011..f68432c 100644
--- a/gui/dump/dump.cpp
+++ b/gui/dump/dump.cpp
@@ -195,13 +195,15 @@ DumpGui::run()
 
     VirtualClock& timer = getClock();
 
+    const bool doDisplay = _fileStream.is_open();
+
     _terminate_request = false;
     while (!_terminate_request) {
 
         _manualClock.advance(clockAdvance); 
 
         // advance movie now
-        advanceMovie();
+        advanceMovie(doDisplay);
 
         writeSamples();
 
diff --git a/gui/gui.cpp b/gui/gui.cpp
index b0a7738..b5008da 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -79,6 +79,17 @@
 
 namespace gnash {
 
+struct Gui::Display
+{
+    Display(Gui& g, movie_root& r) : _g(g), _r(r) {}
+    void operator()() const {
+        _g.display(&_r);
+    }
+private:
+    Gui& _g;
+    movie_root& _r;
+};
+
 Gui::Gui(RunResources& r) :
     _loop(true),
     _xid(0),
@@ -206,7 +217,8 @@ Gui::quit()
 {
     // Take a screenshot of the last frame if required.
     if (_screenShotter.get() && _renderer.get()) {
-        _screenShotter->last(*_renderer);
+        Display dis(*this, *_stage);
+        _screenShotter->last(*_renderer, &dis);
     }
     
     quitUI();
@@ -934,6 +946,7 @@ bool
 Gui::advanceMovie(bool doDisplay)
 {
 
+
     if (isStopped()) {
         return false;
     }
@@ -942,6 +955,7 @@ Gui::advanceMovie(bool doDisplay)
         start();
     }
 
+    Display dis(*this, *_stage);
     gnash::movie_root* m = _stage;
     
     // Define REVIEW_ALL_FRAMES to have *all* frames
@@ -997,7 +1011,7 @@ Gui::advanceMovie(bool doDisplay)
        }
 
     if (_screenShotter.get() && _renderer.get()) {
-        _screenShotter->screenShot(*_renderer, _advances);
+        _screenShotter->screenShot(*_renderer, _advances, doDisplay ? 0 : 
&dis);
     }
 
     // Only increment advances and check for exit condition when we've
diff --git a/gui/gui.h b/gui/gui.h
index 3ffac5b..45b4610 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -540,6 +540,9 @@ protected:
     virtual void playHook() {}
 
 private:
+
+    struct Display;
+
     std::map<int /* fd */, boost::function<void ()> > _fd_callbacks;
 
     /// Width of a window pixel, in stage pseudopixel units.

http://git.savannah.gnu.org/cgit//commit/?id=7596db7729416aac37e489753878a45bff6d44ce


commit 7596db7729416aac37e489753878a45bff6d44ce
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 4 13:41:21 2011 +0100

    Allow callers to decide whether to display or not.

diff --git a/gui/gui.cpp b/gui/gui.cpp
index 0a52ffd..b0a7738 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -931,7 +931,7 @@ Gui::start()
 }
 
 bool
-Gui::advanceMovie()
+Gui::advanceMovie(bool doDisplay)
 {
 
     if (isStopped()) {
@@ -969,11 +969,6 @@ Gui::advanceMovie()
     }
 #endif
     
-    
-    // TODO: ask stage about doDisplay ?
-    // - if it didn't advance might need to check updateAfterEvent
-    bool doDisplay = true;
-    
 #ifdef SKIP_RENDERING_IF_LATE
     // We want to skip rendering IFF it's time to advance again.
     // We'll ask the stage about it
diff --git a/gui/gui.h b/gui/gui.h
index 6f37a31..3ffac5b 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -274,7 +274,7 @@ public:
     ///
     /// @return true if this beat resulted in actual frame advancement.
     ///
-    bool advanceMovie();
+    bool advanceMovie(bool doDisplay = true);
 
     /// Convenience static wrapper around advanceMovie for callbacks happiness.
     //

http://git.savannah.gnu.org/cgit//commit/?id=482f6e5b6949c4db9f70772577e3a51c0a92613e


commit 482f6e5b6949c4db9f70772577e3a51c0a92613e
Merge: 7e4eb57 16feba7
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 4 12:19:36 2011 +0100

    Merge branch 'master' of git.sv.gnu.org:/srv/git/gnash


http://git.savannah.gnu.org/cgit//commit/?id=7e4eb57c3a04cb00b7582e48208d3d2eb92323c1


commit 7e4eb57c3a04cb00b7582e48208d3d2eb92323c1
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Jan 31 12:07:31 2011 +0100

    Don't use wrapper function where unneeded.

diff --git a/gui/NullGui.cpp b/gui/NullGui.cpp
index 825219e..5f0058b 100644
--- a/gui/NullGui.cpp
+++ b/gui/NullGui.cpp
@@ -41,7 +41,7 @@ NullGui::run()
   while (!_quit)
   {
 
-    Gui::advance_movie(this);
+    advanceMovie();
     unsigned long now = timer.elapsed();
     unsigned long spent = now-prevtime;
 
diff --git a/gui/sdl/sdl.cpp b/gui/sdl/sdl.cpp
index b9a7394..afc79c8 100644
--- a/gui/sdl/sdl.cpp
+++ b/gui/sdl/sdl.cpp
@@ -124,7 +124,7 @@ SDLGui::run()
             SDL_Delay(delay);
         }
 
-        Gui::advance_movie(this);
+        advanceMovie();
         movie_time += _interval;        // Time next frame should be displayed
     }
     return false;

-----------------------------------------------------------------------

Summary of changes:
 gui/NullGui.cpp       |    2 +-
 gui/ScreenShotter.cpp |   27 ---------------------
 gui/ScreenShotter.h   |   63 ++++++++++++++++++++++++++++++++++++++++++++++--
 gui/dump/dump.cpp     |    4 ++-
 gui/gui.cpp           |   28 +++++++++++++++------
 gui/gui.h             |    5 +++-
 gui/sdl/sdl.cpp       |    2 +-
 7 files changed, 89 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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