[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h
From: |
Udo Giacomozzi |
Subject: |
[Gnash-commit] gnash ChangeLog gui/gui.cpp gui/gui.h |
Date: |
Mon, 16 Oct 2006 14:41:30 +0000 |
CVSROOT: /cvsroot/gnash
Module name: gnash
Changes by: Udo Giacomozzi <udog> 06/10/16 14:41:30
Modified files:
. : ChangeLog
gui : gui.cpp gui.h
Log message:
Added want_redraw() function so that GUIs can request redrawing of the
complete frame
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1239&r2=1.1240
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.22&r2=1.23
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.1239
retrieving revision 1.1240
diff -u -b -r1.1239 -r1.1240
--- ChangeLog 16 Oct 2006 14:36:22 -0000 1.1239
+++ ChangeLog 16 Oct 2006 14:41:30 -0000 1.1240
@@ -1,4 +1,9 @@
+2006-10-16 Udo Giacomozzi <address@hidden>
+
+ * gui/gui.h, gui/gui.cpp: Added want_redraw() function
+
2006-10-16 Hannes Mayr <address@hidden>
+
* gui/gtk_glue_agg.cpp, gui/gtk.cpp, gui/gtksup.h: Added regions support
to the GTK-AGG GUI.
Index: gui/gui.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- gui/gui.cpp 15 Oct 2006 14:26:05 -0000 1.27
+++ gui/gui.cpp 16 Oct 2006 14:41:30 -0000 1.28
@@ -224,6 +224,7 @@
rect changed_bounds; // new bounds for the current frame
rect draw_bounds; // redraw bounds (union of current and previous frame)
+ bool redraw_flag;
// GNASH_REPORT_FUNCTION;
gnash::movie_interface* m = gnash::get_current_root();
@@ -231,15 +232,37 @@
// Advance movie by one frame
m->advance(1.0);
+ // Should the frame be rendered completely, even if it did not change?
+ redraw_flag = gui->want_redraw();
+
// Find out the surrounding frame of all characters wich have been updated.
+ if (!redraw_flag)
m->get_invalidated_bounds(&changed_bounds, false);
+
+ if (redraw_flag) {
+
+ draw_bounds.m_x_min = -1e10f;
+ draw_bounds.m_y_min = -1e10f;
+ draw_bounds.m_x_max = +1e10f;
+ draw_bounds.m_y_max = +1e10f;
+
+ changed_bounds.m_x_min = 0.0f;
+ changed_bounds.m_y_min = 0.0f;
+ changed_bounds.m_x_max = 0.0f;
+ changed_bounds.m_y_max = 0.0f;
+
+ } else {
+
// Union it with the previous frame (when a character moved, we also need to
// redraw it's previous position).
draw_bounds = changed_bounds;
if (gui->_last_invalidated_bounds.m_x_min <=
gui->_last_invalidated_bounds.m_x_max)
draw_bounds.expand_to_rect(gui->_last_invalidated_bounds);
+ }
+
+
// Avoid drawing of stopped movies
if (draw_bounds.m_x_min <= draw_bounds.m_x_max) {
Index: gui/gui.h
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/gui.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- gui/gui.h 13 Oct 2006 11:41:11 -0000 1.22
+++ gui/gui.h 16 Oct 2006 14:41:30 -0000 1.23
@@ -133,6 +133,14 @@
}
+ /// Asks the GUI handler if the next frame should be redrawn completely.
+ /// For example, when the contents of the player window have been
destroyed,
+ /// then want_draw() should return true so that set_invalidated_region() is
+ /// called with the coordinates of the complete screen.
+ virtual bool want_redraw() {
+ return false;
+ }
+
/// \brief
/// Render the current buffer. For OpenGL, this means that the buffer is
/// swapped.