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: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
Date: Wed, 06 Dec 2006 12:48:51 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/12/06 12:48:51

Modified files:
        .              : ChangeLog 
        server         : character.cpp character.h movie_root.cpp 
                         rect.cpp rect.h sprite_instance.cpp 

Log message:
                * server/sprite_instance.cpp (get_invalidated_bounds):
                  cleaned up debugging output to use rect::toString.
                * server/movie_root.cpp (get_invalidated_bounds): remove
                  the dirty workaround to invalidated bounds bug.
                * server/character.{h,cpp} (set_invalidated_bounds): propagate
                  invalidity to parent (seems to fix the invalidated bounds
                  bug introduced by last big refactoring).
                * server/rect.{cpp,h}: added toString() method.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1868&r2=1.1869
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/rect.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/rect.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.95&r2=1.96

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1868
retrieving revision 1.1869
diff -u -b -r1.1868 -r1.1869
--- ChangeLog   6 Dec 2006 10:58:34 -0000       1.1868
+++ ChangeLog   6 Dec 2006 12:48:50 -0000       1.1869
@@ -1,5 +1,16 @@
 2006-12-06 Sandro Santilli <address@hidden>
 
+       * server/sprite_instance.cpp (get_invalidated_bounds):
+         cleaned up debugging output to use rect::toString.
+       * server/movie_root.cpp (get_invalidated_bounds): remove
+         the dirty workaround to invalidated bounds bug.
+       * server/character.{h,cpp} (set_invalidated_bounds): propagate
+         invalidity to parent (seems to fix the invalidated bounds
+         bug introduced by last big refactoring).
+       * server/rect.{cpp,h}: added toString() method.
+
+2006-12-06 Sandro Santilli <address@hidden>
+
        * backend/render_handler_d3d.cpp, gui/Player.cpp, gui/fbsup.h,
          gui/gtk_glue_cairo.h, gui/kdesup.h, gui/sdl_ogl_glue.h,
          libbase/URL.cpp, libbase/log.cpp, libbase/rc.cpp,

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/character.cpp        6 Dec 2006 10:21:32 -0000       1.13
+++ server/character.cpp        6 Dec 2006 12:48:51 -0000       1.14
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: character.cpp,v 1.13 2006/12/06 10:21:32 strk Exp $ */
+/* $Id: character.cpp,v 1.14 2006/12/06 12:48:51 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -158,6 +158,26 @@
        return NULL;
 }
 
+void
+character::set_invalidated()
+{
+       if ( m_parent ) m_parent->set_invalidated();
+  
+       // Ok, at this point the instance will change it's
+       // visual aspect after the
+       // call to set_invalidated(). We save the *current*
+       // position of the instance because this region must
+       // be updated even (or first of all) if the character
+       // moves away from here.
+       // 
+       if ( ! m_invalidated )
+       {
+               m_invalidated = true;
+               m_old_invalidated_bounds.set_null();
+               get_invalidated_bounds(&m_old_invalidated_bounds, true);
+       }
+
+}
 
 } // namespace gnash
 

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/character.h  6 Dec 2006 11:10:06 -0000       1.33
+++ server/character.h  6 Dec 2006 12:48:51 -0000       1.34
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: character.h,v 1.33 2006/12/06 11:10:06 strk Exp $ */
+/* $Id: character.h,v 1.34 2006/12/06 12:48:51 strk Exp $ */
 
 #ifndef GNASH_CHARACTER_H
 #define GNASH_CHARACTER_H
@@ -96,10 +96,25 @@
        /// \brief
        /// Set when the visual aspect of this particular character or movie
        /// has been changed and redrawing is necessary.  
+       //
+       /// This is initialized to true as the initial state for
+       /// any character is the "invisible" state (it wasn't there)
+       /// so it starts in invalidated mode.
+       ///
        bool m_invalidated;
 
 
        /// Bounds of character instance before invalidating it
