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_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-374-g0d59d6b
Date: Wed, 29 Jun 2011 07:16:15 +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  0d59d6b6829ffb9dcddd2c7652d928da78812b75 (commit)
       via  99b86834da75cb16aa74b4d7128502d6f5604061 (commit)
       via  8355d15d1ca8ad56330e0222f5e552147e56233b (commit)
       via  167d3bca6fb9131391b78181e965653a31fb3094 (commit)
      from  0a952522bb73e351a0967aced567dcb319285f5c (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=0d59d6b6829ffb9dcddd2c7652d928da78812b75


commit 0d59d6b6829ffb9dcddd2c7652d928da78812b75
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Jun 29 09:11:49 2011 +0200

    Use the ObjectURI we locate.

diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index 4371568..55f1cdd 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -979,7 +979,7 @@ array_splice(const fn_call& fn)
     ObjectURI propPush = getURI(getVM(fn), NSV::PROP_PUSH);
     for (size_t i = 0; i < remove; ++i) {
         const ObjectURI& key = getKey(fn, start + i);
-        callMethod(ret, NSV::PROP_PUSH, getOwnProperty(*array, key));
+        callMethod(ret, propPush, getOwnProperty(*array, key));
     }
 
     // Shift elements in 'this' array by simple assignment, not delete

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


commit 99b86834da75cb16aa74b4d7128502d6f5604061
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Jun 29 08:11:28 2011 +0200

    Don't construct unused iterators.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index a5f0915..d11ec5b 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -1030,9 +1030,6 @@ TextField::format_text()
         return;
     }
     
-    LineStarts::iterator linestartit = _line_starts.begin();
-    LineStarts::const_iterator linestartend = _line_starts.end();
-
     AutoSize autoSize = getAutoSize();
     if (autoSize != AUTOSIZE_NONE) {
         // When doing WordWrap we don't want to change

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


commit 8355d15d1ca8ad56330e0222f5e552147e56233b
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Jun 29 08:11:16 2011 +0200

    Use the colour we create.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 2e66d4b..8a2d887 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -2030,9 +2030,9 @@ movie_root::set_background_color(const rgba& color)
     rgba newcolor = color;
     newcolor.m_a = m_background_color.m_a;
 
-    if (m_background_color != color) {
+    if (m_background_color != newcolor) {
         setInvalidated();
-        m_background_color = color;
+        m_background_color = newcolor;
     }
 }
 

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


commit 167d3bca6fb9131391b78181e965653a31fb3094
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Jun 29 08:08:13 2011 +0200

    Don't store as_functions in the sprite definition.

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 1b9ddb8..dd43ce6 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -737,17 +737,14 @@ MovieClip::notifyEvent(const event_id& id)
             // nor if it's dynamic  
             if (isDynamic()) break;
 
-            const sprite_definition* def =
-                dynamic_cast<const sprite_definition*>(_def.get());
-
             // must be a loaded movie (loadMovie doesn't mark it as 
             // "dynamic" - should it? no, or getBytesLoaded will always
             // return 0)  
-            if (!def) break;
+            if (!_def) break;
 
             // if it has a registered class it can have an onLoad 
             // in prototype...
-            if (def->getRegisteredClass()) break;
+            if (stage().getRegisteredClass(_def.get())) break;
 
 #ifdef GNASH_DEBUG
             log_debug(_("Sprite %s (depth %d) won't check for user-defined "
@@ -1634,7 +1631,7 @@ MovieClip::constructAsScriptObject()
         dynamic_cast<const sprite_definition*>(_def.get());
 
     // We won't "construct" top-level movies
-    as_function* ctor = def ? def->getRegisteredClass() : 0;
+    as_function* ctor = def ? stage().getRegisteredClass(def) : 0;
 
 #ifdef GNASH_DEBUG
     log_debug(_("Attached movieclips %s registered class is %p"),
diff --git a/libcore/asobj/Object.cpp b/libcore/asobj/Object.cpp
index 89c8dd8..cba6e6e 100644
--- a/libcore/asobj/Object.cpp
+++ b/libcore/asobj/Object.cpp
@@ -18,23 +18,24 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#include "Object.h"
+
+#include <string>
+#include <sstream>
+
 #include "Movie.h"
 #include "DisplayObject.h"
 #include "fn_call.h"
-#include "as_object.h" // for inheritance
+#include "as_object.h" 
 #include "NativeFunction.h" 
 #include "movie_definition.h" 
 #include "sprite_definition.h"
 #include "VM.h" 
 #include "namedStrings.h" // for NSV::PROP_TO_STRING
 #include "Global_as.h"
-#include "Object.h"
-
+#include "movie_root.h"
 #include "log.h"
 
-#include <string>
-#include <sstream>
-
 namespace gnash {
 
 // Forward declarations
@@ -266,8 +267,7 @@ object_registerClass(const fn_call& fn)
     }
 
     const std::string& symbolid = fn.arg(0).to_string();
-    if (symbolid.empty())
-    {
+    if (symbolid.empty()) {
         IF_VERBOSE_ASCODING_ERRORS(
             std::stringstream ss;
             fn.dump_args(ss);
@@ -331,7 +331,8 @@ object_registerClass(const fn_call& fn)
         return as_value(false);
     }
 
-    exp_clipdef->registerClass(theclass);
+    movie_root& mr = getRoot(fn);
+    mr.registerClass(exp_clipdef, theclass);
     return as_value(true);
 }
 
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 3bf80ae..2e66d4b 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -258,6 +258,20 @@ movie_root::abortOnScriptTimeout(const std::string& what) 
const
     }
     return disable;
 }
+   
+void
+movie_root::registerClass(const SWF::DefinitionTag* sprite, as_function* cls)
+{
+    _registeredClasses[sprite] = cls;
+}
+
+as_function*
+movie_root::getRegisteredClass(const SWF::DefinitionTag* sprite) const
+{
+    RegisteredClasses::const_iterator it = _registeredClasses.find(sprite);
+    if (it == _registeredClasses.end()) return 0;
+    return it->second;
+}
 
 void
 movie_root::handleActionLimitHit(const std::string& msg)
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 93fa4a9..df367b8 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -669,6 +669,10 @@ public:
         return _unreleasedKeys;
     }
 
+    void registerClass(const SWF::DefinitionTag* sprite, as_function* cls);
+
+    as_function* getRegisteredClass(const SWF::DefinitionTag* sprite) const;
+
     /// Set a filedescriptor to use for host application requests
     /// (for browser communication mostly)
     void setHostFD(int fd) {
@@ -997,6 +1001,9 @@ private:
     /// interface to the Movie class definition
     Levels _movies;
 
+    typedef std::map<const SWF::DefinitionTag*, as_function*> 
RegisteredClasses;
+    RegisteredClasses _registeredClasses;
+
     /// The root movie. This is initially the same as getLevel(0) but might
     /// change during the run. It will be used to setup and retrive initial
     /// stage size
@@ -1087,7 +1094,6 @@ movie_root::callInterface(const HostInterface::Message& 
e) const
     }
 }
 
-
 } // namespace gnash
 
 #endif // GNASH_MOVIE_ROOT_H
