gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, hwaccel, updated. release_0_8_9_final


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, hwaccel, updated. release_0_8_9_final-1154-ge290f51
Date: Fri, 02 Sep 2011 15:08:06 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, hwaccel has been updated
       via  e290f51981f0f52b1fef8827d78e477698eb5d08 (commit)
       via  d11bbdc666ba413d98d012457e57574b931255b8 (commit)
       via  4b3a090ed185344200f343fff622bb9ef2f9e1cd (commit)
       via  c24f05815683823c02e69e9beb33294e58034046 (commit)
       via  cf795342446a236d223af6fa69f78d1d6fd8f24d (commit)
       via  8324688012fecf796c80850924a2ebabd94ec618 (commit)
       via  1c84f03aab66abc1b9e7e08c7e719fe8ced91869 (commit)
       via  464fb6913b0161a63e7c2ca79d870f68c8f60efe (commit)
       via  5839fb5e3eb2646b61c0ed16b9794df7e94f500e (commit)
       via  1a19d557b6dabeb8e5ea619a6a1c393d56b31525 (commit)
       via  e31b5d8dc66f687fc0df9c69cec272c65b62190b (commit)
       via  80d620aa50a82f0159ab3d174e2c089667ca1ffc (commit)
      from  5793f50ad1f632f96f239543b64fd6124a4cfe4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=e290f51981f0f52b1fef8827d78e477698eb5d08


commit e290f51981f0f52b1fef8827d78e477698eb5d08
Merge: 80d620a d11bbdc
Author: Rob Savoye <address@hidden>
Date:   Fri Sep 2 09:07:49 2011 -0600

    merge from style branch

