gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, fast, created. release_0_8_9_final-23


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, fast, created. release_0_8_9_final-230-gec49d01
Date: Sat, 09 Apr 2011 19:38:30 +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, fast has been created
        at  ec49d018f510cce27cfbe39cebc5bd74750db181 (commit)

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


commit ec49d018f510cce27cfbe39cebc5bd74750db181
Author: Sandro Santilli <address@hidden>
Date:   Sat Apr 9 21:37:27 2011 +0200

    Do not invalidate MovieClip on timeline rewind unless DisplayList really 
changes. Takes CPU use down in many cases (seen it from 100% to 8%)

diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index 9936f97..8a7aa9f 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -729,7 +729,7 @@ DisplayList::add_invalidated_bounds(InvalidatedRanges& 
ranges, bool force)
 }
 
 void
-DisplayList::mergeDisplayList(DisplayList& newList)
+DisplayList::mergeDisplayList(DisplayList& newList, DisplayObject& o)
 {
     testInvariant();
 
@@ -760,6 +760,7 @@ DisplayList::mergeDisplayList(DisplayList& newList)
                 ++itOld;
                 // unload the DisplayObject if it's in static zone(-16384,0)
                 if (depthOld < 0) {
+                    o.set_invalidated();
                     _charsByDepth.erase(itOldBackup);
 
                      if (chOld->unload()) reinsertRemovedCharacter(chOld);
@@ -781,6 +782,7 @@ DisplayList::mergeDisplayList(DisplayList& newList)
                         !isReferenceable(*chOld)) {
                     // replace the DisplayObject in old list with
                     // corresponding DisplayObject in new list
+                    o.set_invalidated();
                     _charsByDepth.insert(itOldBackup, *itNewBackup);
                     _charsByDepth.erase(itOldBackup);
                     
@@ -807,6 +809,7 @@ DisplayList::mergeDisplayList(DisplayList& newList)
             // depth in old list is empty, but occupied in new list.
             ++itNew;
             // add the new DisplayObject to the old list.
+            o.set_invalidated();
             _charsByDepth.insert(itOldBackup, *itNewBackup);
         }
 
@@ -820,6 +823,7 @@ DisplayList::mergeDisplayList(DisplayList& newList)
     while ((itOld != itOldEnd) && ((*itOld)->get_depth() < 0)) {
 
         DisplayObject* chOld = *itOld;
+        o.set_invalidated();
         itOld = _charsByDepth.erase(itOld);
 
         if (chOld->unload()) reinsertRemovedCharacter(chOld);
@@ -829,7 +833,10 @@ DisplayList::mergeDisplayList(DisplayList& newList)
     // step3(only required if scanning of old list finished earlier in step1).
     // continue to scan the new list.
     // add remaining DisplayObjects directly.
-    if (itNew != itNewEnd) _charsByDepth.insert(itOld, itNew, itNewEnd);
+    if (itNew != itNewEnd) {
+        o.set_invalidated();
+        _charsByDepth.insert(itOld, itNew, itNewEnd);
+    }
 
     // step4.
     // Copy all unloaded DisplayObjects from the new display list to the
@@ -844,6 +851,7 @@ DisplayList::mergeDisplayList(DisplayList& newList)
                 std::find_if(_charsByDepth.begin(), _charsByDepth.end(),
                     boost::bind(std::not2(DepthLessThan()), _1, depthNew));
             
+            o.set_invalidated();
             _charsByDepth.insert(it, *itNew);
         }
     }
diff --git a/libcore/DisplayList.h b/libcore/DisplayList.h
index 7a36cfe..9b2cb73 100644
--- a/libcore/DisplayList.h
+++ b/libcore/DisplayList.h
@@ -287,9 +287,11 @@ public:
        ///
        int getNextHighestDepth() const;
        
-       /// \brief
-       /// merge the given display list
-       void mergeDisplayList(DisplayList& newList);
+       /// Merge the given display list
+    //
+    /// Call set_invalidated on the given DisplayObject if this list changes
+    ///
+       void mergeDisplayList(DisplayList& newList, DisplayObject& o);
 
        bool operator==(const DisplayList& other) const {
         return _charsByDepth == other._charsByDepth;
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index fe047e0..8c80811 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -936,11 +936,6 @@ MovieClip::restoreDisplayList(size_t tgtFrame)
     //             for jump-forwards would do
     assert(tgtFrame <= _currentFrame);
 
-    // Just invalidate this DisplayObject before jumping back.
-    // Should be optimized, but the invalidating model is not clear enough,
-    // and there are some old questions spreading the source files.
-    set_invalidated();
-
     DisplayList tmplist;
     for (size_t f = 0; f < tgtFrame; ++f) {
         _currentFrame = f;
@@ -952,7 +947,7 @@ MovieClip::restoreDisplayList(size_t tgtFrame)
     executeFrameTags(tgtFrame, tmplist, SWF::ControlTag::TAG_DLIST |
                                         SWF::ControlTag::TAG_ACTION);
 
-    _displayList.mergeDisplayList(tmplist);
+    _displayList.mergeDisplayList(tmplist, *this);
 }
 
 // 0-based frame number !

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


hooks/post-receive
-- 
Gnash



reply via email to

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