gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/execute_tag.h server/spr...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/execute_tag.h server/spr...
Date: Sat, 12 May 2007 06:50:37 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/12 06:50:37

Modified files:
        .              : ChangeLog 
        server         : execute_tag.h sprite_instance.cpp 
                         sprite_instance.h 
        server/swf     : PlaceObject2Tag.cpp PlaceObject2Tag.h 
                         tag_loaders.cpp 
        testsuite/misc-ming.all: loop_test-Runner.cpp 

Log message:
        CLEANUPS!
        
                * server/execute_tag.h, server/swf/PlaceObject2Tag.{cpp,h},
                  server/swf/tag_loaders.cpp: Drop 
execute_tag::execute_state_reverse()
                  and execute_tag::get_depth_id_of_replace_or_add_tag) methods.
                * server/sprite_instance.{cpp,h}: (advance_sprite, 
execute_frame_tags):
                  call resetDisplayList in advance_sprite rather then delegate 
to
                  execute_frame_tags, to avoid an invocation during
                  restoreDisplayList(). (restoreDisplayList): fix comment for
                  step1, remove commented out code. Drop the 
m_is_reverse_execution
                  flag and associated getter. Drop execute_frame_tags_reverse() 
method.
                  Drop find_previous_replace_or_add_tag method. (goto_frame) 
Move
                  UdoG comment where it belonge [old design block], add comment 
about
                  possible problem with clearing the action queue after 
displaylist
                  restoration.
                * testsuite/misc-ming.all/loop_test-Runner.cpp: Don't set action
                  verbosity.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3169&r2=1.3170
http://cvs.savannah.gnu.org/viewcvs/gnash/server/execute_tag.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.270&r2=1.271
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.109&r2=1.110
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test-Runner.cpp?cvsroot=gnash&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3169
retrieving revision 1.3170
diff -u -b -r1.3169 -r1.3170
--- ChangeLog   11 May 2007 17:53:29 -0000      1.3169
+++ ChangeLog   12 May 2007 06:50:36 -0000      1.3170
@@ -1,3 +1,21 @@
+2007-05-12 Sandro Santilli <address@hidden>
+
+       * server/execute_tag.h, server/swf/PlaceObject2Tag.{cpp,h},
+         server/swf/tag_loaders.cpp: Drop execute_tag::execute_state_reverse()
+         and execute_tag::get_depth_id_of_replace_or_add_tag) methods.
+       * server/sprite_instance.{cpp,h}: (advance_sprite, execute_frame_tags):
+         call resetDisplayList in advance_sprite rather then delegate to
+         execute_frame_tags, to avoid an invocation during
+         restoreDisplayList(). (restoreDisplayList): fix comment for
+         step1, remove commented out code. Drop the m_is_reverse_execution
+         flag and associated getter. Drop execute_frame_tags_reverse() method.
+         Drop find_previous_replace_or_add_tag method. (goto_frame) Move
+         UdoG comment where it belonge [old design block], add comment about
+         possible problem with clearing the action queue after displaylist 
+         restoration.
+       * testsuite/misc-ming.all/loop_test-Runner.cpp: Don't set action
+         verbosity.
+
 2007-05-11 Sandro Santilli <address@hidden>
 
        * server/dlist.{cpp,h}: Add another DisplayList mass-removal

Index: server/execute_tag.h
===================================================================
RCS file: /sources/gnash/gnash/server/execute_tag.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/execute_tag.h        11 Apr 2007 17:54:21 -0000      1.11
+++ server/execute_tag.h        12 May 2007 06:50:37 -0000      1.12
@@ -66,36 +66,12 @@
                if ( is_action_tag() ) execute(m);
        }
 
-       /// Execute the reverse version of this (state) tag.
-       //
-       /// Reverse execution is only meaningful for state tegs.
-       ///
-       /// @param m
-       ///
-       /// @param frame
-       ///
-       virtual void execute_state_reverse(sprite_instance* m, int /*frame*/)
-       {
-               // is the 'frame' arg is really needed ?
-               execute_state(m);
-       }
-
        /// Return true if this is a RemoveObject tag
        virtual bool    is_remove_tag() const { return false; }
 
        /// Return true if this is an action tag.
        virtual bool    is_action_tag() const { return false; }
 
