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_ogl.cpp


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog backend/render_handler_ogl.cpp
Date: Sun, 25 Nov 2007 03:27:14 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/11/25 03:27:14

Modified files:
        .              : ChangeLog 
        backend        : render_handler_ogl.cpp 

Log message:
                * backend/render_handler_ogl.cpp: Implement region invalidation,
                but keep it disabled since it does not appear to affect
                performance in its current incarnation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4956&r2=1.4957
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.cpp?cvsroot=gnash&r1=1.92&r2=1.93

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4956
retrieving revision 1.4957
diff -u -b -r1.4956 -r1.4957
--- ChangeLog   24 Nov 2007 23:35:17 -0000      1.4956
+++ ChangeLog   25 Nov 2007 03:27:13 -0000      1.4957
@@ -1,3 +1,9 @@
+2007-11-24 Bastiaan Jacques <address@hidden>
+
+       * backend/render_handler_ogl.cpp: Implement region invalidation,
+       but keep it disabled since it does not appear to affect
+       performance in its current incarnation.
+
 2007-11-24 Sandro Santilli <address@hidden>
 
        * testsuite/media/: README, default.orc, majorscale.sco:

Index: backend/render_handler_ogl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- backend/render_handler_ogl.cpp      24 Nov 2007 04:58:13 -0000      1.92
+++ backend/render_handler_ogl.cpp      25 Nov 2007 03:27:14 -0000      1.93
@@ -34,6 +34,7 @@
 #include "types.h"
 #include "image.h"
 #include "utility.h"
+#include "Range2d.h"
 
 #if defined(_WIN32) || defined(WIN32)
 #  include <Windows.h>
@@ -54,7 +55,7 @@
 ///    from an arbitrary number of edges. An edge describes a quadratic Bezier
 ///    curve. A shape is defined by at least one path enclosing a space -- this
 ///    space is the shape. Every path may have a left and/or right fill style,
-///    determining (if the shape is thought of as a vector) which side(s) of
+///    determining (if the path is thought of as a vector) which side(s) of
 ///    the path is to be filled.
 ///    OpenGL, on the other hand, understands only triangles, lines and points.
 ///    We must break Flash graphics down into primitives that OpenGL can
@@ -343,6 +344,7 @@
        end = _vertices.end(); it != end; ++it) {
     delete [] *it;
   }
+
   _vertices.clear();
 }
 
@@ -529,6 +531,16 @@
   
 }
 
+template<typename C, typename T, typename R, typename A>
+void 
+for_each(C& container, R (T::*pmf)(const A&),const A& arg)
+{
+    std::for_each(container.begin(), container.end(),
+                  boost::bind(pmf, _1, boost::ref(arg)));
+}
+
+
+
 class DSOEXPORT render_handler_ogl : public render_handler
 {
 public: 
@@ -751,6 +763,17 @@
   virtual void
   end_display()
   {
+  #if 0
+    GLint box[4];
+    glGetIntegerv(GL_SCISSOR_BOX, box);
+    
+    int x = PIXELS_TO_TWIPS(box[0]),
+        y = PIXELS_TO_TWIPS(box[1]),
+        w = PIXELS_TO_TWIPS(box[2]),
+        h = PIXELS_TO_TWIPS(box[3]);
+
+    glRectd(x, y - h, x + w, y + h);
+  #endif
     check_error();
     glFlush(); // Make OpenGL execute all commands in the buffer.
   }
@@ -1358,6 +1381,8 @@
   {  
     std::for_each(paths.begin(), paths.end(),
                   boost::bind(&path::transform, _1, boost::ref(mat)));
+                  
+    //for_each(paths, &path::transform, mat);
   }  
 
   void
@@ -1461,7 +1486,7 @@
     }
     
     if (_drawing_mask) {
-      PathVec scaled_path_vec = path_vec;;
+      PathVec scaled_path_vec = path_vec;
       
       apply_matrix_to_paths(scaled_path_vec, mat);
       draw_mask(scaled_path_vec); 
@@ -1534,6 +1559,23 @@
     scale.y = _yscale;
   }
 
+  virtual void set_invalidated_regions(const InvalidatedRanges& ranges)
+  {
+#if 0
+    if (ranges.isWorld() || ranges.isNull()) {
+      glDisable(GL_SCISSOR_TEST);
+      return;
+    }    
+    
+    glEnable(GL_SCISSOR_TEST);
+    
+    geometry::Range2d<float> area = ranges.getFullArea;
+    
+    glScissor( (int)TWIPS_TO_PIXELS(area.getMinX()), 
window_height-(int)TWIPS_TO_PIXELS(area.getMaxY()),
+               (int)TWIPS_TO_PIXELS(area.width()), 
(int)TWIPS_TO_PIXELS(area.height()));
+#endif
+  }
+
 #ifdef OSMESA_TESTING
   bool getPixel(rgba& color_out, int x, int y)
   {  




reply via email to

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