gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog backend/render_handler_agg.cpp


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog backend/render_handler_agg.cpp
Date: Sat, 04 Nov 2006 12:22:54 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   06/11/04 12:22:54

Modified files:
        .              : ChangeLog 
        backend        : render_handler_agg.cpp 

Log message:
        opzimized screen clearing

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1513&r2=1.1514
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.37&r2=1.38

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.1513
retrieving revision 1.1514
diff -u -b -r1.1513 -r1.1514
--- ChangeLog   4 Nov 2006 10:51:17 -0000       1.1513
+++ ChangeLog   4 Nov 2006 12:22:53 -0000       1.1514
@@ -1,7 +1,7 @@
 2006-11-04 Udo Giacomozzi <address@hidden>
 
        * backend/render_handler_agg.cpp: removed compatibility include as
-       it is not enough anyway
+       it is not enough anyway; optimized screen clearing
 
 2006-11-04 Markus Gothe <address@hidden>
 

Index: backend/render_handler_agg.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- backend/render_handler_agg.cpp      4 Nov 2006 10:51:17 -0000       1.37
+++ backend/render_handler_agg.cpp      4 Nov 2006 12:22:54 -0000       1.38
@@ -16,7 +16,7 @@
 
  
 
-/* $Id: render_handler_agg.cpp,v 1.37 2006/11/04 10:51:17 udog Exp $ */
+/* $Id: render_handler_agg.cpp,v 1.38 2006/11/04 12:22:54 udog Exp $ */
 
 // Original version by Udo Giacomozzi and Hannes Mayr, 
 // INDUNET GmbH (www.indunet.it)
@@ -483,9 +483,9 @@
          assert(m_pixf != NULL);
 
          // clear the stage using the background color   
-         renderer_base rbase(*m_pixf);
-         rbase.clip_box(m_clip_xmin, m_clip_ymin, m_clip_xmax, m_clip_ymax);
-    rbase.clear(agg::rgba8(background_color.m_r, background_color.m_g,
+    clear_framebuffer(m_clip_xmin, m_clip_ymin, 
+      m_clip_xmax-m_clip_xmin+1, m_clip_ymax-m_clip_ymin+1, 
+      agg::rgba8(background_color.m_r, background_color.m_g, 
        background_color.m_b, background_color.m_a));
 
     // calculate final pixel scale
@@ -498,6 +498,23 @@
     m_drawing_mask = false;
        }
 
+       /// renderer_base.clear() does no clipping which clears the whole 
framebuffer
+       /// even if we update just a small portion of the screen. The result 
would be
+       /// still correct, but slower. 
+  /// This function clears only a certain portion of the screen, while /not/ 
+  /// being notably slower for a fullscreen clear. 
+       void clear_framebuffer(unsigned int left, unsigned int top, 
+    unsigned int width, unsigned int height, agg::rgba8 color) {
+    
+         if (!width) return;
+         
+         unsigned int y;
+         const unsigned int max_y = top+height; // to be exact, it's one off 
the max.
+                 
+    for (y=top; y<max_y; y++) 
+      m_pixf->copy_hline(left, y, width, color);
+  }
+
   bool allow_glyph_textures() {
     // We want to render all glyphs in place 
     return false; 




reply via email to

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