+       //
+       /// TODO: tell more about this, it is unclear what 
+       ///       does "before" invalidating means.
+       ///       In particular I've the impression that calling
+       ///       set_invalidated() updates this, which doesn't
+       ///       seem error-prone to me as multiple calls would
+       ///       make this member useless!
+       ///
+       /// NOTE: this is currently initialized as the NULL rectangle.
+       ///
        rect m_old_invalidated_bounds;
        
 
@@ -378,40 +393,36 @@
        /// modifies its rendering. This information will be used
        /// to detect visual changes that need to be redrawn.
        ///
+       /// NOTE: Marking a character as invalidated automatically marks
+       ///       it's parent as being invalidated.
+       ///
        /// @see \ref region_update
        ///
-       void set_invalidated()
-       {
-       
-               // flag already set, don't do anything
-               if (m_invalidated) return;
-       
-               m_invalidated = true;
-         
-               // Ok, at this point the instance will change it's
-               // visual aspect after the
-               // call to set_invalidated(). We save the *current*
-               // position of the instance because this region must
-               // be updated even (or first of all) if the character
-               // moves away from here.
-               m_old_invalidated_bounds.set_null();
-               get_invalidated_bounds(&m_old_invalidated_bounds, true);
-     
-       }
+       void set_invalidated();
   
        // Should be called by display()
        void clear_invalidated() {
                m_invalidated = false;    
+               // Is it correct to set old bounds to null ?
+               // Why are we doing so ?
                m_old_invalidated_bounds.set_null();
        }
   
   
-       /// Checks if the character instance is still enclosed in
-       /// the given bounds.  Otherwise it will expand them to surround
-       /// the character. It is used to determine what area needs
-       /// to be re-rendered. The coordinates are world coordinates.
+       /// \brief
+       /// Expand the given rectangle to enclose this character's
+       /// invalidated bounds.
+       //
+       /// NOTE that this method should include the bounds that it
+       /// covered the last time ::display() was called, as those need
+       /// to be rerendered as well (to clear the region previously
+       /// occupied by this character). [ Correct ? ]
+       ///
+       /// It is used to determine what area needs to be re-rendered.
+       /// The coordinates are world coordinates (in TWIPS).
        /// Only instances with m_invalidated flag set are checked unless
        /// force is set.
+       ///
        virtual void get_invalidated_bounds(rect* bounds, bool force) = 0;
 
 

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/movie_root.cpp       6 Dec 2006 10:21:32 -0000       1.31
+++ server/movie_root.cpp       6 Dec 2006 12:48:51 -0000       1.32
@@ -586,16 +586,8 @@
 void
 movie_root::get_invalidated_bounds(rect* bounds, bool force)
 {
-       // We have a problem with invalidated bounds, this temporary fix
-       // helps committing the refactored code, later we'll have to really
-       // fix this.
-       bounds->set_world(); return;
-
        bounds->set_null();
        _movie->get_invalidated_bounds(bounds, force);
-       if ( bounds->is_null() ) log_msg("NULL invalidated bounds!");
-       else log_msg("NOT NULL bounds");
-       // strk STRK FIXME TODO NOW: we have a problem here!! (see elvis.swf)
 }
 
 } // namespace gnash

Index: server/rect.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/rect.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/rect.cpp     5 Dec 2006 23:09:46 -0000       1.7
+++ server/rect.cpp     6 Dec 2006 12:48:51 -0000       1.8
@@ -23,7 +23,7 @@
 #include "matrix.h"
 #include "types.h" // for TWIPS_TO_PIXELS
 
-#include <sstream> // for ::print
+#include <sstream> // for ::print and ::toString
 
 namespace gnash {
 
@@ -46,9 +46,7 @@
 // Debug spew.
 void   rect::print() const
 {
-       std::stringstream ss;
-       ss << _range;
-       log_parse("%s", ss.str().c_str());
+       log_parse("%s", toString().c_str());
 }
 
 
@@ -151,6 +149,14 @@
        p.m_y = fclamp(p.m_y, _range.getMinY(), _range.getMaxY());
 }
 