diff --cc librender/openvg/OpenVGBitmap.cpp
index 2decb10,1518ed2..061b068
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@@ -148,23 -152,15 +152,15 @@@ OpenVGBitmap::~OpenVGBitmap(
  // x1,y1 is the focal point that is forced to be in the circle.
  OpenVGBitmap *
  OpenVGBitmap::createRadialBitmap(float cx, float cy, float fx, float fy,
-                                  float radial, const rgba &incolor,
 -                                 float radial, const SWFCxForm& cxform,
++                                 float radial, const SWFCxForm& /* cxform */,
                                   const GradientFill::GradientRecords &records,
-                                  const SWFCxForm& /* cxform */,
                                   VGPaint paint)
  {
-     // GNASH_REPORT_FUNCTION;
+     GNASH_REPORT_FUNCTION;
  
-     VGfloat color[] = {
-         incolor.m_r / 255.0f,
-         incolor.m_g / 255.0f,
-         incolor.m_b / 255.0f,
-         incolor.m_a / 255.0f
-     };
-     vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
-     vgSetParameterfv (paint, VG_PAINT_COLOR, 4, color);
-     
      VGfloat rgParams[] = { cx, cy, fx, fy, radial };
+     std::cerr << "Radial params are: " << cx << ", " << cy << ", "
+               << fx << ", " << fy << std::endl;
      
      // Paint Type 
      vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT);
@@@ -273,8 -268,9 +268,9 @@@ OpenVGBitmap::createLinearBitmap(float 
  /// @param paint The VG paint context
  /// @return A pointer to the new Bitmap
  OpenVGBitmap *
- OpenVGBitmap::applyPatternBitmap(const gnash::SWFMatrix& matrix,
-                                  bitmap_wrap_mode mode, VGPaint paint)
+ OpenVGBitmap::applyPatternBitmap(const gnash::SWFMatrix& mat,
+                                  bitmap_wrap_mode mode,
 -                                 CachedBitmap *bitmap, VGPaint paint)
++                                 CachedBitmap *bitmap, VGPaint /* paint */)
  {
      // GNASH_REPORT_FUNCTION;
  

http://git.savannah.gnu.org/cgit//commit/?id=d11bbdc666ba413d98d012457e57574b931255b8


commit d11bbdc666ba413d98d012457e57574b931255b8
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 17:36:51 2011 -0600

    less verbose

diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index 9b2190c..a215ee8 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -109,10 +109,8 @@ struct StyleHandler : boost::static_visitor<>
 
     void operator()(const BitmapFill& b) const {
         GNASH_REPORT_FUNCTION;
-        // OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);          
         SWFMatrix mat = b.matrix();
         const bool type = b.type();
-        //const CachedBitmap *bm = b.bitmap();
         CachedBitmap *cb = const_cast<CachedBitmap *>(b.bitmap());
         OpenVGBitmap* binfo = new OpenVGBitmap(_vgpaint);
         if (!cb) {

http://git.savannah.gnu.org/cgit//commit/?id=4b3a090ed185344200f343fff622bb9ef2f9e1cd


commit 4b3a090ed185344200f343fff622bb9ef2f9e1cd
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 17:23:32 2011 -0600

    less verbose

diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index 922c0c3..9b2190c 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -93,7 +93,7 @@ struct StyleHandler : boost::static_visitor<>
     }
 
     void operator()(const SolidFill& f) const {
-        GNASH_REPORT_FUNCTION;
+        // GNASH_REPORT_FUNCTION;
         const rgba incolor = f.color();
         rgba c = _cxform.transform(incolor);
         VGfloat color[] = {
@@ -137,7 +137,6 @@ private:
     const VGPaint&   _vgpaint;
     float            _x;
     float            _y;
-//    OpenVGBitmap::bitmap_wrap_mode _mode;
 };
 
 } // namespace gnash::renderer::openvg

http://git.savannah.gnu.org/cgit//commit/?id=c24f05815683823c02e69e9beb33294e58034046


commit c24f05815683823c02e69e9beb33294e58034046
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 17:17:56 2011 -0600

    fix handling of solid fills, use StyleHandler, remove unused 
apply_fill_style

diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index 3e543ef..adf4b5a 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -814,84 +814,6 @@ Renderer_ovg::analyze_paths(const PathVec &paths, bool& 
have_shape,
     }    
 }
 
-#if 0
-void
-Renderer_ovg::apply_fill_style(const FillStyle& style, const SWFMatrix& /* mat 
*/,
-                               const SWFCxForm& cx)
-{
-    // GNASH_REPORT_FUNCTION;
-
-    // Renderer_ovg::printVGMatrix(mat);
-    
-    SWF::FillType fill_type = boost::apply_visitor(GetType(), style.fill);
-    SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);
-    rgba incolor = boost::apply_visitor(GetColor(), style.fill);
-    switch (fill_type) {
-        
-      case SWF::FILL_LINEAR_GRADIENT:
-      case SWF::FILL_RADIAL_GRADIENT:
-      case SWF::FILL_FOCAL_GRADIENT:
-      {
-          // This is handled elsewhere, as it's now hardware supported.
-          log_error("Fill Style Type: Gradient, you shouldn't be here!");
-          break;
-      }
-      // FIXME: Bitmap cacheing needs to be improved. Currently the GnashInage
-      // is cached, but the VG image is not. This forces the VG Image to be
-      // recalculated all the time from the GnashImage. Ideally the VG Image
-      // should be cached instead by the Renderer.
-      case SWF::FILL_TILED_BITMAP_HARD:
-      case SWF::FILL_TILED_BITMAP:
-      {
-          log_debug("Fill Style Type: Tiled Bitmap");
-          const StyleHandler st(mat, cx, _fillpaint,
-                                (*(refs[0])).ap.x, (*(refs[0])).ap.y);
-          boost::apply_visitor(st, fill_styles[i].fill);
-          CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
-          // Convert the GnashImage to a VG Image
-          OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
-          // Adjust the X scale by the aspect ratio or images get squished
-          //sm.a() = sm.a() * _aspect_ratio;
-          SWFMatrix nsm(sm.a() * _aspect_ratio, sm.b(), sm.c(), sm.d(), 
sm.tx(), sm.ty());
-          // Apply the transformation and paint
-          binfo->applyPatternBitmap(nsm, OpenVGBitmap::WRAP_FILL, _fillpaint);
-          break;
-      }
-      
-      case SWF::FILL_CLIPPED_BITMAP:
-      case SWF::FILL_CLIPPED_BITMAP_HARD:
-      {     
-          log_debug("Fill Style Type: Clipped Bitmap");
-          CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);    
      
-          // Convert the GnashImage to a VG Image
-          OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
-          // Adjust the X scale by the aspect ratio or images get squished
-          // sm.a() = sm.a() * _aspect_ratio;
-          SWFMatrix nsm(sm.a() * _aspect_ratio, sm.b(), sm.c(), sm.d(), 
sm.tx(), sm.ty());
-          // Apply the transformation and paint
-          binfo->applyPatternBitmap(nsm, OpenVGBitmap::WRAP_FILL, _fillpaint);
-          break;
-      } 
-      case SWF::FILL_SOLID:
-      {
-//          log_debug("Fill Style Type: Solid");
-          rgba incolor = boost::apply_visitor(GetColor(), style.fill);
-          rgba c = cx.transform(incolor);
-          VGfloat color[] = {
-              c.m_r / 255.0f,
-              c.m_g / 255.0f,
-              c.m_b / 255.0f,
-              c.m_a / 255.0f
-          };
-
-          vgSetParameteri (_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
-          vgSetParameterfv (_fillpaint, VG_PAINT_COLOR, 4, color);
-      }
-      
-    } // switch fill_type
-}
-#endif
-
 bool
 Renderer_ovg::apply_line_style(const LineStyle& style, const SWFCxForm& cx, 
                                const SWFMatrix& mat)
@@ -1164,6 +1086,8 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
             startpath(vg_path, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
 
             // Create a Linear or Radial gradient
+            // All positions are specified in twips, which are 20 to the
+            // pixel.
             const StyleHandler st(cx, _fillpaint,
                                   (*(refs[0])).ap.x/20, (*(refs[0])).ap.y/20);
             boost::apply_visitor(st, fill_styles[i].fill);
diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index 482a18b..922c0c3 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -56,7 +56,7 @@ struct StyleHandler : boost::static_visitor<>
           _x(x),
           _y(y)
         {
-            GNASH_REPORT_FUNCTION;
+            // GNASH_REPORT_FUNCTION;
         }
                    
     void operator()(const GradientFill& g) const {
@@ -75,12 +75,11 @@ struct StyleHandler : boost::static_visitor<>
         const GradientFill::Type fill_type = g.type();
         OpenVGBitmap* binfo = new OpenVGBitmap(_vgpaint);
         if (fill_type ==  GradientFill::LINEAR) {
-            // All positions are specified in twips, which are 20 to the
-            // pixel. Use the display size for the extent of the shape, 
-            // as it'll get clipped by OpenVG at the end of the
-            // shape that is being filled with the gradient.
             const std::vector<gnash::GradientRecord> &records = g.getRecords();
             log_debug("Fill Style Type: Linear Gradient, %d records", 
records.size());
+            // Use the display size for the extent of the shape, 
+            // as it'll get clipped by OpenVG at the end of the
+            // shape that is being filled with the gradient.
             binfo->createLinearBitmap(_x, _y, width, height, _cxform, records, 
 _vgpaint);
         }
         if (fill_type == GradientFill::RADIAL) {
@@ -88,22 +87,24 @@ struct StyleHandler : boost::static_visitor<>
             const std::vector<gnash::GradientRecord> &records = g.getRecords();
             log_debug("Fill Style Type: Radial Gradient: focal is: %d, %d:%d",
                       focalpt, _x, _y);
-            // All positions are specified in twips, which are 20 to the
-            // pixel. Use the display size for the extent of the shape, 
-            // as it'll get clipped by OpenVG at the end of the
-            // shape that is being filled with the gradient.
             binfo->createRadialBitmap(_x, _y, width, height, focalpt,
                                       _cxform, records, _vgpaint);
         }
     }
 
     void operator()(const SolidFill& f) const {
-        const rgba color = _cxform.transform(f.color());
-
-        // add the color to our self-made style handler (basically
-        // just a list)
-        // _sh.add_color(agg::rgba8_pre(color.m_r, color.m_g, color.m_b,
-        //           color.m_a));
+        GNASH_REPORT_FUNCTION;
+        const rgba incolor = f.color();
+        rgba c = _cxform.transform(incolor);
+        VGfloat color[] = {
+            c.m_r / 255.0f,
+            c.m_g / 255.0f,
+            c.m_b / 255.0f,
+            c.m_a / 255.0f
+        };
+        
+        vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+        vgSetParameterfv (_vgpaint, VG_PAINT_COLOR, 4, color);
     }
 
     void operator()(const BitmapFill& b) const {

http://git.savannah.gnu.org/cgit//commit/?id=cf795342446a236d223af6fa69f78d1d6fd8f24d


commit cf795342446a236d223af6fa69f78d1d6fd8f24d
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 16:15:28 2011 -0600

    fix comments

diff --git a/librender/linear.as b/librender/linear.as
index 9855a22..721e664 100644
--- a/librender/linear.as
+++ b/librender/linear.as
@@ -16,17 +16,14 @@ alphas = [100, 100];
 ratios = [0, 255];
 
 // matrixType This value should always be "box".
-// x The x coordinate of the bottom-left corner of the gradient.
-// y The y coordinate of the bottom-left corner of the gradient.
-// width The width of the gradient in pixels.
-// height The height of the gradient in pixels.
-// r The rotation of the gradient in radians (not degrees).
+// x,y: are the left-upper corner of the square.
+// w,h are width and height that the square are going to be stretched to.
+// r is the rotation of the gradient field.
 //
 // For box type, the x should be the left margin, the y can be
-// anything. The w is calculated by right margin-left margin, the h
-// can be anything except 0. 
-// matrix = {matrixType:"box", x:150, y:200, w:350, h:200, r:0/180*Math.PI};
-matrix = {matrixType:"box", x:100, y:100, w:400, h:300, r:0};
+// anything. The w is calculated by right margin-left margin,
+// the h can be anything except 0. 
+matrix = {matrixType:"box", x:300, y:200, w:200, h:50, r:0/180*Math.PI};
 _root.lineStyle(1, 0x000000, 100);
 
 _root.beginGradientFill(fillType, colors, alphas, ratios, matrix);
@@ -42,10 +39,10 @@ _root.beginGradientFill(fillType, colors, alphas, ratios, 
matrix);
 
 // This is the dimensions of the big black box that is supposed to have
 // a linear gradient in it.
-x0 = 100; // 200 pixels = 4000 twips
-y0 = 100; // 200 pixels = 4000 twips
+x0 = 0; // 200 pixels = 4000 twips
+y0 = 0; // 200 pixels = 4000 twips
 x1 = 500; // 500 pixels = 10000 twips
-y1 = 500; // 400 pixels = 8000 twips
+y1 = 400; // 400 pixels = 8000 twips
 _root.moveTo(x0, y0);
 _root.lineTo(x1, y0);
 _root.lineTo(x1, y1);

http://git.savannah.gnu.org/cgit//commit/?id=8324688012fecf796c80850924a2ebabd94ec618


commit 8324688012fecf796c80850924a2ebabd94ec618
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 16:14:37 2011 -0600

    support bitmaps, improve gradient support

diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index b539c2e..3e543ef 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -814,6 +814,7 @@ Renderer_ovg::analyze_paths(const PathVec &paths, bool& 
have_shape,
     }    
 }
 
+#if 0
 void
 Renderer_ovg::apply_fill_style(const FillStyle& style, const SWFMatrix& /* mat 
*/,
                                const SWFCxForm& cx)
@@ -843,6 +844,9 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& /* mat *
       case SWF::FILL_TILED_BITMAP:
       {
           log_debug("Fill Style Type: Tiled Bitmap");
+          const StyleHandler st(mat, cx, _fillpaint,
+                                (*(refs[0])).ap.x, (*(refs[0])).ap.y);
+          boost::apply_visitor(st, fill_styles[i].fill);
           CachedBitmap *cb = boost::apply_visitor(GetBitmap(), style.fill);
           // Convert the GnashImage to a VG Image
           OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);
@@ -886,6 +890,7 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& /* mat *
       
     } // switch fill_type
 }
+#endif
 
 bool
 Renderer_ovg::apply_line_style(const LineStyle& style, const SWFCxForm& cx, 
@@ -1143,13 +1148,6 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
             continue;
         }
         
-        SWF::FillType fill_type = boost::apply_visitor(GetType(), 
fill_styles[i].fill);
-#if 0
-        if ((fill_type != SWF::FILL_LINEAR_GRADIENT)
-            && (fill_type != SWF::FILL_RADIAL_GRADIENT)) {
-            apply_fill_style(fill_styles[i], mat, cx);
-        }
-#endif
         std::list<PathPtrVec> contours = get_contours(paths);
         
         VGPath      vg_path;
@@ -1164,44 +1162,12 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
             const PathPtrVec& refs = *iter;
             
             startpath(vg_path, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
-            if (fill_type == SWF::FILL_LINEAR_GRADIENT) {
-#if 1
-                const StyleHandler st(mat, cx, _fillpaint,
-                                      (*(refs[0])).ap.x, (*(refs[0])).ap.y);
-                boost::apply_visitor(st, fill_styles[i].fill);
-#else
-//                rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
-                OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
-                // All positions are specified in twips, which are 20 to the
-                // pixel. Use th display size for the extent of the shape, 
-                // as it'll get clipped by OpenVG at the end of the
-                // shape that is being filled with the gradient.
-                const std::vector<gnash::GradientRecord> &records =
-                    boost::apply_visitor(GetGradientRecords(), 
fill_styles[i].fill);
-                // log_debug("Fill Style Type: Linear Gradient, %d records", 
records.size());
-                binfo->createLinearBitmap((*(refs[0])).ap.x, (*(refs[0])).ap.y,
-                                          _display_width * 20.0f,
-                                          (_display_height * 20.0f)/2, cx, 
-                                          records,  _fillpaint);
-#endif
-            }
-            if (fill_type == SWF::FILL_RADIAL_GRADIENT) {
-                rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
-                double focalpt = boost::apply_visitor(GetFocalPoint(), 
fill_styles[i].fill);
-                const std::vector<gnash::GradientRecord> &records =
-                    boost::apply_visitor(GetGradientRecords(), 
fill_styles[i].fill);
-                log_debug("Fill Style Type: Radial Gradient: focal is: %d, 
%d:%d",
-                          focalpt, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
-                OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
-                // All positions are specified in twips, which are 20 to the
-                // pixel. Use the display size for the extent of the shape, 
-                // as it'll get clipped by OpenVG at the end of the
-                // shape that is being filled with the gradient.
-                binfo->createRadialBitmap((*(refs[0])).ap.x, (*(refs[0])).ap.y,
-                                          (*(refs[0])).ap.x+1000,
-                                          (*(refs[0])).ap.y+1000, focalpt, cx,
-                                          records, _fillpaint);
-            }
+
+            // Create a Linear or Radial gradient
+            const StyleHandler st(cx, _fillpaint,
+                                  (*(refs[0])).ap.x/20, (*(refs[0])).ap.y/20);
+            boost::apply_visitor(st, fill_styles[i].fill);
+
             for (PathPtrVec::const_iterator it = refs.begin(), end = 
refs.end();
                  it != end; ++it) {
                 const Path& cur_path = *(*it);
@@ -1649,8 +1615,10 @@ Renderer_ovg::printVGPath(VGPath path)
 void
 Renderer_ovg::printVGMatrix(VGfloat *mat)
 {
-    std::cerr << "sx, shx, tx: " << mat[0] << ", " << mat[1]<< ", "  << mat[3] 
<< std::endl;
-    std::cerr << "sy, shy, ty: " << mat[4]<< ", " << mat[6] << ", "<< mat[7] 
<< std::endl;
+    std::cerr << "sx, shx, tx: " << mat[0] << ", " << mat[1]<< ", "
+              << std::fixed << mat[3] << std::endl;
+    std::cerr << "sy, shy, ty: " << mat[4]<< ", " << mat[6] << ", "
+              << std::scientific << mat[7] << std::endl;
 }
 
 void

http://git.savannah.gnu.org/cgit//commit/?id=1c84f03aab66abc1b9e7e08c7e719fe8ced91869


commit 1c84f03aab66abc1b9e7e08c7e719fe8ced91869
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 16:13:21 2011 -0600

    fix bitmap handling to work with StyleHandler. Remove all accessor style 
classes

diff --git a/librender/openvg/OpenVGBitmap.cpp 
b/librender/openvg/OpenVGBitmap.cpp
index 2decb10..1518ed2 100644
--- a/librender/openvg/OpenVGBitmap.cpp
+++ b/librender/openvg/OpenVGBitmap.cpp
@@ -17,6 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #include <boost/scoped_ptr.hpp>
+#include <iostream>
 
 #include "Geometry.h"
 #include "CachedBitmap.h"
@@ -45,7 +46,8 @@ OpenVGBitmap::OpenVGBitmap(VGPaint paint)
     _pixel_format(VG_sRGB_565),
 #endif
     _vgimage(VG_INVALID_HANDLE),
-    _vgpaint(paint)
+    _vgpaint(paint),
+    _aspect_ratio(0.75)       // 4:3 aspect ratio
 {
     // GNASH_REPORT_FUNCTION;
 }
@@ -62,7 +64,8 @@ OpenVGBitmap::OpenVGBitmap(CachedBitmap *bitmap, VGPaint 
vgpaint)
       _pixel_format(VG_sRGB_565),
 #endif
       _vgimage(VG_INVALID_HANDLE),
-      _vgpaint(vgpaint)
+      _vgpaint(vgpaint),
+      _aspect_ratio(0.75)       // 4:3 aspect ratio
 {
     // GNASH_REPORT_FUNCTION;
 
@@ -115,7 +118,8 @@ OpenVGBitmap::OpenVGBitmap(image::GnashImage *image, 
VGPaint vgpaint)
       _pixel_format(VG_sRGB_565),
 #endif
       _vgimage(VG_INVALID_HANDLE),
-      _vgpaint(vgpaint)
+      _vgpaint(vgpaint),
+      _aspect_ratio(0.75)       // 4:3 aspect ratio      
 {
     // GNASH_REPORT_FUNCTION;
 } 
@@ -148,23 +152,15 @@ OpenVGBitmap::~OpenVGBitmap()
 // x1,y1 is the focal point that is forced to be in the circle.
 OpenVGBitmap *
 OpenVGBitmap::createRadialBitmap(float cx, float cy, float fx, float fy,
-                                 float radial, const rgba &incolor,
+                                 float radial, const SWFCxForm& cxform,
                                  const GradientFill::GradientRecords &records,
-                                 const SWFCxForm& /* cxform */,
                                  VGPaint paint)
 {
-    // GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
 
-    VGfloat color[] = {
-        incolor.m_r / 255.0f,
-        incolor.m_g / 255.0f,
-        incolor.m_b / 255.0f,
-        incolor.m_a / 255.0f
-    };
-    vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
-    vgSetParameterfv (paint, VG_PAINT_COLOR, 4, color);
-    
     VGfloat rgParams[] = { cx, cy, fx, fy, radial };
+    std::cerr << "Radial params are: " << cx << ", " << cy << ", "
+              << fx << ", " << fy << std::endl;
     
     // Paint Type 
     vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT);
@@ -177,10 +173,11 @@ OpenVGBitmap::createRadialBitmap(float cx, float cy, 
float fx, float fy,
     VGfloat ramps[entries];
     int j = 0;
     for (size_t i=0; i!= records.size(); ++i) {
-        // std::cerr << "The record is: " << records[i].ratio/255.0f;
+        std::cerr << "The record is: " << records[i].ratio/255.0f
+                  << "(" <<  records[i].ratio << ")";
         rgba c = records[i].color;
-        // std::cerr << ", " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", "
-        //           << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
+        std::cerr << ", " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", "
+                  << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
         // The set of 5 for each record is simply: { Offset, R, G, B, A }
         ramps[j++] = records[i].ratio/255.0f;
         ramps[j++] = c.m_r / 255.0f;
@@ -209,32 +206,22 @@ OpenVGBitmap::createRadialBitmap(float cx, float cy, 
float fx, float fy,
 /// clipped at the boundary instead of x1,y1.
 OpenVGBitmap *
 OpenVGBitmap::createLinearBitmap(float x0, float y0, float x1, float y1,
-                                 const rgba &incolor,
+                                 const SWFCxForm& cxform,
                                  const GradientFill::GradientRecords &records,
-                                 const SWFCxForm& cxform,                      
           
                                  const VGPaint paint)
 {
-    // GNASH_REPORT_FUNCTION;
-
-    rgba nc = cxform.transform(incolor);
-
-    VGfloat color[] = {
-        nc.m_r / 255.0f,
-        nc.m_g / 255.0f,
-        nc.m_b / 255.0f,
-        nc.m_a / 255.0f
-    };
-    vgSetParameteri (paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
-    vgSetParameterfv (paint, VG_PAINT_COLOR, 4, color);
-
+    GNASH_REPORT_FUNCTION;
+    
     vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT);
     vgSetParameteri(paint, VG_PAINT_COLOR_RAMP_SPREAD_MODE,
-                    VG_COLOR_RAMP_SPREAD_PAD);
+                           VG_COLOR_RAMP_SPREAD_PAD);
 
     // This is the origin and size of the gradient
     VGfloat linearGradient[4] = { x0, y0, x1, y1 };
     vgSetParameterfv(paint, VG_PAINT_LINEAR_GRADIENT, 4, linearGradient);
-
+    std::cerr << "Linear params are: " << x0 << ", " << y0 << ", "
+              << x1 << ", " << y1 << std::endl;
+    
     // The application defines the non-premultiplied sRGBA color and alpha 
value
     // associated with each of a number of values, called stops.
     // A stop is defined by an offset between 0 and 1, inclusive, and a color 
value.
@@ -250,10 +237,10 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0, 
float x1, float y1,
     VGfloat ramps[entries];
     int j = 0;
     for (size_t i=0; i!= records.size(); ++i) {
-        // std::cerr << "The record is: " << records[i].ratio/255.0f;
+        std::cerr << "The record ratio is: " << records[i].ratio/255.0f;
         rgba c = cxform.transform(records[i].color);
-        // std::cerr << ", " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", "
-        //           << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
+        std::cerr << "; color: " << c.m_r/255.0f << ", " << c.m_g/255.0f << ", 
"
+                  << c.m_b/255.0f << ", " << c.m_a/255.0f << std::endl;
         // The set of 5 for each record is simply: { Offset, R, G, B, A }
         ramps[j++] = records[i].ratio/255.0f;
         ramps[j++] = c.m_r / 255.0f;
@@ -261,7 +248,15 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0, float 
x1, float y1,
         ramps[j++] = c.m_b / 255.0f;
         ramps[j++] = c.m_a / 255.0f;
     }
+#if 1
     vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, entries, ramps);
+#else
+    VGfloat rampStop[] = {0.00f, 1.0f, 1.0f, 1.0f, 1.0f,
+                          0.33f, 1.0f, 0.0f, 0.0f, 1.0f,
+                          0.66f, 0.0f, 1.0f, 0.0f, 1.0f,
+                          1.00f, 0.0f, 0.0f,  1.0f, 1.0f};
+    vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, 20, rampStop);
+#endif
     
     return this;
 }
@@ -273,37 +268,60 @@ OpenVGBitmap::createLinearBitmap(float x0, float y0, 
float x1, float y1,
 /// @param paint The VG paint context
 /// @return A pointer to the new Bitmap
 OpenVGBitmap *
-OpenVGBitmap::applyPatternBitmap(const gnash::SWFMatrix& matrix,
-                                 bitmap_wrap_mode mode, VGPaint paint)
+OpenVGBitmap::applyPatternBitmap(const gnash::SWFMatrix& mat,
+                                 bitmap_wrap_mode mode,
+                                 CachedBitmap *bitmap, VGPaint paint)
 {
     // GNASH_REPORT_FUNCTION;
 
+    // extract a reference to the image from the cached bitmap
+    image::GnashImage &im = bitmap->image();
+    
+    // Create a VG image
+    _vgimage = vgCreateImage(_pixel_format, im.width(), im.height(),
+                             VG_IMAGE_QUALITY_FASTER);    
     if (_vgimage == VG_INVALID_HANDLE) {
-        log_error("No VG image to paint! %s",
+        log_error("Failed to create VG image! %s",
                   Renderer_ovg::getErrorString(vgGetError()));
-        return 0;
     }
-
-    _vgpaint = paint;
-        
+    
+    switch (im.type()) {
+    case image::TYPE_RGB:
+        log_debug("Image has RGB Pixel Format, Stride is %d, width is %d, 
height is %d",
+                  im.stride(), im.width(), im.height());
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBX_8888,
+                   0, 0, im.width(), im.height());
+        break;
+    case image::TYPE_RGBA:
+        log_debug("Image has RGBA Pixel Format, Stride is %d, width is %d, 
height is %d",
+                  im.stride(), im.width(), im.height());
+        // Copy the image data into the VG image container
+        vgImageSubData(_vgimage, im.begin(), im.stride(), VG_sRGBA_8888,
+                   0, 0, im.width(), im.height());
+        break;
+    default:
+        std::abort();
+    }
+    
     vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
 
-    gnash::SWFMatrix mat;
     VGfloat     vmat[9];
     
-    // Paint the cached VG image into the VG paint surface
-    mat = matrix;
-    mat.invert();
+    // Adjust the X scale by the aspect ratio or images get squished
+    //sm.a() = sm.a() * _aspect_ratio;
+    SWFMatrix nsm(mat.a() * 0.75, mat.b(), mat.c(),
+                  mat.d(), mat.tx(), mat.ty());
+    nsm.invert();
     // Renderer_ovg::printVGMatrix(matrix);
     
     memset(vmat, 0, sizeof(vmat));
     // Convert from fixed point to floating point
-    vmat[0] = mat.a() / 65536.0f;
-    vmat[1] = mat.b() / 65536.0f;
-    vmat[3] = mat.c() / 65536.0f;
-    vmat[4] = mat.d() / 65536.0f;
-    vmat[6] = mat.tx();
-    vmat[7] = mat.ty();
+    vmat[0] = nsm.a() / 65536.0f;
+    vmat[1] = nsm.b() / 65536.0f;
+    vmat[3] = nsm.c() / 65536.0f;
+    vmat[4] = nsm.d() / 65536.0f;
+    vmat[6] = nsm.tx();
+    vmat[7] = nsm.ty();
     
     // Renderer_ovg::printVGMatrix(vmat);
     
diff --git a/librender/openvg/OpenVGBitmap.h b/librender/openvg/OpenVGBitmap.h
index b5c1343..8f95850 100644
--- a/librender/openvg/OpenVGBitmap.h
+++ b/librender/openvg/OpenVGBitmap.h
@@ -63,25 +63,24 @@ public:
     boost::uint8_t *getData() const { return _image->begin(); }
 
     OpenVGBitmap *createRadialBitmap(float x0, float y0, float x1, float y1,
-                                     float radial, const rgba &incolor,
+                                     float radial, const SWFCxForm& cx,
                                      const GradientFill::GradientRecords 
&records,
-                                     const SWFCxForm& cx,
                                      VGPaint paint);
     OpenVGBitmap *createLinearBitmap(float x0, float y0, float x1, float y1,
-                                     const rgba &incolor,
-                                     const GradientFill::GradientRecords 
&records,
                                      const SWFCxForm& cx,
+                                     const GradientFill::GradientRecords 
&records,
                                      const VGPaint paint);
 
     OpenVGBitmap *applyPatternBitmap(const gnash::SWFMatrix& matrix,
-                                      bitmap_wrap_mode mode, VGPaint paint);
+                                     bitmap_wrap_mode mode,
+                                     CachedBitmap *bitmap, VGPaint paint);
     
 private:
     boost::scoped_ptr<image::GnashImage> _image;
     VGImageFormat   _pixel_format;
     VGImage         _vgimage;
     VGPaint         _vgpaint;
-//    int             _tex_size;
+    double          _aspect_ratio;
 };
 
 } // namespace gnash::renderer::openvg
diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index 34ccbd9..482a18b 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -25,7 +25,7 @@
 #include "FillStyle.h"
 #include "SWFCxForm.h"
 #include "SWFMatrix.h"
-#include "OpenVGBitmap.h"
+#include "openvg/OpenVGBitmap.h"
 
 namespace gnash {
 
@@ -40,29 +40,6 @@ namespace renderer {
 
 namespace openvg {
 
-#if 0
-// Forward declarations.
-namespace {
-    /// Creates 8 bitmap functions
-    template<typename FillMode, typename Pixel>
-            void storeBitmap(StyleHandler& st, const OpenVGBitmap* bi,
-            const SWFMatrix& mat, const SWFCxForm& cx,
-            bool smooth);
-    template<typename FillMode> void storeBitmap(StyleHandler& st,
-            const OpenVGBitmap* bi, const SWFMatrix& mat, const SWFCxForm& cx,
-            bool smooth);
-
-    /// Creates many (should be 18) gradient functions.
-    void storeGradient(StyleHandler& st, const GradientFill& fs,
-            const SWFMatrix& mat, const SWFCxForm& cx);
-    template<typename Spread> void storeGradient(StyleHandler& st,
-            const GradientFill& fs, const SWFMatrix& mat, const SWFCxForm& cx);
-    template<typename Spread, typename Interpolation>
-            void storeGradient(StyleHandler& st, const GradientFill& fs,
-            const SWFMatrix& mat, const SWFCxForm& cx);
-}
-#endif
-
 /// @note These helper functions are used by the boost::variant used
 /// for fill styles. A variant is a C++ style version of the C union.
 /// Before accessing any of the data of the variant, we have to use
@@ -72,17 +49,15 @@ namespace {
 /// Transfer FillStyles to OpenVG styles.
 struct StyleHandler : boost::static_visitor<>
 {
-    StyleHandler(const SWFMatrix& mat, const SWFCxForm& cx,
+    StyleHandler(const SWFCxForm& cx,
                  const VGPaint &p, float x, float y)
-        : _matrix(mat),
-          _cxform(cx),
+        : _cxform(cx),
           _vgpaint(p),
           _x(x),
           _y(y)
         {
             GNASH_REPORT_FUNCTION;
         }
-
                    
     void operator()(const GradientFill& g) const {
         GNASH_REPORT_FUNCTION;
@@ -97,16 +72,6 @@ struct StyleHandler : boost::static_visitor<>
         //
         int width = 800;
         int height = 480;
-#if 0
-        float inv_width = 1.0f / width;
-        float inv_height = 1.0f / height;
-        float p[4] = { 0, 0, 0, 0 };
-        p[0] = mat.a() / 65536.0f * inv_width;
-        p[1] = mat.c() / 65536.0f * inv_width;
-        p[3] = mat.tx() * inv_width;
-#endif
-        std::cerr << "X=" << _x << ", Y=" << _y << std::endl;
-
         const GradientFill::Type fill_type = g.type();
         OpenVGBitmap* binfo = new OpenVGBitmap(_vgpaint);
         if (fill_type ==  GradientFill::LINEAR) {
@@ -122,12 +87,12 @@ struct StyleHandler : boost::static_visitor<>
             float focalpt = g.focalPoint();
             const std::vector<gnash::GradientRecord> &records = g.getRecords();
             log_debug("Fill Style Type: Radial Gradient: focal is: %d, %d:%d",
-                      focalpt, 200.0f, 200.0f);
+                      focalpt, _x, _y);
             // All positions are specified in twips, which are 20 to the
             // pixel. Use the display size for the extent of the shape, 
             // as it'll get clipped by OpenVG at the end of the
             // shape that is being filled with the gradient.
-            binfo->createRadialBitmap(200.0f, 200.0f, 200.0f, 200.0f, 100,
+            binfo->createRadialBitmap(_x, _y, width, height, focalpt,
                                       _cxform, records, _vgpaint);
         }
     }
@@ -141,166 +106,37 @@ struct StyleHandler : boost::static_visitor<>
         //           color.m_a));
     }
 
-    void operator()(const BitmapFill& f) const {
+    void operator()(const BitmapFill& b) const {
+        GNASH_REPORT_FUNCTION;
         // OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);          
-        SWFMatrix m = f.matrix();
-        
-        const bool tiled = (f.type() == BitmapFill::TILED);
-
-        const CachedBitmap* bm = f.bitmap(); 
-
-        if (!bm) {
+        SWFMatrix mat = b.matrix();
+        const bool type = b.type();
+        //const CachedBitmap *bm = b.bitmap();
+        CachedBitmap *cb = const_cast<CachedBitmap *>(b.bitmap());
+        OpenVGBitmap* binfo = new OpenVGBitmap(_vgpaint);
+        if (!cb) {
             // See misc-swfmill.all/missing_bitmap.swf
             // _sh.add_color(agg::rgba8_pre(255,0,0,255));
-        } else if ( bm->disposed() ) {
+        } else if ( cb->disposed() ) {
             // See misc-ming.all/BeginBitmapFill.swf
             // _sh.add_color(agg::rgba8_pre(0,0,0,0));
-        // } else {
-            // _sh.add_bitmap(dynamic_cast<const agg_bitmap_info*>(bm),
-            //                m, _cx, tiled, smooth);
+        } else {
+            if (type == BitmapFill::TILED) {
+                binfo->applyPatternBitmap(mat, OpenVGBitmap::WRAP_REPEAT,
+                                          cb, _vgpaint);
+            } else if (type == BitmapFill::CLIPPED) {
+                binfo->applyPatternBitmap(mat, OpenVGBitmap::WRAP_PAD,
+                                          cb, _vgpaint);
+            }
         }
     }
     
 private:
-    const SWFMatrix& _matrix;
     const SWFCxForm& _cxform;
     const VGPaint&   _vgpaint;
     float            _x;
     float            _y;
-};
-    
-/// Get the color of a style from the variant
-class GetColor : public boost::static_visitor<rgba>
-{
-public:
-    rgba operator()(const SolidFill& f) const {
-        return f.color();
-    }
-    rgba operator()(const GradientFill&) const {
-        return rgba();
-    }
-    rgba operator()(const BitmapFill&) const {
-        return rgba();
-    }
-};
-
-/// Get the fill type. Each fill type has it's own sub types,
-/// so we map the sub type name to the fill type name.
-class GetType : public boost::static_visitor<SWF::FillType>
-{
-public:
-    SWF::FillType operator()(const SolidFill&) const {
-        return SWF::FILL_SOLID;
-    }
-    SWF::FillType operator()(const GradientFill& g) const {
-        switch (g.type()) {
-          case GradientFill::LINEAR:
-              return SWF::FILL_LINEAR_GRADIENT;
-              break;
-          case GradientFill::RADIAL:
-              return SWF::FILL_RADIAL_GRADIENT;
-              break;
-          default:
-              break;              
-        }
-    }
-    SWF::FillType operator()(const BitmapFill& b) const {
-        switch (b.type()) {
-          case BitmapFill::TILED:
-              if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
-                  return SWF::FILL_TILED_BITMAP_HARD;
-              } else {
-                  return SWF::FILL_TILED_BITMAP;
-              }
-              break;
-          case BitmapFill::CLIPPED:
-              if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
-                  return SWF::FILL_CLIPPED_BITMAP_HARD;
-              } else {
-                  return SWF::FILL_CLIPPED_BITMAP;
-              }
-              break;
-          default:
-              break;
-        }
-    }
-};
-
-/// Get the bitmap data of a style from the variant
-class GetBitmap : public boost::static_visitor<CachedBitmap *>
-{
-public:
-    CachedBitmap *operator()(const SolidFill&) const {
-        return 0;
-    }
-    CachedBitmap *operator()(const GradientFill&) const {
-        return 0;
-    }
-    CachedBitmap *operator()(const BitmapFill& b) const {
-        return const_cast<CachedBitmap *>(b.bitmap());
-    }
-};
-
-/// Get the image from style variant
-class GetImage : public boost::static_visitor<image::GnashImage *>
-{
-public:
-    image::GnashImage *operator()(const SolidFill&) const {
-        return 0;
-    }
-    image::GnashImage *operator()(const GradientFill&) const {
-        return 0;
-    }
-    image::GnashImage *operator()(const BitmapFill& b) const {
-        CachedBitmap *cb = const_cast<CachedBitmap *>(b.bitmap());
-        image::GnashImage &im = cb->image();
-//      image::GnashImage::const_iterator it = const_cast<CachedBitmap 
*>(cb)->image().begin();
-        return &im;
-    }
-};
-
-/// Get the matrix of a style from the variant
-class GetMatrix : public boost::static_visitor<SWFMatrix>
-{
-public:
-    SWFMatrix operator()(const SolidFill&) const {
-    }
-    SWFMatrix operator()(const GradientFill& g) const {
-        return g.matrix();
-    }
-    SWFMatrix operator()(const BitmapFill& b) const {
-        return b.matrix();
-    }
-};
-
-/// GradientFills have more data we need to construct the gradient.
-
-/// Return the focal point of a radial gradient
-class GetFocalPoint : public boost::static_visitor<double>
-{
-public:
-    double operator()(const SolidFill&) const {
-        return 0.0f;
-    }
-    double operator()(const GradientFill& g) const {
-        return g.focalPoint();
-    }
-    double operator()(const BitmapFill&) const {
-        return 0.0f;
-    }
-};
-
-/// Return the records in the gradient
-class GetGradientRecords : public boost::static_visitor<const 
GradientFill::GradientRecords &>
-{
-public:
-    const GradientFill::GradientRecords &operator()(const SolidFill&) const {
-    }
-    const GradientFill::GradientRecords &operator()(const GradientFill& fs) 
const {
-        return fs.getRecords();
-    }
-    const GradientFill::GradientRecords &operator()(const BitmapFill&) const {
-    }
+//    OpenVGBitmap::bitmap_wrap_mode _mode;
 };
 
 } // namespace gnash::renderer::openvg

http://git.savannah.gnu.org/cgit//commit/?id=464fb6913b0161a63e7c2ca79d870f68c8f60efe


commit 464fb6913b0161a63e7c2ca79d870f68c8f60efe
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 10:49:50 2011 -0600

    use StyleHandler for gradients

diff --git a/librender/openvg/OpenVGRenderer.cpp 
b/librender/openvg/OpenVGRenderer.cpp
index c253a6f..b539c2e 100644
--- a/librender/openvg/OpenVGRenderer.cpp
+++ b/librender/openvg/OpenVGRenderer.cpp
@@ -1144,11 +1144,12 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
         }
         
         SWF::FillType fill_type = boost::apply_visitor(GetType(), 
fill_styles[i].fill);
+#if 0
         if ((fill_type != SWF::FILL_LINEAR_GRADIENT)
             && (fill_type != SWF::FILL_RADIAL_GRADIENT)) {
             apply_fill_style(fill_styles[i], mat, cx);
         }
-
+#endif
         std::list<PathPtrVec> contours = get_contours(paths);
         
         VGPath      vg_path;
@@ -1164,7 +1165,12 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
             
             startpath(vg_path, (*(refs[0])).ap.x, (*(refs[0])).ap.y);
             if (fill_type == SWF::FILL_LINEAR_GRADIENT) {
-                rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
+#if 1
+                const StyleHandler st(mat, cx, _fillpaint,
+                                      (*(refs[0])).ap.x, (*(refs[0])).ap.y);
+                boost::apply_visitor(st, fill_styles[i].fill);
+#else
+//                rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
                 OpenVGBitmap* binfo = new OpenVGBitmap(_fillpaint);
                 // All positions are specified in twips, which are 20 to the
                 // pixel. Use th display size for the extent of the shape, 
@@ -1174,8 +1180,10 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
                     boost::apply_visitor(GetGradientRecords(), 
fill_styles[i].fill);
                 // log_debug("Fill Style Type: Linear Gradient, %d records", 
records.size());
                 binfo->createLinearBitmap((*(refs[0])).ap.x, (*(refs[0])).ap.y,
-                                          _display_width * 20.0f, 
(_display_height * 20.0f)/2,
-                                          incolor, records, cx, _fillpaint);
+                                          _display_width * 20.0f,
+                                          (_display_height * 20.0f)/2, cx, 
+                                          records,  _fillpaint);
+#endif
             }
             if (fill_type == SWF::FILL_RADIAL_GRADIENT) {
                 rgba incolor = boost::apply_visitor(GetColor(), 
fill_styles[i].fill);
@@ -1190,8 +1198,9 @@ Renderer_ovg::draw_subshape(const PathVec& path_vec,
                 // as it'll get clipped by OpenVG at the end of the
                 // shape that is being filled with the gradient.
                 binfo->createRadialBitmap((*(refs[0])).ap.x, (*(refs[0])).ap.y,
-                                          (*(refs[0])).ap.x+1000, 
(*(refs[0])).ap.y+1000, focalpt,
-                                          incolor, records, cx, _fillpaint);
+                                          (*(refs[0])).ap.x+1000,
+                                          (*(refs[0])).ap.y+1000, focalpt, cx,
+                                          records, _fillpaint);
             }
             for (PathPtrVec::const_iterator it = refs.begin(), end = 
refs.end();
                  it != end; ++it) {

http://git.savannah.gnu.org/cgit//commit/?id=5839fb5e3eb2646b61c0ed16b9794df7e94f500e


commit 5839fb5e3eb2646b61c0ed16b9794df7e94f500e
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 10:48:48 2011 -0600

    tweak privates & constructor. Implement linear gradients

diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
index d048fa5..34ccbd9 100644
--- a/librender/openvg/OpenVGStyle.h
+++ b/librender/openvg/OpenVGStyle.h
@@ -25,19 +25,22 @@
 #include "FillStyle.h"
 #include "SWFCxForm.h"
 #include "SWFMatrix.h"
+#include "OpenVGBitmap.h"
 
 namespace gnash {
 
+// Forward declarations.
 class SolidFill;
 class GradientFill;
 class BitmapFill;
 class rgba; 
 class StyleHandler;
- 
+
 namespace renderer {
 
 namespace openvg {
 
+#if 0
 // Forward declarations.
 namespace {
     /// Creates 8 bitmap functions
@@ -58,6 +61,7 @@ namespace {
             void storeGradient(StyleHandler& st, const GradientFill& fs,
             const SWFMatrix& mat, const SWFCxForm& cx);
 }
+#endif
 
 /// @note These helper functions are used by the boost::variant used
 /// for fill styles. A variant is a C++ style version of the C union.
@@ -66,28 +70,70 @@ namespace {
 /// to extract the data.
 
 /// Transfer FillStyles to OpenVG styles.
-struct OpenVGStyles : boost::static_visitor<>
+struct StyleHandler : boost::static_visitor<>
 {
-    OpenVGStyles(SWFMatrix stage, SWFMatrix fill, const SWFCxForm& c,
-                 StyleHandler& sh, Quality q)
-        : _stageMatrix(stage.invert()),
-          _fillMatrix(fill.invert()),
-          _cx(c),
-          _sh(sh),
-          _quality(q)
+    StyleHandler(const SWFMatrix& mat, const SWFCxForm& cx,
+                 const VGPaint &p, float x, float y)
+        : _matrix(mat),
+          _cxform(cx),
+          _vgpaint(p),
+          _x(x),
+          _y(y)
         {
             GNASH_REPORT_FUNCTION;
         }
-    
-    void operator()(const GradientFill& f) const {
-        SWFMatrix m = f.matrix();
-        m.concatenate(_fillMatrix);
-        m.concatenate(_stageMatrix);
-        storeGradient(_sh, f, m, _cx);
+
+                   
+    void operator()(const GradientFill& g) const {
+        GNASH_REPORT_FUNCTION;
+        SWFMatrix mat = g.matrix();
+        Renderer_ovg::printVGMatrix(mat);
+        //      from OpenVG specification PDF
+        //
+        //          dx(x - x0) + dy((y - y0)
+        // g(x,y) = ------------------------
+        //                dx^2 + dy^2
+        // where dx = x1 - x0, dy = y1 - y0
+        //
+        int width = 800;
+        int height = 480;
+#if 0
+        float inv_width = 1.0f / width;
+        float inv_height = 1.0f / height;
+        float p[4] = { 0, 0, 0, 0 };
+        p[0] = mat.a() / 65536.0f * inv_width;
+        p[1] = mat.c() / 65536.0f * inv_width;
+        p[3] = mat.tx() * inv_width;
+#endif
+        std::cerr << "X=" << _x << ", Y=" << _y << std::endl;
+
+        const GradientFill::Type fill_type = g.type();
+        OpenVGBitmap* binfo = new OpenVGBitmap(_vgpaint);
+        if (fill_type ==  GradientFill::LINEAR) {
+            // All positions are specified in twips, which are 20 to the
+            // pixel. Use the display size for the extent of the shape, 
+            // as it'll get clipped by OpenVG at the end of the
+            // shape that is being filled with the gradient.
+            const std::vector<gnash::GradientRecord> &records = g.getRecords();
+            log_debug("Fill Style Type: Linear Gradient, %d records", 
records.size());
+            binfo->createLinearBitmap(_x, _y, width, height, _cxform, records, 
 _vgpaint);
+        }
+        if (fill_type == GradientFill::RADIAL) {
+            float focalpt = g.focalPoint();
+            const std::vector<gnash::GradientRecord> &records = g.getRecords();
+            log_debug("Fill Style Type: Radial Gradient: focal is: %d, %d:%d",
+                      focalpt, 200.0f, 200.0f);
+            // All positions are specified in twips, which are 20 to the
+            // pixel. Use the display size for the extent of the shape, 
+            // as it'll get clipped by OpenVG at the end of the
+            // shape that is being filled with the gradient.
+            binfo->createRadialBitmap(200.0f, 200.0f, 200.0f, 200.0f, 100,
+                                      _cxform, records, _vgpaint);
+        }
     }
 
     void operator()(const SolidFill& f) const {
-        const rgba color = _cx.transform(f.color());
+        const rgba color = _cxform.transform(f.color());
 
         // add the color to our self-made style handler (basically
         // just a list)
@@ -96,62 +142,31 @@ struct OpenVGStyles : boost::static_visitor<>
     }
 
     void operator()(const BitmapFill& f) const {
+        // OpenVGBitmap *binfo = new OpenVGBitmap(cb, _fillpaint);          
         SWFMatrix m = f.matrix();
-        m.concatenate(_fillMatrix);
-        m.concatenate(_stageMatrix);
-
-        // Smoothing policy:
-        //
-        // - If unspecified, smooth when _quality >= BEST
-        // - If ON or forced, smooth when _quality > LOW
-        // - If OFF, don't smooth
-        //
-        // TODO: take a forceBitmapSmoothing parameter.
-        //       which should be computed by the VM looking
-        //       at MovieClip.forceSmoothing.
-        bool smooth = false;
-        if (_quality > QUALITY_LOW) {
-            // TODO: if forceSmoothing is true, smooth !
-            switch (f.smoothingPolicy()) {
-                case BitmapFill::SMOOTHING_UNSPECIFIED:
-                    if (_quality >= QUALITY_BEST) {
-                        smooth = true;
-                    }
-                    break;
-                case BitmapFill::SMOOTHING_ON:
-                    smooth = true;
-                    break;
-                default: break;
-            }
-        }
-
+        
         const bool tiled = (f.type() == BitmapFill::TILED);
 
         const CachedBitmap* bm = f.bitmap(); 
 
-#if 0
         if (!bm) {
             // See misc-swfmill.all/missing_bitmap.swf
-            _sh.add_color(agg::rgba8_pre(255,0,0,255));
+            // _sh.add_color(agg::rgba8_pre(255,0,0,255));
         } else if ( bm->disposed() ) {
             // See misc-ming.all/BeginBitmapFill.swf
-            _sh.add_color(agg::rgba8_pre(0,0,0,0));
-        } else {
-            _sh.add_bitmap(dynamic_cast<const agg_bitmap_info*>(bm),
-                           m, _cx, tiled, smooth);
+            // _sh.add_color(agg::rgba8_pre(0,0,0,0));
+        // } else {
+            // _sh.add_bitmap(dynamic_cast<const agg_bitmap_info*>(bm),
+            //                m, _cx, tiled, smooth);
         }
-#endif
     }
     
 private:
-    /// The inverted stage matrix.
-    const SWFMatrix _stageMatrix;
-    
-    /// The inverted fill matrix.
-    const SWFMatrix _fillMatrix;
-    const SWFCxForm& _cx;
-    StyleHandler& _sh;
-    const Quality _quality;
+    const SWFMatrix& _matrix;
+    const SWFCxForm& _cxform;
+    const VGPaint&   _vgpaint;
+    float            _x;
+    float            _y;
 };
     
 /// Get the color of a style from the variant
@@ -288,7 +303,6 @@ public:
     }
 };
 
-
 } // namespace gnash::renderer::openvg
 } // namespace gnash::renderer
 } // namespace gnash

http://git.savannah.gnu.org/cgit//commit/?id=1a19d557b6dabeb8e5ea619a6a1c393d56b31525


commit 1a19d557b6dabeb8e5ea619a6a1c393d56b31525
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 10:43:05 2011 -0600

    remove extra blank lines

diff --git a/librender/opengl/Renderer_ogl.cpp 
b/librender/opengl/Renderer_ogl.cpp
index a7d3cb9..eae25ac 100644
--- a/librender/opengl/Renderer_ogl.cpp
+++ b/librender/opengl/Renderer_ogl.cpp
@@ -1405,8 +1405,6 @@ public:
       boost::apply_visitor(st, style.fill);
   }
   
-  
-  
   bool apply_line_style(const LineStyle& style, const SWFCxForm& cx, const 
SWFMatrix& mat)
   {
   //  GNASH_REPORT_FUNCTION;

http://git.savannah.gnu.org/cgit//commit/?id=e31b5d8dc66f687fc0df9c69cec272c65b62190b


commit e31b5d8dc66f687fc0df9c69cec272c65b62190b
Author: Rob Savoye <address@hidden>
Date:   Wed Aug 31 10:42:44 2011 -0600

    add comments, tweak dimensions for debugging.

diff --git a/librender/linear.as b/librender/linear.as
index 93f6c4d..9855a22 100644
--- a/librender/linear.as
+++ b/librender/linear.as
@@ -1,14 +1,36 @@
+// "linear" or "radial"
 fillType = "linear";
+// The maximum possible number of colors you can use is 15.
 colors = [0xFF0000, 0x0000FF];
+// the transparency of colors you defined in the previous
+// parameter. The possible values range from 0 (completely
+// transparent) to 100 (completely opaque). If you specify a value
+// less then 0, Flash will use 0. If you enter a value greater than
+// 100, Flash will use 100. It makes sense, because you can’t have
+// something more transparent than alpha put at 0, beacuse a color or
+// a drawing with alpha 0 is invisible.
 alphas = [100, 100];
+// The ratio defines where in your gradient the color it is associated
+// with is at its 100% value. Or, the place where that color is pure
+// and hasn’t started mixing with the other color(s) yet.
 ratios = [0, 255];
 
-// This appears to be a "box" within the gradient, that effects how
-// wide the color stripes are.
-matrix = {matrixType:"box", x:150, y:200, w:500, h:200, r:0/180*Math.PI};
+// matrixType This value should always be "box".
+// x The x coordinate of the bottom-left corner of the gradient.
+// y The y coordinate of the bottom-left corner of the gradient.
+// width The width of the gradient in pixels.
+// height The height of the gradient in pixels.
+// r The rotation of the gradient in radians (not degrees).
+//
+// For box type, the x should be the left margin, the y can be
+// anything. The w is calculated by right margin-left margin, the h
+// can be anything except 0. 
+// matrix = {matrixType:"box", x:150, y:200, w:350, h:200, r:0/180*Math.PI};
+matrix = {matrixType:"box", x:100, y:100, w:400, h:300, r:0};
 _root.lineStyle(1, 0x000000, 100);
 
 _root.beginGradientFill(fillType, colors, alphas, ratios, matrix);
+
 //             X (200)                  W (150)
 //             |                        |
 // (x0, y0) 200,200------------------500,200 (x1, y0)
@@ -20,10 +42,10 @@ _root.beginGradientFill(fillType, colors, alphas, ratios, 
matrix);
 
 // This is the dimensions of the big black box that is supposed to have
 // a linear gradient in it.
-x0 = 200; // 200 pixels = 4000 twips
-y0 = 200; // 200 pixels = 4000 twips
+x0 = 100; // 200 pixels = 4000 twips
+y0 = 100; // 200 pixels = 4000 twips
 x1 = 500; // 500 pixels = 10000 twips
-y1 = 400; // 400 pixels = 8000 twips
+y1 = 500; // 400 pixels = 8000 twips
 _root.moveTo(x0, y0);
 _root.lineTo(x1, y0);
 _root.lineTo(x1, y1);

http://git.savannah.gnu.org/cgit//commit/?id=80d620aa50a82f0159ab3d174e2c089667ca1ffc


commit 80d620aa50a82f0159ab3d174e2c089667ca1ffc
Author: Rob Savoye <address@hidden>
Date:   Mon Aug 22 14:50:22 2011 -0600

    don't build the fb gui nor EGL by default, only if openvg is soecified.

diff --git a/configure.ac b/configure.ac
index 14e7f39..d26c753 100644
--- a/configure.ac
+++ b/configure.ac
@@ -626,7 +626,7 @@ AC_ARG_ENABLE(gui,
     fi
   done],
   [ dnl Run the following code if no --enable-gui is given
-  build_fb=auto
+  build_fb=no
   build_sdl=auto
   if test x"${openbsd}" = xyes; then
     build_gtk=yes
@@ -996,120 +996,6 @@ if test x"${build_ovg}" = xyes; then
   fi
 fi
 
-dnl 16 bit: RGB555, RGB565
-dnl 24 bit: RGB24, BGR24
-dnl 32 bit: RGBA32, BGRA32
-pixelformat=all
-AC_ARG_WITH(pixelformat,
-  AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for 
AGG (default=all)]),
-  [if test -n ${withval}; then
-    pixelformat="${withval}"
-    withval=`echo ${withval} | tr '\054' ' ' `
-  fi
-  while test -n "${withval}" ; do
-    val=`echo ${withval} | cut -d ' ' -f 1`
-    case "${val}" in
-      all)
-        # allow special value "all" set by user (handled below)
-        ;; 
-      argb32|ARGB32)
-        AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
-        ;;
-      abgr32|ABGR32)
-        AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
-        ;;
-      bgra32|BGRA32)
-        AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
-        ;;
-      bgr24|BGR24)
-        AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
-        ;;
-      rgba32|RGBA32)
-        AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
-        ;;
-      rgb24|RGB24)
-        AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
-        ;;
-      rgb555|RGB555)
-        AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
-        ;;
-      rgb565|RGB565)
-        AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
-        ;;
-      *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: 
all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
-         ;;
-      esac
-    withval=`echo ${withval} | cut -d ' ' -f 2-6`
-    if test "x$val" = "x$withval"; then
-      break;
-    fi
-  done],
-  [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
-       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
-        pixelformat=BGRA32
-   fi]
-)
-
-if test x$pixelformat = xall; then
-  if test x$build_agg = xyes; then
-    ### The fact that we're building GTK doesn't mean we're not also
-    ### building KDE or SDL, each needing its own pixel format !
-    #if test x$build_gtk = xyes; then
-    #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
-    #  pixelformat="RGB24"
-    #else
-      AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
-      AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
-      AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
-      AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
-      AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
-      AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
-      AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
-      AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
-    #fi
-  fi
-fi
-
-if test x"${build_ogl}" != xno; then # yes or auto
-  GNASH_PATH_OPENGL
-  if test x"${build_ogl}" = xauto; then
-    if test xyes = x"${has_opengl}"; then
-      build_ogl=yes
-      renderer_list="${renderer_list} opengl"
-    else
-      build_ogl=no
-    fi
-  fi
-fi
-
-AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
-AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
-AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
-AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
-AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
-AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
-
-if test x"${has_openvg}" = xyes; then
-   AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
-fi
-
-if test x"${build_ogl}" = xyes; then
-   AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
-fi
-
-if test x"${build_agg}" = xyes; then
-  AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
-fi
-
-if test x"${build_cairo}" = xyes; then
-  GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
-  AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
-fi
-
-if test x"${build_agg}" = xyes; then
-   GNASH_PATH_AGG
-fi
-
 dnl VA API is used by default for all H.264 videos. HW requirements:
 dnl     * AMD GPUs with UVD2 and xvba-video VA driver
 dnl     * NVIDIA GPUs with vdpau-video VA driver
