gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.cpp server/cha...


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
Date: Thu, 03 Apr 2008 14:24:03 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   08/04/03 14:24:02

Modified files:
        .              : ChangeLog 
        server         : character.cpp character.h dlist.cpp dlist.h 
                         movie_root.cpp movie_root.h sprite_instance.cpp 
                         sprite_instance.h 
        gui            : gui.cpp 

Log message:
        * server/dlist.cpp: clear invalidated flag when skipping display() call;
          fixes the invalidation bug for the Ubuntu animation
        * gui/gui.cpp: added debugging code (not compiled in by default)
        * server/character.{cpp,h}, server/dlist.{cpp,h}, 
server/movie_root.{cpp,h},
          server/sprite_instance.{cpp,h}: added debugging function to dump the  
          chracter instances tree (simplifies inv. bounds debugging)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6170&r2=1.6171
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.84&r2=1.85
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.133&r2=1.134
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.172&r2=1.173
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.495&r2=1.496
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.175&r2=1.176
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.143&r2=1.144

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.6170
retrieving revision 1.6171
diff -u -b -r1.6170 -r1.6171
--- ChangeLog   3 Apr 2008 10:54:31 -0000       1.6170
+++ ChangeLog   3 Apr 2008 14:24:00 -0000       1.6171
@@ -1,3 +1,12 @@
+2008-04-03 Udo Giacomozzi <address@hidden>
+
+       * server/dlist.cpp: clear invalidated flag when skipping display() call;
+         fixes the invalidation bug for the Ubuntu animation
+       * gui/gui.cpp: added debugging code (not compiled in by default)
+       * server/character.{cpp,h}, server/dlist.{cpp,h}, 
server/movie_root.{cpp,h},
+         server/sprite_instance.{cpp,h}: added debugging function to dump the  
+         chracter instances tree (simplifies inv. bounds debugging)
+
 2008-04-03 Benjamin Wolsey <address@hidden>
 
        * testsuite/actionscript.all/Date.as: these are the results on 

Index: server/character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/character.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- server/character.cpp        20 Mar 2008 12:31:53 -0000      1.84
+++ server/character.cpp        3 Apr 2008 14:24:01 -0000       1.85
@@ -199,6 +199,13 @@
 }
 
 void
+character::dump_character_tree(const std::string prefix) const
+{
+  log_debug("%s%s<%p> I=%d,CI=%d", prefix, typeName(*this).c_str(), this,
+    m_invalidated, m_child_invalidated);  
+}
+
+void
 character::extend_invalidated_bounds(const InvalidatedRanges& ranges)
 {
        set_invalidated(__FILE__, __LINE__);

Index: server/character.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/character.h,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -b -r1.133 -r1.134
--- server/character.h  20 Mar 2008 12:31:54 -0000      1.133
+++ server/character.h  3 Apr 2008 14:24:01 -0000       1.134
@@ -1023,13 +1023,24 @@
   void set_child_invalidated();
   
        /// Clear invalidated flag and reset m_old_invalidated_bounds to null.
+  ///
+  /// It is very important that each character with any m_XXXX_invalidated flag
+  /// set calls clear_invalidated() during the rendering of one frame. 
+  /// Basically this means each call to display() must match a call to 
+  /// clear_invalidated. This includes no-op display() calls, i.e. when the
+  /// character is outside of the screen. The DisplayList must still call
+  /// clear_invalidated() even if display() is not necessary.
+  ///
+  /// Not doing so will result in a stale invalidated flag which in turn will
+  /// prevent the parent to be informed when this character (or a child) is
+  /// invalidated again (see set_invalidated() recursion).
+  ///  
        void clear_invalidated() {
                m_invalidated = false;
     m_child_invalidated = false;    
                m_old_invalidated_ranges.setNull();
        }
   
-  
        /// \brief
        /// Add the character's invalidated bounds *to* the given ranges list.
        //
@@ -1051,6 +1062,14 @@
        ///
        virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool 
force) = 0;
 
+  /// Prints a human readable character tree to LOG_DEBUG for debugging 
purposes.
+  /// 
+  /// This is mainly intended to debug invalidated bounds issues as it shows
+  /// the status of the relevant flags. 'prefix' is prepended to each line
+  /// to achieve the tree structure.
+  ///
+  virtual void dump_character_tree(const std::string prefix) const; 
+  
        /// Callback invoked whenever a character is placed on stage
        //
        /// This function must be called when the character is placed on

Index: server/dlist.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- server/dlist.cpp    5 Mar 2008 11:38:40 -0000       1.115
+++ server/dlist.cpp    3 Apr 2008 14:24:01 -0000       1.116
@@ -657,11 +657,15 @@
             
             if (mask->boundsInClippingArea())
               mask->display();
+            else
+              mask->clear_invalidated();  // avoid stale flag
               
             render::end_submit_mask();
             
             if (ch->boundsInClippingArea())
               ch->display();
+            else
+              ch->clear_invalidated();  // avoid stale flag
               
             render::disable_mask();
             
@@ -715,6 +719,8 @@
         
         if (ch->boundsInClippingArea())
           ch->display();