diff --git a/libcore/parser/sprite_definition.cpp 
b/libcore/parser/sprite_definition.cpp
index 1018453..85da443 100644
--- a/libcore/parser/sprite_definition.cpp
+++ b/libcore/parser/sprite_definition.cpp
@@ -114,22 +114,9 @@ sprite_definition::sprite_definition(movie_definition& m, 
SWFStream& in,
        m_movie_def(m),
        m_frame_count(0),
        m_loading_frame(0),
-       registeredClass(0),
        _loadingSoundStream(-1)
 {
        read(in, runResources);
 }
 
-void
-sprite_definition::registerClass(as_function* the_class)
-{
-       registeredClass = the_class;
-}
-
-void
-sprite_definition::markReachableResources() const
-{
-       if (registeredClass) registeredClass->setReachable();
-}
-
 } // namespace gnash
diff --git a/libcore/parser/sprite_definition.h 
b/libcore/parser/sprite_definition.h
index 0a57e61..10c5609 100644
--- a/libcore/parser/sprite_definition.h
+++ b/libcore/parser/sprite_definition.h
@@ -70,23 +70,6 @@ public:
        /// Destructor, releases playlist data
        ~sprite_definition();
 
-       /// Register a class to this definition.
-       //
-       /// New instances of this symbol will get the given class
-       /// interface.
-       ///
-       /// @param the_class
-       ///     The class constructor to associate with
-       ///     new instances of this DisplayObject. If NULL
-       ///     new instances will get the MovieClip interface.
-       ///
-       void registerClass(as_function* the_class);
-
-       /// Get the Class registered to this definition.
-       as_function* getRegisteredClass() const {
-               return registeredClass;
-       }
-
     virtual void incrementLoadedFrames() {
         ++m_loading_frame;
     }
@@ -295,22 +278,8 @@ private:
                return true;
        }
 
-       /// The constructor to use for setting up the interface
-       /// for new instances of this sprite
-       //
-    /// TODO: this really shouldn't be stored in an immutable definition.
-       as_function* registeredClass;
-
        int     _loadingSoundStream;
 
-protected:
-
-       /// Mark reachable resources of a sprite_definition
-       //
-       /// Reachable resources are:
-       ///     - registered class (registeredClass)
-       ///
-       void markReachableResources() const;
 };
 
 

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

Summary of changes:
 libcore/MovieClip.cpp                |    9 +++------
 libcore/TextField.cpp                |    3 ---
 libcore/asobj/Array_as.cpp           |    2 +-
 libcore/asobj/Object.cpp             |   19 ++++++++++---------
 libcore/movie_root.cpp               |   18 ++++++++++++++++--
 libcore/movie_root.h                 |    8 +++++++-
 libcore/parser/sprite_definition.cpp |   13 -------------
 libcore/parser/sprite_definition.h   |   31 -------------------------------
 8 files changed, 37 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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