@@ -1121,12 +1007,22 @@ dnl GMA500 but you currently will have to build the AGG 
renderer
 dnl instead of the OGL (OpenGL) one. 
 build_vaapi_device=no
 build_openmax_device=no
+if test x"${build_ovg}" = xyes; then
+  build_egl_device=yes
+else
+  build_egl_device=no
+fi
 build_x11_device=no
 build_directfb_device=no
-build_egl_device=auto
-build_rawfb_device=yes
-device_list="RawFB"
-ndevice=1
+if test x"${build_fb}" = xyes; then
+  build_rawfb_device=yes
+  device_list="RawFB"
+  ndevice=1
+else
+  build_rawfb_device=no
+  device_list=""
+  ndevice=0
+fi
 AC_ARG_ENABLE(device,
   AC_HELP_STRING([--enable-device], [Specify which hardware abstraction to use 
to support to enable (none,egl,directfb,rawfb,x11,vaapi)]),
   enableval=`echo ${enableval} | tr '\054' ' ' `
@@ -1245,27 +1141,143 @@ AM_CONDITIONAL(HAVE_VAAPI, test x"${found_libva_incl}" 
= xyes)
 AM_CONDITIONAL(HAVE_VAAPI_GLX, test x"${found_libva_glx_incl}" = xyes)
 AM_CONDITIONAL(HAVE_VAAPI_X11, test x"${found_libva_x11_incl}" = xyes)
 
-if test x"${build_egl_device}" != xno; then # yes or auto
+if test x"${build_egl_device}" = xyes; then
   GNASH_PKG_FIND(EGL, [EGL/egl.h], [EGL library], eglGetDisplay)
   if test xyes = x"${has_EGL}"; then
     AC_DEFINE(BUILD_EGL_DEVICE, [ 1 ],
           [Build the EGL device for OpenVG, OpenGLES1&2, and X11/Mesa])
-    build_egl_device=yes
-    device_list="${device_list} EGL"
-    ndevice=$((ndevice+1))
+      device_list="${device_list} EGL"
+      ndevice=$((ndevice+1))
   else
-    if test xyes = x"${build_egl_device}"; then
-      AC_MSG_ERROR(["EGL requested but development package not found"])
-    fi
+    AC_MSG_ERROR(["EGL requested but development package not found"])
     build_egl_device=no
   fi
 fi
 
+if test ${ndevice} -eq 0; then
+      device_list="none"
+      ndevice=1
+fi
+
 AM_CONDITIONAL(BUILD_DEVICES, test ${ndevice} -gt 0)
 if test ${ndevice} -gt 0; then
   AC_OUTPUT(libdevice/Makefile)
 fi
 
+dnl 16 bit: RGB555, RGB565
+dnl 24 bit: RGB24, BGR24
+dnl 32 bit: RGBA32, BGRA32
+pixelformat=all
+AC_ARG_WITH(pixelformat,
+  AC_HELP_STRING([--with-pixelformat=], [Use the specified pixel format for 
AGG (default=all)]),
+  [if test -n ${withval}; then
+    pixelformat="${withval}"
+    withval=`echo ${withval} | tr '\054' ' ' `
+  fi
+  while test -n "${withval}" ; do
+    val=`echo ${withval} | cut -d ' ' -f 1`
+    case "${val}" in
+      all)
+        # allow special value "all" set by user (handled below)
+        ;; 
+      argb32|ARGB32)
+        AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32])
+        ;;
+      abgr32|ABGR32)
+        AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32])
+        ;;
+      bgra32|BGRA32)
+        AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
+        ;;
+      bgr24|BGR24)
+        AC_DEFINE(PIXELFORMAT_BGR24, [1], [BGR24])
+        ;;
+      rgba32|RGBA32)
+        AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32])
+        ;;
+      rgb24|RGB24)
+        AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24])
+        ;;
+      rgb555|RGB555)
+        AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555])
+        ;;
+      rgb565|RGB565)
+        AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565])
+        ;;
+      *) AC_MSG_ERROR([invalid pixel format ${withval} given (accept: 
all|RGB555|RGB565|RGB24|BGR24|BGRA32|RGBA32|ARGB32|ABGR32)])
+         ;;
+      esac
+    withval=`echo ${withval} | cut -d ' ' -f 2-6`
+    if test "x$val" = "x$withval"; then
+      break;
+    fi
+  done],
+  [if test x$build_haiku = xyes -a x$build_sdl != xyes; then
+       AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32])
+        pixelformat=BGRA32
+   fi]
+)
+
+if test x$pixelformat = xall; then
+  if test x$build_agg = xyes; then
+    ### The fact that we're building GTK doesn't mean we're not also
+    ### building KDE or SDL, each needing its own pixel format !
+    #if test x$build_gtk = xyes; then
+    #  AC_DEFINE(PIXELFORMAT_RGB24, [1], [RGB24 pixel format])
+    #  pixelformat="RGB24"
+    #else
+      AC_DEFINE(PIXELFORMAT_RGB555, [1], [RGB555 pixel format])
+      AC_DEFINE(PIXELFORMAT_RGB565, [1], [RGB565 pixel format])
+      AC_DEFINE(PIXELFORMAT_RGB24,  [1], [RGB24 pixel format])
+      AC_DEFINE(PIXELFORMAT_BGR24,  [1], [BGR24 pixel format])
+      AC_DEFINE(PIXELFORMAT_RGBA32, [1], [RGBA32 pixel format])
+      AC_DEFINE(PIXELFORMAT_BGRA32, [1], [BGRA32 pixel format])
+      AC_DEFINE(PIXELFORMAT_ARGB32, [1], [ARGB32 pixel format])
+      AC_DEFINE(PIXELFORMAT_ABGR32, [1], [ABGR32 pixel format])
+    #fi
+  fi
+fi
+
+if test x"${build_ogl}" != xno; then # yes or auto
+  GNASH_PATH_OPENGL
+  if test x"${build_ogl}" = xauto; then
+    if test xyes = x"${has_opengl}"; then
+      build_ogl=yes
+      renderer_list="${renderer_list} opengl"
+    else
+      build_ogl=no
+    fi
+  fi
+fi
+
+AM_CONDITIONAL(BUILD_OVG_RENDERER,   [ test x${build_ovg} = xyes ])
+AM_CONDITIONAL(BUILD_GLES1_RENDERER, [ test x${build_gles1} = xyes ])
+AM_CONDITIONAL(BUILD_GLES2_RENDERER, [ test x${build_gles2} = xyes ])
+AM_CONDITIONAL(BUILD_OGL_RENDERER,   [ test x${build_ogl} = xyes])
+AM_CONDITIONAL(BUILD_AGG_RENDERER,   [ test x${build_agg} = xyes ])
+AM_CONDITIONAL(BUILD_CAIRO_RENDERER, [ test x${build_cairo} = xyes ])
+
+if test x"${has_openvg}" = xyes; then
+   AC_DEFINE([RENDERER_OPENVG], [1], [Use OpenVG renderer])
+fi
+
+if test x"${build_ogl}" = xyes; then
+   AC_DEFINE([RENDERER_OPENGL], [1], [Use OpenGL renderer])
+fi
+
+if test x"${build_agg}" = xyes; then
+  AC_DEFINE([RENDERER_AGG], [1], [Use AntiGrain renderer])
+fi
+
+if test x"${build_cairo}" = xyes; then
+  GNASH_PKG_FIND(cairo, [cairo.h], [cairo render library], cairo_status)
+  AC_DEFINE([RENDERER_CAIRO], [1], [Use cairo renderer])
+fi
+
+if test x"${build_agg}" = xyes; then
+   GNASH_PATH_AGG
+fi
+
 AC_PATH_PROG(PERL, perl)
 AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
 