-       /// \brief
-       /// Return 16-bit depth and id of character packed into one 32-bit int
-       /// IFF this is a replace or add tag, otherwise return 0.
-       //
-       /// The default implementation returns 0
-       ///
-       virtual uint32_t        get_depth_id_of_replace_or_add_tag() const
-       {
-               return 0;
-       }
 };
 
 

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -b -r1.270 -r1.271
--- server/sprite_instance.cpp  11 May 2007 17:53:29 -0000      1.270
+++ server/sprite_instance.cpp  12 May 2007 06:50:37 -0000      1.271
@@ -2445,6 +2445,14 @@
                // First time execute_frame_tags(0) executed in 
dlist.cpp(child) or movie_def_impl(root)
                if (m_current_frame != (size_t)prev_frame)
                {
+                       if ( m_current_frame == 0 && has_looped() )
+                       {
+                               // TODO: check why this would be any different
+                               //       then calling restoreDisplayList(0) 
instead..
+                               //       Ah! I think I know..
+                               resetDisplayList();
+                       }
+
                        // TODO: Make sure m_current_frame is 0-based during 
execution of DLIST tags
                        execute_frame_tags(m_current_frame, 
TAG_DLIST|TAG_ACTION);
                }
@@ -2563,6 +2571,10 @@
 void
 sprite_instance::resetDisplayList()
 {
+       // TODO: see if/how this can be merged with restoreDisplayList !
+
+       assert(m_current_frame == 0);
+
        // Add script objects in current DisplayList
        std::vector<character*> charsToAdd; 
        std::vector<character*> charsToKeep; 
@@ -2601,9 +2613,10 @@
        //       for jump-forwards would do
        assert(tgtFrame <= m_current_frame);
 
-       // 1. Remove from current DisplayList any timeline instance constructed
-       //    after target frame and still found at the same depth it had at
-       //    time of placement.
+       // 1. Remove from current DisplayList:
+       //      - Timeline instances constructed after target frame are always 
removed.
+       //      - Timeline instances constructed before or at the target frame 
but no more at the original depth are removed.
+       //      - Dynamic instances found in the static depth zone 
        
        TimelineInstanceFinder finder(tgtFrame);
 #ifdef GNASH_DEBUG_TIMELINE
@@ -2634,9 +2647,6 @@
 
        // 2. Execute all displaylist tags from first to target frame 
 
-       // we're going to change this during frame tags execution
-       //size_t currentFrameBackup = m_current_frame;
-
        for (size_t f = 0; f<=tgtFrame; ++f)
        {
                //
@@ -2648,11 +2658,6 @@
                execute_frame_tags(f, TAG_DLIST);
        }
 
-       // Set current frame back to the backed-up value
-       // TODO: this is likely NOT needed, just documenting that we're going
-       //       to modify m_current_frame could be enough (would be the 
caller's
-       //       responsibility to do what they think is needed).
-       //m_current_frame = currentFrameBackup;
 }
 
 // 0-based frame number !
@@ -2663,14 +2668,6 @@
 
        assert(frame < m_def->get_frame_count());
 
-       m_is_reverse_execution = false;
-
-       if ( frame == 0 && has_looped() )
-       {
-               resetDisplayList();
-
-       }
-
        // Execute this frame's init actions, if necessary.
        if (m_init_actions_executed[frame] == false)
        {
@@ -2721,6 +2718,8 @@
                if ( typeflags & TAG_ACTION ) tag->execute_action(this);
        }
 
+       // TODO: do _frame0_chars still make sense ?
+       //       Should we use the same algorithm in restoreDisplayList instead 
?
        if ( frame == 0 && ! has_looped() )
        {
                // Save DisplayList state
@@ -2730,25 +2729,6 @@
        testInvariant();
 }
 
-void sprite_instance::execute_frame_tags_reverse(size_t frame)
-{
-       testInvariant();
-
-       assert(frame < m_def->get_frame_count());
-
-       m_is_reverse_execution = true;
-
-       const PlayList& playlist = m_def->get_playlist(frame);
-
-       for (unsigned int i=0, n=playlist.size(); i<n; ++i)
-       {
-           execute_tag*        e = playlist[i];
-           e->execute_state_reverse(this, frame);
-       }
-
-       testInvariant();
-}
-
 void sprite_instance::execute_remove_tags(int frame)
 {
            assert(frame >= 0);
@@ -2765,28 +2745,6 @@
                }
 }
 
