[Top][All Lists]
[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: |
Mon, 11 Feb 2008 10:24:57 +0000 |
CVSROOT: /cvsroot/gnash
Module name: gnash
Changes by: Udo Giacomozzi <udog> 08/02/11 10:24:57
Modified files:
. : ChangeLog
server : character.cpp character.h generic_character.cpp
generic_character.h edit_text_character.cpp
sprite_instance.cpp
Log message:
* server/character.{cpp,h}: new boundsInClippingArea() function
* server/generic_character.{cpp,h}: move display() implementation to
.cpp
file and add call to boundsInClippingArea()
* server/edit_text_character.cpp: add call to boundsInClippingArea()
* server/sprite_instance.cpp: remove clipping check using
add_invalidated_bounds and do simple (single) bounds check instead
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5611&r2=1.5612
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.124&r2=1.125
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/generic_character.h?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.151&r2=1.152
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.466&r2=1.467
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.5611
retrieving revision 1.5612
diff -u -b -r1.5611 -r1.5612
--- ChangeLog 11 Feb 2008 08:33:37 -0000 1.5611
+++ ChangeLog 11 Feb 2008 10:24:56 -0000 1.5612
@@ -1,3 +1,12 @@
+2008-02-11 Udo Giacomozzi <address@hidden>
+
+ * server/character.{cpp,h}: new boundsInClippingArea() function
+ * server/generic_character.{cpp,h}: move display() implementation to
.cpp
+ file and add call to boundsInClippingArea()
+ * server/edit_text_character.cpp: add call to boundsInClippingArea()
+ * server/sprite_instance.cpp: remove clipping check using
+ add_invalidated_bounds and do simple (single) bounds check instead
+
2008-02-11 Sandro Santilli <address@hidden>
* testsuite/actionscript.all/MovieClipLoader.as: test 'this' in
Index: server/character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/character.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- server/character.cpp 29 Jan 2008 12:31:10 -0000 1.77
+++ server/character.cpp 11 Feb 2008 10:24:57 -0000 1.78
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: character.cpp,v 1.77 2008/01/29 12:31:10 strk Exp $ */
+/* $Id: character.cpp,v 1.78 2008/02/11 10:24:57 udog Exp $ */
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
@@ -29,6 +29,7 @@
#include "VM.h" // for do_mouse_drag (to be moved in movie_root)
#include "fn_call.h" // for shared ActionScript getter-setters
#include "GnashException.h" // for shared ActionScript getter-setters
(ensure_character)
+#include "render.h" // for bounds_in_clipping_area()
#include "ExecutableCode.h"
#include "namedStrings.h"
@@ -969,6 +970,16 @@
}
+bool
+character::boundsInClippingArea() const
+{
+ geometry::Range2d<float> mybounds = getBounds();
+ get_world_matrix().transform(mybounds);
+
+ return gnash::render::bounds_in_clipping_area(mybounds);
+}
+
+
} // namespace gnash
// local variables:
Index: server/character.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/character.h,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- server/character.h 23 Jan 2008 12:39:37 -0000 1.124
+++ server/character.h 11 Feb 2008 10:24:57 -0000 1.125
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: character.h,v 1.124 2008/01/23 12:39:37 strk Exp $ */
+/* $Id: character.h,v 1.125 2008/02/11 10:24:57 udog Exp $ */
#ifndef GNASH_CHARACTER_H
#define GNASH_CHARACTER_H
@@ -1120,6 +1120,14 @@
///
bool isDestroyed() const { return _destroyed; }
+ /// Returns true when the character bounds intersect with the current
+ /// rendering clipping area.
+ ///
+ /// There is no need to do any rendering for this character when this
+ /// function returns false because the renderer will not change any pixels
+ /// in the area where this character is placed.
+ bool boundsInClippingArea() const;
+
public: // istn't this 'public' reduntant ?
/// Return full path to this object, in slash notation
Index: server/generic_character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/generic_character.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/generic_character.cpp 21 Jan 2008 20:55:50 -0000 1.11
+++ server/generic_character.cpp 11 Feb 2008 10:24:57 -0000 1.12
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: generic_character.cpp,v 1.11 2008/01/21 20:55:50 rsavoye Exp $ */
+/* $Id: generic_character.cpp,v 1.12 2008/02/11 10:24:57 udog Exp $ */
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
@@ -58,6 +58,18 @@
return m_def->point_test_local(lp.x, lp.y);
}
+
+void
+generic_character::display()
+{
+
+ if (boundsInClippingArea())
+ m_def->display(this); // pass in transform info
+
+ clear_invalidated();
+ do_display_callback();
+}
+
} // namespace gnash
// Local Variables:
Index: server/generic_character.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/generic_character.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- server/generic_character.h 21 Jan 2008 20:55:50 -0000 1.27
+++ server/generic_character.h 11 Feb 2008 10:24:57 -0000 1.28
@@ -78,13 +78,7 @@
//return m_parent->can_handle_mouse_event();
}
- virtual void display()
- {
-// GNASH_REPORT_FUNCTION;
- m_def->display(this); // pass in transform info
- clear_invalidated();
- do_display_callback();
- }
+ virtual void display();
geometry::Range2d<float> getBounds() const
{
Index: server/edit_text_character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -b -r1.151 -r1.152
--- server/edit_text_character.cpp 7 Feb 2008 19:50:22 -0000 1.151
+++ server/edit_text_character.cpp 11 Feb 2008 10:24:57 -0000 1.152
@@ -493,6 +493,8 @@
//rect def_bounds = m_def->get_bounds();
+ if (boundsInClippingArea()) {
+
bool drawBorder = getDrawBorder();
bool drawBackground = getDrawBackground();
@@ -552,6 +554,8 @@
show_cursor(m);
}
+ } //if boundsInClippingArea
+
clear_invalidated();
do_display_callback();
}
Index: server/sprite_instance.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.466
retrieving revision 1.467
diff -u -b -r1.466 -r1.467
--- server/sprite_instance.cpp 10 Feb 2008 09:36:38 -0000 1.466
+++ server/sprite_instance.cpp 11 Feb 2008 10:24:57 -0000 1.467
@@ -3014,22 +3014,19 @@
// Note:
// DisplayList::Display() will take care of the visibility checking.
//
- // Whether a character should be rendered or not is dependent on its paraent.
+ // Whether a character should be rendered or not is dependent on its parent.
// i.e. if its parent is a mask, this character should be rendered to the
mask
// buffer even it is invisible.
//
- // check if the sprite (and it's childs) needs to be drawn
- InvalidatedRanges ranges;
- m_display_list.add_invalidated_bounds(ranges, true);
-
- // expand to bounds of _drawable
- rect drawable_bounds;
- drawable_bounds.expand_to_transformed_rect(get_world_matrix(),
_drawable->get_bound());
- ranges.add(drawable_bounds.getRange());
+ // check if either the drawable or the display list intersect with the
+ // rendering clipping area. Note that we just want to do a simple bounds
check
+ // (which does not guarantee that rendering is really necessary) because it's
+ // much simpler than a check using add_invalidated_ranges().
+ if (boundsInClippingArea()) {
+
+ // render drawable (ActionScript generated graphics)
- if (gnash::render::bounds_in_clipping_area(ranges))
- {
_drawable->finalize();
// TODO: I'd like to draw the definition directly..
// but it seems that the backend insists in
@@ -3041,8 +3038,12 @@
// a container for a parent :(
_drawable_inst->display();
+
+ // descend the display list
m_display_list.display();
+
}
+
clear_invalidated();
do_display_callback();
- [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...,
Udo Giacomozzi <=