gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h...
Date: Fri, 07 Sep 2007 14:49:11 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/07 14:49:11

Modified files:
        .              : ChangeLog 
        server         : dlist.cpp dlist.h sprite_instance.cpp 

Log message:
                * server/dlist.{cpp,h}: change signature of .reset() to
                  take a sprite_instance for calling set_invalidated() when
                  needed.
                * server/sprite_instance.cpp (restoreDisplayList): update
                  call to DisplayList::reset() - this optimizes loop-backs
                  and fixes a failure introduced by previous commit
                  (it's nice to see that performance issues are also tested
                  by our testsuite - we'd just need some more)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4251&r2=1.4252
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.89&r2=1.90
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.333&r2=1.334

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4251
retrieving revision 1.4252
diff -u -b -r1.4251 -r1.4252
--- ChangeLog   7 Sep 2007 13:57:46 -0000       1.4251
+++ ChangeLog   7 Sep 2007 14:49:10 -0000       1.4252
@@ -1,5 +1,16 @@
 2007-09-07 Sandro Santilli <address@hidden>
 
+       * server/dlist.{cpp,h}: change signature of .reset() to
+         take a sprite_instance for calling set_invalidated() when
+         needed.
+       * server/sprite_instance.cpp (restoreDisplayList): update
+         call to DisplayList::reset() - this optimizes loop-backs
+         and fixes a failure introduced by previous commit
+         (it's nice to see that performance issues are also tested
+         by our testsuite - we'd just need some more)
+
+2007-09-07 Sandro Santilli <address@hidden>
+
        * server/sprite_instance.cpp (restoreDisplayList): don't use
          a copy of the display_list to optimize the call to set_invalidated.
          Removing characters from the copy would shift unloaded characters

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- server/dlist.cpp    7 Sep 2007 11:56:06 -0000       1.89
+++ server/dlist.cpp    7 Sep 2007 14:49:10 -0000       1.90
@@ -572,10 +572,12 @@
 
 }
        
-void DisplayList::reset(movie_definition& movieDef, size_t tgtFrame, bool 
call_unload)
+void DisplayList::reset(movie_definition& movieDef, size_t tgtFrame, 
sprite_instance& owner)
 {
        testInvariant();
 
+       bool call_unload = true;
+
        //GNASH_REPORT_FUNCTION;
 
        // 1. Find all "timeline depth" for the target frame, querying the
@@ -627,16 +629,16 @@
                //if ( di->isDynamic() )
                if ( ! info )
                {
+                       // Call set_invalidated before changing the DisplayList
+                       owner.set_invalidated();
+
                        // Replace (before calling unload)
                        it = _charsByDepth.erase(it);
 
-                       if ( call_unload )
-                       {
                                if ( di->unload() )
                                {
                                        toReinsert.push_back(di);
                                }
-                       }
 
                        continue;
                }
@@ -646,6 +648,9 @@
                // we need to do this in some corner cases. 
                if(!di->isActionScriptReferenceable())
                {
+                       // Call set_invalidated before changing the DisplayList
+                       owner.set_invalidated();
+
                        // TODO: no unload() call needed here ? would help GC ?
                        // (I guess there can't be any as_value pointing at this
                        // if it's not ActionScriptReferenceable after all...)
@@ -660,16 +665,16 @@
                {
                        // Not to be saved, killing
 
+                       // Call set_invalidated before changing the DisplayList
+                       owner.set_invalidated();
+
                        // Replace (before calling unload)
                        it = _charsByDepth.erase(it);
 
-                       if ( call_unload )
-                       {
                                if ( di->unload() )
                                {
                                        toReinsert.push_back(di);
                                }
-                       }
 
                        continue;
                }
@@ -685,8 +690,6 @@
                ++it;
        }
 
-       testInvariant();
-
        std::for_each(toReinsert.begin(), toReinsert.end(),
                boost::bind(&DisplayList::reinsertRemovedCharacter, this, _1));
 

Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/dlist.h      5 Sep 2007 15:48:08 -0000       1.50
+++ server/dlist.h      7 Sep 2007 14:49:10 -0000       1.51
@@ -296,11 +296,11 @@
        /// @param targetFrame
        ///     0-based frame number we are jumping back to.
        ///
-       /// @param call_unload
-       ///     If true, UNLOAD event will be invoked on the characters being
-       ///     removed. 
+       /// @param owner
+       ///     The owner of this DisplayList, for calling set_invalidated() on 
it before
+       ///     making any modification to the list.
        ///
-       void reset(movie_definition& movieDef, size_t targetFrame, bool 
call_unload);
+       void reset(movie_definition& movieDef, size_t targetFrame, 
sprite_instance& owner);
 
        /// Just an alias for clear()
        void reset() {

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -b -r1.333 -r1.334
--- server/sprite_instance.cpp  7 Sep 2007 13:57:47 -0000       1.333
+++ server/sprite_instance.cpp  7 Sep 2007 14:49:11 -0000       1.334
@@ -2387,9 +2387,8 @@
        //      2.2 Remove all current timeline instances at a depth NOT in the 
set found in step 1 
        //  2.3 Remove all non-script-referencable instances, suboptimal!
 
-       // TODO: try to optize by avoid calling set_invalidated
-       set_invalidated();
-       m_display_list.reset(*m_def, tgtFrame, true);
+       // NOTE: reset() will call our set_invalidated() before making any 
change
+       m_display_list.reset(*m_def, tgtFrame, *this);
 
        // 3. Execute all displaylist tags from first to target frame, with
        //    target frame tag execution including ACTION tags




reply via email to

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