+std::string
+rect::toString() const
+{
+       std::stringstream ss;
+       ss << _range;
+       return ss.str();
+}
+
 
 }      // end namespace gnash
 

Index: server/rect.h
===================================================================
RCS file: /sources/gnash/gnash/server/rect.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/rect.h       6 Dec 2006 08:46:50 -0000       1.15
+++ server/rect.h       6 Dec 2006 12:48:51 -0000       1.16
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: rect.h,v 1.15 2006/12/06 08:46:50 strk Exp $ */
+/* $Id: rect.h,v 1.16 2006/12/06 12:48:51 strk Exp $ */
 
 #ifndef GNASH_RECT_H
 #define GNASH_RECT_H
@@ -251,6 +251,9 @@
        {
                return _range;
        }
+
+       /// Return a string representation for this rectangle
+       std::string toString() const;
 };
 
 inline std::ostream&

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/sprite_instance.cpp  6 Dec 2006 10:21:32 -0000       1.95
+++ server/sprite_instance.cpp  6 Dec 2006 12:48:51 -0000       1.96
@@ -51,7 +51,6 @@
 
 #include <functional> // for mem_fun, bind1st
 #include <algorithm> // for for_each
-#include <sstream>
 
 // This needs to be included first for NetBSD systems or we get a weird
 // problem with pthread_t being defined too many times if we use any
@@ -2583,16 +2582,17 @@
 //#define DEBUG_INVALIDATED_BOUNDS
 
 #ifdef DEBUG_INVALIDATED_BOUNDS
-       std::stringstream ss;
-       ss << this << ") sprite_instance::get_invalidated_bounds(" << *bounds 
<< ", " << force << ") called [ " << typeid(*this).name() << "]" << std::endl;
+       log_msg("%p) sprite_instance::get_invalidated_bounds(%s, %d) "
+                       "called [ %s ]",
+                      (void*)this, bounds->toString().c_str(), force,
+                      typeid(*this).name());
 #endif
 
        // nothing to do if this sprite is not visible
        if (!m_visible)
        {
 #ifdef DEBUG_INVALIDATED_BOUNDS
-               ss << "Not visible, bounds untouched" << std::endl;
-               log_msg("%s", ss.str().c_str());
+               log_msg("Not visible, bounds untouched");
 #endif
                return;
        }
@@ -2604,8 +2604,7 @@
        if ( ! m_invalidated && ! force )
        {
 #ifdef DEBUG_INVALIDATED_BOUNDS
-               ss << "Not invalidated and not forced, bounds untouched" << 
std::endl;
-               log_msg("%s", ss.str().c_str());
+               log_msg("Not invalidated and not forced, bounds untouched");
 #endif
                return;
        }
@@ -2613,14 +2612,18 @@
        // Add old invalidated bounds 
        bounds->expand_to_rect(m_old_invalidated_bounds);
 #ifdef DEBUG_INVALIDATED_BOUNDS
-       ss << "After expanding to old_invalidated_bounds (" << 
m_old_invalidated_bounds << ") new bounds are: " << *bounds << std::endl;
+       log_msg("After expanding to old_invalidated_bounds (%s) "
+                       "new bounds are: %s",
+                       m_old_invalidated_bounds.toString().c_str(),
+                       bounds->toString().c_str());
 #endif
   
        m_display_list.get_invalidated_bounds(bounds, force||m_invalidated);
 
 #ifdef DEBUG_INVALIDATED_BOUNDS
-       ss << "After getting invalidated bounds from m_display_list, new bounds 
are: " << *bounds << std::endl;
-       log_msg("%s", ss.str().c_str());
+       log_msg("After getting invalidated bounds from display list, "
+                       "new bounds are: %s",
+                       bounds->toString().c_str());
 #endif
 }
 




reply via email to

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