@@ -1846,17 +1858,17 @@ dnl or keyboard attached.
 dnl By default, don't build any of these, as they are only for the Framebuffer
 dnl running without X11.
 if test x"${build_fb}" = xyes; then
-build_ps2mouse=yes
-build_ps2keyboard=no
-build_input_events=yes
-build_tslib=yes
-input_events="PS/2 Mouse, Input Devices, Touchscreen via Tslib"
+  build_ps2mouse=yes
+  build_ps2keyboard=no
+  build_input_events=yes
+  build_tslib=yes
+  input_events="PS/2 Mouse, Input Devices, Touchscreen via Tslib"
 else
-build_ps2mouse=no
-build_ps2keyboard=no
-build_input_events=no
-build_tslib=no
-input_events=
+  build_ps2mouse=no
+  build_ps2keyboard=no
+  build_input_events=no
+  build_tslib=no
+  input_events=
 fi
 AC_ARG_ENABLE(input,
   AC_HELP_STRING([--enable-input=], [Enable support for the specified input 
devices for the framebuffer GUI 
(default=ps2mouse|ps2keyboard|events|touchscreen)]),
@@ -2432,15 +2444,6 @@ if test x"${build_gles1}"; then
   GNASH_PATH_GLES
 fi
 
-dnl The OpenGLES1, OpenGLES2, and OpenVG all need the EGL support, X11 can use 
it also
-dnl TODO: move this at the bottom ?
-if test x"${build_gles1}" = xyes -o x"${build_ovg}" = xyes; then
-  if test x"${build_egl_device}" != xyes; then
-    AC_MSG_ERROR(["OpenGLES1 and OpenVG both need EGL support. See 
--enable-device."])
-    build_egl_device=yes
-  fi
-fi
-
 dnl only Linux supports /dev/fb0
 if test x"${build_rawfb_device}" = xyes -a x"${linux}" = xyes; then
    AC_DEFINE([BUILD_RAWFB_DEVICE], [1], [Use raw Framebuffer device support])

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                        |  293 ++++++++++++++++++-----------------
 librender/linear.as                 |   29 +++-
 librender/opengl/Renderer_ogl.cpp   |    2 -
 librender/openvg/OpenVGBitmap.cpp   |  128 +++++++++-------
 librender/openvg/OpenVGBitmap.h     |   11 +-
 librender/openvg/OpenVGRenderer.cpp |  123 ++-------------
 librender/openvg/OpenVGStyle.h      |  216 +++++++++++---------------
 7 files changed, 352 insertions(+), 450 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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