+        else 
+          ch->clear_invalidated();  // avoid stale flag
         
         // Notify the renderer that mask drawing has finished.
         if (ch->isMaskLayer())
@@ -884,6 +890,25 @@
 }
 
 
+void 
+DisplayList::dump_character_tree(const std::string prefix) const
+{
+  // print self:
+  //character::dump_character_tree(prefix);
+
+  // recursion:
+  for( const_iterator it = _charsByDepth.begin(),
+      endIt = _charsByDepth.end();
+    it != endIt; ++it)
+  {
+    const DisplayItem& dobj = *it;
+    
+    dobj->dump_character_tree(prefix+" "); 
+  }
+  
+
+}
+
 /// This method is not in the header in the hope DisplayItemDepthLess
 /// will be inlined by compiler
 

Index: server/dlist.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/dlist.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- server/dlist.h      21 Jan 2008 20:55:50 -0000      1.63
+++ server/dlist.h      3 Apr 2008 14:24:01 -0000       1.64
@@ -336,6 +336,8 @@
   /// method with the same name of all childs. 
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);     
        
+       void dump_character_tree(const std::string prefix) const;
+       
 
        /// Return number of elements in the list
        size_t size() const

Index: server/movie_root.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -b -r1.172 -r1.173
--- server/movie_root.cpp       20 Mar 2008 12:31:54 -0000      1.172
+++ server/movie_root.cpp       3 Apr 2008 14:24:01 -0000       1.173
@@ -1314,6 +1314,16 @@
        }
 }
 
+void 
+movie_root::dump_character_tree() const 
+{
+  for (Levels::const_iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i)
+       {
+         log_debug("--- movie at depth %d:", i->second->get_depth());
+               i->second->dump_character_tree("CTREE: ");
+       }
+}
+
 int
 movie_root::minPopulatedPriorityQueue() const
 {

Index: server/movie_root.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/movie_root.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- server/movie_root.h 27 Mar 2008 10:50:15 -0000      1.115
+++ server/movie_root.h 3 Apr 2008 14:24:01 -0000       1.116
@@ -478,6 +478,8 @@
     
     DSOEXPORT void add_invalidated_bounds(InvalidatedRanges& ranges, bool 
force);
 
+    void dump_character_tree() const;
+
     /// Return the topmost active entity under the pointer
     //
     /// This method returns cached info, with cache updated

Index: server/sprite_instance.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.495
retrieving revision 1.496
diff -u -b -r1.495 -r1.496
--- server/sprite_instance.cpp  1 Apr 2008 20:34:32 -0000       1.495
+++ server/sprite_instance.cpp  3 Apr 2008 14:24:01 -0000       1.496
@@ -3934,6 +3934,12 @@
 
 }
 
+void 
+sprite_instance::dump_character_tree(const std::string prefix) const
+{
+  character::dump_character_tree(prefix);
+  m_display_list.dump_character_tree(prefix+" ");
+}
 
 const char*
 sprite_instance::call_method_args(const char* method_name,
@@ -4408,6 +4414,7 @@
   const_cast<DisplayList&>(m_display_list).visitAll(f);
   Range drawableBounds = _drawable->get_bound().getRange();
   bounds.expandTo(drawableBounds);
+  
   return bounds;
 }
 

Index: server/sprite_instance.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -b -r1.175 -r1.176
--- server/sprite_instance.h    1 Apr 2008 18:36:22 -0000       1.175
+++ server/sprite_instance.h    3 Apr 2008 14:24:02 -0000       1.176
@@ -713,6 +713,8 @@
 
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
                        
+       void dump_character_tree(const std::string prefix) const;
+                       
 
        const DisplayList& getDisplayList() const {
                if(! is_jumping_back)   {

Index: gui/gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -b -r1.143 -r1.144
--- gui/gui.cpp 22 Mar 2008 02:27:23 -0000      1.143
+++ gui/gui.cpp 3 Apr 2008 14:24:02 -0000       1.144
@@ -607,8 +607,26 @@
                changed_ranges.setWorld();
        }
   
-       // Avoid drawing of stopped movies
+       // DEBUG ONLY:
+  // This is a good place to inspect the invalidated bounds state. Enable
+  // the following block (and parts of it) if you need to. 
+#if 0
+  {
+    // This may print a huge amount of information, but is useful to analyze
+    // the (visible) object structure of the movie and the flags of the
+    // characters. For example, a characters should have set the 
+    // m_child_invalidated flag if at least one of it's childs has the
+    // invalidated flag set.
+    log_debug("DUMPING CHARACTER TREE"); 
+    m->dump_character_tree();
+    
+    // less verbose, and often necessary: see the exact coordinates of the
+    // invalidated bounds (mainly to see if it's NULL or something else).      
+    std::cout << "Calculated changed ranges: " << changed_ranges << "\n";
+  }
+#endif
 
+       // Avoid drawing of stopped movies
        if ( ! changed_ranges.isNull() ) // use 'else'?
        {
                // Tell the GUI(!) that we only need to update this




reply via email to

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