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: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h...
Date: Thu, 15 May 2008 06:59:01 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  08/05/15 06:59:01

Modified files:
        .              : ChangeLog 
        server         : dlist.cpp dlist.h 
        testsuite/misc-ming.all: loop_test-Runner.cpp 

Log message:
        * server/dlist.{h,cpp}: mergeDisplayList(), don't forget to merge 
characters
          placed in dynamic zone. fix bug #23248.
        * testsuite/misc-ming.all/loop_test-Runner.cpp: minor fix, the test swf 
was
          updated yestoday.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6600&r2=1.6601
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.124&r2=1.125
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test-Runner.cpp?cvsroot=gnash&r1=1.13&r2=1.14

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6600
retrieving revision 1.6601
diff -u -b -r1.6600 -r1.6601
--- ChangeLog   14 May 2008 20:36:57 -0000      1.6600
+++ ChangeLog   15 May 2008 06:58:58 -0000      1.6601
@@ -1,3 +1,10 @@
+2008-05-15 Zou Lunkai <address@hidden>
+       
+       * server/dlist.{h,cpp}: mergeDisplayList(), don't forget to merge 
characters
+         placed in dynamic zone. fix bug #23248.
+       * testsuite/misc-ming.all/loop_test-Runner.cpp: minor fix, the test swf 
was
+         updated yestoday.
+       
 2008-05-14 Benjamin Wolsey <address@hidden>
 
        * server/character.cpp: rint isn't a standard function, and isn't

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- server/dlist.cpp    14 May 2008 10:47:27 -0000      1.124
+++ server/dlist.cpp    15 May 2008 06:59:00 -0000      1.125
@@ -910,9 +910,12 @@
     iterator itOld = beginNonRemoved(_charsByDepth);
     iterator itNew = beginNonRemoved(newList._charsByDepth);
 
-    iterator itOldEnd = staticZoneEnd(_charsByDepth);
-    iterator itNewEnd = staticZoneEnd(newList._charsByDepth); 
+    iterator itOldEnd = dlistTagsEffectivZoneEnd(_charsByDepth);
+    iterator itNewEnd = newList._charsByDepth.end(); 
+    assert(itNewEnd == dlistTagsEffectivZoneEnd(newList._charsByDepth) );
 
+    // step1. 
+    // starting scanning both lists.
     while( itOld != itOldEnd )
     {
         iterator itOldBackup = itOld;
@@ -927,11 +930,13 @@
             boost::intrusive_ptr<character> chNew = itNewBackup->get();
             int depthNew = chNew->get_depth();
             
-            // unload the old character if it is not in the new list
+            // depth in old list is occupied, and empty in new list.
             if( depthOld < depthNew )
             {
                 itOld++;
-
+                // unload the character if it's in static zone(-16384,0)
+                if( depthOld < 0)
+                {
                 _charsByDepth.erase(itOldBackup);
 
                 if ( chOld->unload() )
@@ -942,10 +947,11 @@
                 {
                     chOld->destroy();
                 }
+                }
 
                 break;
             }
-            // if depth is occupied in both lists
+            // depth is occupied in both lists
             else if( depthOld == depthNew )
             {
                 itOld++;
@@ -985,23 +991,26 @@
 
                 break;
             }
-            // add the character in new list if it is not in the old list
+            // depth in old list is empty, but occupied in new list.
             else 
             {
                 itNew++;
-
+                // add the new character to the old list.
                 _charsByDepth.insert(itOldBackup, *itNewBackup );
             }
         }// end of while
 
+        // break if finish scanning the new list
         if( itNew == itNewEnd )
         {
             break;
         }
     }// end of while
     
-    // unload remaining characters in old list
-    while( itOld != itOldEnd )
+    // step2(only required if scanning of new list finished earlier in step1).
+    // continue to scan the static zone of the old list.
+    // unload remaining characters directly.
+    while( (itOld != itOldEnd) && ((*itOld)->get_depth() < 0) )
     {
         boost::intrusive_ptr<character> chOld = itOld->get();
 
@@ -1017,12 +1026,15 @@
         }
     }
 
-    // add remaining characters in new list to the old list
+    // step3(only required if scanning of old list finished earlier in step1).
+    // continue to scan the new list.
+    // add remaining characters directly.
     if( itNew != itNewEnd )
     {
         _charsByDepth.insert(itOld, itNew, itNewEnd);
     }
 
+    // step4.
     // Copy all unloaded characters from the new display list to the old 
display list, 
     // and clear the new display list
     for (itNew = newList._charsByDepth.begin(); itNew != itNewEnd; ++itNew)
@@ -1127,16 +1139,18 @@
 
 /*private static*/
 DisplayList::iterator
-DisplayList::staticZoneEnd(container_type& c)
+DisplayList::dlistTagsEffectivZoneEnd(container_type& c)
 {
-    return std::find_if(c.begin(), c.end(), DepthGreaterOrEqual(0));
+    return std::find_if(c.begin(), c.end(), 
+               DepthGreaterOrEqual(0xffff + character::staticDepthOffset));
 }
 
 /*private static*/
 DisplayList::const_iterator
-DisplayList::staticZoneEnd(const container_type& c)
+DisplayList::dlistTagsEffectivZoneEnd(const container_type& c)
 {
-    return std::find_if(c.begin(), c.end(), DepthGreaterOrEqual(0));
+    return std::find_if(c.begin(), c.end(), 
+               DepthGreaterOrEqual(0xffff + character::staticDepthOffset));
 }
 
 void

Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- server/dlist.h      5 May 2008 18:50:06 -0000       1.71
+++ server/dlist.h      15 May 2008 06:59:00 -0000      1.72
@@ -380,11 +380,11 @@
        /// Return an constant iterator to the first element of the container 
NOT in the "removed" depth zone
        static const_iterator beginNonRemoved(const container_type& c);
 
-       /// Return an iterator succeeding the last element in the static zone
-       static iterator staticZoneEnd(container_type& c);
+       /// Return an iterator succeeding the last element in zone (-16384, 
0xffff-16384)
+       static iterator dlistTagsEffectivZoneEnd(container_type& c);
        
-       /// Return an constant iterator succeeding the last element in the 
static zone
-       static const_iterator staticZoneEnd(const container_type& c);
+       /// Return an constant iterator succeeding the last element in (-16384, 
0xffff-16384)
+       static const_iterator dlistTagsEffectivZoneEnd(const container_type& c);
 
 
        /// Re-insert a removed-from-stage character after appropriately

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.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- testsuite/misc-ming.all/loop_test-Runner.cpp        21 Jan 2008 23:26:51 
-0000      1.13
+++ testsuite/misc-ming.all/loop_test-Runner.cpp        15 May 2008 06:59:00 
-0000      1.14
@@ -75,7 +75,7 @@
        rgba white(255,255,255,255);
 
        // Advance till the movie is stopped (or 10 loops are performed)
-       bool blackOverRed=true;
+       bool blackOverRed=false;
        for (size_t i=0; i<=framecount*10; ++i)
        {
                check_equals(root->get_current_frame(), i%framecount);




reply via email to

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