-execute_tag*
-sprite_instance::find_previous_replace_or_add_tag(int frame,
-               int depth, int id)
-{
-       uint32_t depth_id = ((depth & 0x0FFFF) << 16) | (id & 0x0FFFF);
-
-       for (int f = frame - 1; f >= 0; f--)
-       {
-           const PlayList& playlist = m_def->get_playlist(f);
-           for (int i = playlist.size() - 1; i >= 0; i--)
-               {
-                   execute_tag*        e = playlist[i];
-                   if (e->get_depth_id_of_replace_or_add_tag() == depth_id)
-                       {
-                           return e;
-                       }
-               }
-       }
-
-    return NULL;
-}
-
 void
 sprite_instance::goto_frame(size_t target_frame_number)
 {
@@ -2853,7 +2811,17 @@
        // Construct the DisplayList of the target frame
        //
        
-  // TODO:
+       if (target_frame_number < m_current_frame)
+       // Go backward to a previous frame
+       {
+#ifdef NEW_TIMELINE_DESIGN // new design
+               // restoreDisplayList takes care of properly setting the 
m_current_frame variable
+               restoreDisplayList(target_frame_number);
+               assert(m_current_frame == target_frame_number);
+#else // old design
+
+               set_invalidated();
+
   // <UdoG> current design is sub-optimal because it causes unnecessary 
   // redraw. Consider a static graphic that stays at it's position all
   // the time. When looping betwen two frames 
@@ -2864,15 +2832,6 @@
   // redraw of the whole sprite even if it doesn't change visually
   // at all.
 
-       if (target_frame_number < m_current_frame)
-       // Go backward to a previous frame
-       {
-#ifdef NEW_TIMELINE_DESIGN // new design
-               // restoreDisplayList takes care of properly setting the 
m_current_frame variable
-               restoreDisplayList(target_frame_number);
-               assert(m_current_frame == target_frame_number);
-#else // old design
-               set_invalidated();
 
                resetDisplayList();
                for (size_t f = 0; f<=target_frame_number; f++)
@@ -2928,6 +2887,8 @@
 
        // m_action_list contains actions from frame 'target_frame_number'
        // to frame 'm_current_frame', too much than needed, clear it first.
+       // TODO: check this, we didn't execute TAG_ACTION tags...
+       //       Can it be we're cleaning up too many actions here ?
        m_action_list.clear();
 
        // Get the actions of target frame.(We don't have a direct way to

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- server/sprite_instance.h    11 May 2007 17:53:29 -0000      1.109
+++ server/sprite_instance.h    12 May 2007 06:50:37 -0000      1.110
@@ -252,25 +252,6 @@
        virtual void    advance_sprite(float delta_time);
 
 
-       /// Execute the tags associated with the specified frame,
-       /// IN REVERSE.
-       /// I.e. if it's an "add" tag, then we do a "remove" instead.
-       /// Only relevant to the display-list manipulation tags:
-       /// add, move, remove, replace.
-       ///
-       /// frame is 0-based
-       void execute_frame_tags_reverse(size_t frame);
-
-       // return true is sprite is revserse executing frame tags
-       bool is_reverse_execution() const
-       {
-               return  m_is_reverse_execution;
-       }
-
-       execute_tag* find_previous_replace_or_add_tag(int frame,
-               int depth, int id);
-
-
        /// Execute any remove-object tags associated with
        /// the specified frame.
        /// frame is 0-based
@@ -905,9 +886,6 @@
        // true if this sprite reached the last frame and restarted
        bool            m_has_looped;
 
-       // true if reverse executing frame tags
-       bool            m_is_reverse_execution;
-
        // a bit-array class would be ideal for this
        std::vector<bool>       m_init_actions_executed;
 
@@ -968,10 +946,10 @@
        /// Execution of 1st frame tags is specially handled:
        ///
        /// - After executing them for the first time
-       ///   the DisplayList state is saved.
-       ///
-       /// - Before subsequent executions (loop mode)
-       ///   the DisplayList is restored from saved state.
+       ///   the DisplayList state is saved into the _frame0_chars
+       ///   member, which is used by resetDisplayList() on loop-back
+       ///   TODO: drop this _frame0_chars thing ? See comments in
+       ///   resetDisplayList()
        ///
        /// @param frame
        ///     Frame number. 0-based

Index: server/swf/PlaceObject2Tag.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/swf/PlaceObject2Tag.cpp      28 Apr 2007 04:54:42 -0000      1.7
+++ server/swf/PlaceObject2Tag.cpp      12 May 2007 06:50:37 -0000      1.8
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: PlaceObject2Tag.cpp,v 1.7 2007/04/28 04:54:42 strk Exp $ */
+/* $Id: PlaceObject2Tag.cpp,v 1.8 2007/05/12 06:50:37 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -307,7 +307,7 @@
              m_name,
              m_event_handlers,
              m_depth,
-             m->is_reverse_execution(),        // place_object doesn't do 
replacement when not in reverse execution
+             false, // don't replace characters at target depth (TODO: check 
if a general rule!)
              m_color_transform,
              m_matrix,
              m_ratio,
@@ -350,61 +350,6 @@
        }
 }
 
-void
-PlaceObject2Tag::execute_state_reverse(sprite_instance* m, int frame)
-{
-    switch (m_place_type) {
-      case PLACE:
-         // reverse of add is remove
-         m->remove_display_object(m_depth, m_tag_type == 4 ? m_character_id : 
-1);
-         break;
-
-      case MOVE:
-         // reverse of move is move
-         m->move_display_object(
-             m_depth,
-             m_has_cxform,
-             m_color_transform,
-             m_has_matrix,
-             m_matrix,
-             m_ratio,
-             m_clip_depth);
-         break;
-
-      case REPLACE:
-      {
-         // reverse of replace is to re-add the previous object.
-         execute_tag*  last_add = m->find_previous_replace_or_add_tag(frame, 
m_depth, -1);
-         if (last_add) {
-             last_add->execute_state(m);
-         } else {
-             log_error(_("reverse REPLACE can't find previous replace or add 
tag(%d, %d)"),
-                       frame, m_depth);
-
-         }
-         break;
-      }
-    }
-}
-
-uint32_t
-PlaceObject2Tag::get_depth_id_of_replace_or_add_tag() const
-{
-       uint32_t depthid = 0;
-       if (m_place_type == PLACE || m_place_type == REPLACE)
-       {
-               int id = -1;
-               if (m_tag_type == SWF::PLACEOBJECT)
-               {
-                   // Old-style PlaceObject; the corresponding Remove
-                   // is specific to the character_id.
-                   id = m_character_id;
-               }
-               depthid = ((m_depth & 0x0FFFF) << 16) | (id & 0x0FFFF);
-       }
-       return depthid;
-}
-
 } // namespace gnash::SWF::tag_loaders
 } // namespace gnash::SWF
 } // namespace gnash

Index: server/swf/PlaceObject2Tag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/swf/PlaceObject2Tag.h        24 Apr 2007 06:54:06 -0000      1.3
+++ server/swf/PlaceObject2Tag.h        12 May 2007 06:50:37 -0000      1.4
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: PlaceObject2Tag.h,v 1.3 2007/04/24 06:54:06 zoulunkai Exp $ */
+/* $Id: PlaceObject2Tag.h,v 1.4 2007/05/12 06:50:37 strk Exp $ */
 
 #ifndef GNASH_SWF_PLACEOBJECT2TAG_H
 #define GNASH_SWF_PLACEOBJECT2TAG_H
@@ -121,9 +121,6 @@
        // read SWF::PLACEOBJECT2
        void readPlaceObject2(stream* in, int movie_version);
 
-       void execute_state_reverse(sprite_instance* m, int frame);
-    
-       uint32_t        get_depth_id_of_replace_or_add_tag() const;
 };
 
 } // namespace gnash::SWF::tag_loaders

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- server/swf/tag_loaders.cpp  2 May 2007 18:19:02 -0000       1.96
+++ server/swf/tag_loaders.cpp  12 May 2007 06:50:37 -0000      1.97
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: tag_loaders.cpp,v 1.96 2007/05/02 18:19:02 martinwguy Exp $ */
+/* $Id: tag_loaders.cpp,v 1.97 2007/05/12 06:50:37 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -846,22 +846,6 @@
            execute(m);
        }
 
-    virtual void       execute_state_reverse(sprite_instance* m, int frame)
-       {
-           // reverse of remove is to re-add the previous object.
-           execute_tag*        last_add = 
m->find_previous_replace_or_add_tag(frame, m_depth, m_id);
-           if (last_add)
-               {
-                   last_add->execute_state(m);
-               }
-           else
-               {
-                   log_error(_("reverse REMOVE can't find previous replace or 
add tag(%d, %d)"),
-                             frame, m_depth);
-
-               }
-       }
-
     virtual bool       is_remove_tag() const { return true; }
 };
 

Index: testsuite/misc-ming.all/loop_test-Runner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loop_test-Runner.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- testsuite/misc-ming.all/loop_test-Runner.cpp        6 Apr 2007 11:43:44 
-0000       1.4
+++ testsuite/misc-ming.all/loop_test-Runner.cpp        12 May 2007 06:50:37 
-0000      1.5
@@ -61,7 +61,7 @@
 
        gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
        dbglogfile.setVerbosity(1);
-       dbglogfile.setActionDump(1);
+       //dbglogfile.setActionDump(1);
 
        sprite_instance* root = tester.getRootMovie();
        assert(root);




reply via email to

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