gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, openvg, updated. 5fc3dc5f8d2b0d9d85ec


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. 5fc3dc5f8d2b0d9d85ecb8e76a72abd4682cb239
Date: Tue, 28 Dec 2010 02:20:23 +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, openvg has been updated
       via  5fc3dc5f8d2b0d9d85ecb8e76a72abd4682cb239 (commit)
       via  f8858c0d9e04e4387304cfe3f361e585ad9f1eea (commit)
       via  b24f62ff3ff85d7566a98c0a6118d4746e77de5c (commit)
       via  cbcec0ca41830cd16249ef77ccbed959ed9ff44f (commit)
       via  7f564050a02bfbec255119867e6ace97fac5a7f5 (commit)
      from  76f0bd89013ccb16d112e9b614fcbf8113bf77f9 (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=5fc3dc5f8d2b0d9d85ecb8e76a72abd4682cb239


commit 5fc3dc5f8d2b0d9d85ecb8e76a72abd4682cb239
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 19:19:48 2010 -0700

    rename to follow the Gnash style

diff --git a/librender/Makefile.am b/librender/Makefile.am
index 4459872..f0ac925 100644
--- a/librender/Makefile.am
+++ b/librender/Makefile.am
@@ -66,14 +66,15 @@ noinst_HEADERS = \
        agg/Renderer_agg_bitmap.h \
        agg/Renderer_agg_style.h \
        cairo/Renderer_cairo.h \
-       cairo/PathParser.h
+       cairo/PathParser.h \
        opengl/tu_opengl_includes.h \
        opengl/Renderer_ogl.h \
        opengles1/Renderer_gles1.h \
        opengles1/render_handler_gles.h \
        opengles2/Renderer_gles2.h \
        openvg/Renderer_ovg.h \
-       openvg/Renderer_ovg_bitmap.h \
+       openvg/OpenVGBitmap.h \
+       openvg/OpenVGStyle.h \
        opengl/Renderer_ogl.h \
        $(NULL)
 
diff --git a/librender/openvg/Renderer_ovg.h b/librender/openvg/Renderer_ovg.h
index 87cab34..c855c83 100644
--- a/librender/openvg/Renderer_ovg.h
+++ b/librender/openvg/Renderer_ovg.h
@@ -43,7 +43,7 @@
 # include <VG/vgext.h>
 #endif
 #include <VG/openvg.h>
-#include "openvg/Renderer_ovg_bitmap.h"
+#include "openvg/OpenVGBitmap.h"
 #include "egl/eglDevice.h"
 
 namespace gnash {
diff --git a/librender/openvg/Renderer_ovg_bitmap.h 
b/librender/openvg/Renderer_ovg_bitmap.h
deleted file mode 100644
index 7febf84..0000000
--- a/librender/openvg/Renderer_ovg_bitmap.h
+++ /dev/null
@@ -1,153 +0,0 @@
-// 
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software 
Foundation, Inc.
-// 
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-///
-/// Author: Visor <address@hidden>
-/// Heavily hacked by Rob <address@hidden> to work with Gnash
-/// git master.
-///
-
-#ifndef GNASH_RENDER_HANDLER_OVG_BITMAP_H
-#define GNASH_RENDER_HANDLER_OVG_BITMAP_H
-
-#include "Geometry.h"
-#include "CachedBitmap.h"
-#include "GnashImage.h"
-#include "Renderer.h"
-#include "openvg/Renderer_ovg.h"
-
-namespace gnash {
-
-namespace renderer {
-
-namespace openvg {
-
-class bitmap_info_ovg : public CachedBitmap
-{
-public:
-    /// Set line and fill styles for mesh & line_strip rendering.
-    enum bitmap_wrap_mode { WRAP_REPEAT, WRAP_CLAMP };
-    
-    bitmap_info_ovg(std::auto_ptr<image::GnashImage> im)
-        : _image(im.release())
-    {
-        GNASH_REPORT_FUNCTION;
-    }
-  
-    bitmap_info_ovg(std::auto_ptr<image::GnashImage> im,
-                    VGImageFormat pixelformat, VGPaint vgpaint)
-        : _image(im.release()),
-          _pixel_format(pixelformat),
-          _vgpaint(vgpaint)
-    {
-        GNASH_REPORT_FUNCTION;
-        
-        size_t width = _image->width();
-        size_t height = _image->height();
-        
-        _vgimage = vgCreateImage(VG_sRGB_565, width, height,
-                                 VG_IMAGE_QUALITY_FASTER);    
-        
-        vgImageSubData(_vgimage, _image->begin(), width * 4, VG_sRGB_565,
-                       0, 0, width, height);
-        
-        _tex_size += width * height * 4;
-        log_debug("Add Texture size:%d (%d x %d x %dbpp)", width * height * 4, 
-                  width, height, 4);
-        log_debug("Current Texture size: %d", _tex_size);
-    } 
-
-    ~bitmap_info_ovg()
-    {
-        GNASH_REPORT_FUNCTION;
-        
-        _tex_size -= _image->width() * _image->height() * 4;
-        log_debug(_("Remove Texture size:%d (%d x %d x %dbpp)"),
-                  _image->width() * _image->height() * 4,
-                  _image->width(), _image->height(), 4);
-        log_debug(_("Current Texture size: %d"), _tex_size);
-        
-        vgDestroyImage(_vgimage);
-    }
-
-    void dispose()  { _image.reset(); }
-    bool disposed() const { return !_image.get(); }
-
-    image::GnashImage& image() {
-        GNASH_REPORT_FUNCTION;
-        if (_image) {
-            return *_image;
-        }
-    }    
-
-    void apply(const gnash::SWFMatrix& bitmap_matrix,
-               bitmap_wrap_mode wrap_mode) const
-    {
-        GNASH_REPORT_FUNCTION;
-        gnash::SWFMatrix mat;
-        VGfloat     vmat[9];
-        
-        mat = bitmap_matrix;
-        
-        vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
-        vgPaintPattern (_vgpaint, _vgimage);
-        
-        mat.invert();
-        memset(vmat, 0, sizeof(vmat));
-        vmat[0] = mat.sx  / 65536.0f;
-        vmat[1] = mat.shx / 65536.0f;
-        vmat[3] = mat.shy / 65536.0f;
-        vmat[4] = mat.sy  / 65536.0f;
-        vmat[6] = mat.tx;
-        vmat[7] = mat.ty;
-        
-        vgSeti (VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
-        vgLoadMatrix (vmat);
-        vgSeti (VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER);
-        vgLoadMatrix (vmat);
-        vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
-        
-        if (wrap_mode == WRAP_CLAMP) {  
-            vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_PAD);
-        } else {
-            vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
-        }
-    }
-
-    // Accessors for the GnashImage internal data
-    int getWidth() { return _image->width(); };
-    int getHeight() { return _image->height(); };
-    boost::uint8_t *getData() const { return _image->begin(); };
-
-private:    
-    boost::scoped_ptr<image::GnashImage> _image;
-    VGImageFormat   _pixel_format;
-    mutable VGImage _vgimage;
-    VGPaint         _vgpaint;
-    int             _tex_size;
-};
-
-} // namespace gnash::renderer::openvg
-} // namespace gnash::renderer
-} // namespace gnash
-
-#endif // __RENDER_HANDLER_OVG_BITMAP_H__
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:

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


commit f8858c0d9e04e4387304cfe3f361e585ad9f1eea
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 19:19:13 2010 -0700

    derived classes don't need the virtual keyword

diff --git a/librender/agg/Renderer_agg_bitmap.h 
b/librender/agg/Renderer_agg_bitmap.h
index 47f6155..f73f7b7 100644
--- a/librender/agg/Renderer_agg_bitmap.h
+++ b/librender/agg/Renderer_agg_bitmap.h
@@ -39,7 +39,7 @@ public:
     {
     }
   
-    virtual image::GnashImage& image() {
+    image::GnashImage& image() {
         assert(!disposed());
         return *_image;
     }

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


commit b24f62ff3ff85d7566a98c0a6118d4746e77de5c
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 19:18:34 2010 -0700

    rename to follow the Gnash style

diff --git a/librender/openvg/OpenVGBitmap.h b/librender/openvg/OpenVGBitmap.h
new file mode 100644
index 0000000..900d176
--- /dev/null
+++ b/librender/openvg/OpenVGBitmap.h
@@ -0,0 +1,147 @@
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software 
Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+#ifndef GNASH_OPENVG_BITMAP_H
+#define GNASH_OPENVG_BITMAP_H
+
+#include "Geometry.h"
+#include "CachedBitmap.h"
+#include "GnashImage.h"
+#include "Renderer.h"
+#include "openvg/Renderer_ovg.h"
+
+namespace gnash {
+
+namespace renderer {
+
+namespace openvg {
+
+class OpenVGBitmap : public CachedBitmap
+{
+public:
+    /// Set line and fill styles for mesh & line_strip rendering.
+    enum bitmap_wrap_mode { WRAP_REPEAT, WRAP_CLAMP };
+    
+    OpenVGBitmap(std::auto_ptr<image::GnashImage> im)
+        : _image(im.release())
+    {
+        GNASH_REPORT_FUNCTION;
+    }
+  
+    OpenVGBitmap(std::auto_ptr<image::GnashImage> im,
+                    VGImageFormat pixelformat, VGPaint vgpaint)
+        : _image(im.release()),
+          _pixel_format(pixelformat),
+          _vgpaint(vgpaint)
+    {
+        GNASH_REPORT_FUNCTION;
+        
+        size_t width = _image->width();
+        size_t height = _image->height();
+        
+        _vgimage = vgCreateImage(VG_sRGB_565, width, height,
+                                 VG_IMAGE_QUALITY_FASTER);    
+        
+        vgImageSubData(_vgimage, _image->begin(), width * 4, VG_sRGB_565,
+                       0, 0, width, height);
+        
+        _tex_size += width * height * 4;
+        log_debug("Add Texture size:%d (%d x %d x %dbpp)", width * height * 4, 
+                  width, height, 4);
+        log_debug("Current Texture size: %d", _tex_size);
+    } 
+
+    ~OpenVGBitmap()
+    {
+        GNASH_REPORT_FUNCTION;
+        
+        _tex_size -= _image->width() * _image->height() * 4;
+        log_debug(_("Remove Texture size:%d (%d x %d x %dbpp)"),
+                  _image->width() * _image->height() * 4,
+                  _image->width(), _image->height(), 4);
+        log_debug(_("Current Texture size: %d"), _tex_size);
+        
+        vgDestroyImage(_vgimage);
+    }
+
+    void dispose()  { _image.reset(); }
+    bool disposed() const { return !_image.get(); }
+
+    image::GnashImage& image() {
+        GNASH_REPORT_FUNCTION;
+        if (_image) {
+            return *_image;
+        }
+    }    
+
+    void apply(const gnash::SWFMatrix& bitmap_matrix,
+               bitmap_wrap_mode wrap_mode) const
+    {
+        GNASH_REPORT_FUNCTION;
+        gnash::SWFMatrix mat;
+        VGfloat     vmat[9];
+        
+        mat = bitmap_matrix;
+        
+        vgSetParameteri (_vgpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+        vgPaintPattern (_vgpaint, _vgimage);
+        
+        mat.invert();
+        memset(vmat, 0, sizeof(vmat));
+        vmat[0] = mat.sx  / 65536.0f;
+        vmat[1] = mat.shx / 65536.0f;
+        vmat[3] = mat.shy / 65536.0f;
+        vmat[4] = mat.sy  / 65536.0f;
+        vmat[6] = mat.tx;
+        vmat[7] = mat.ty;
+        
+        vgSeti (VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+        vgLoadMatrix (vmat);
+        vgSeti (VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER);
+        vgLoadMatrix (vmat);
+        vgSeti (VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+        
+        if (wrap_mode == WRAP_CLAMP) {  
+            vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_PAD);
+        } else {
+            vgSetParameteri (_vgpaint, VG_PAINT_PATTERN_TILING_MODE, 
VG_TILE_REPEAT);
+        }
+    }
+
+    // Accessors for the GnashImage internal data
+    int getWidth() { return _image->width(); };
+    int getHeight() { return _image->height(); };
+    boost::uint8_t *getData() const { return _image->begin(); };
+
+private:    
+    boost::scoped_ptr<image::GnashImage> _image;
+    VGImageFormat   _pixel_format;
+    mutable VGImage _vgimage;
+    VGPaint         _vgpaint;
+    int             _tex_size;
+};
+
+} // namespace gnash::renderer::openvg
+} // namespace gnash::renderer
+} // namespace gnash
+
+#endif // __RENDER_OPENVG_BITMAP_H__
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:

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


commit cbcec0ca41830cd16249ef77ccbed959ed9ff44f
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 19:18:02 2010 -0700

    move helper functions for Fill Styles to it's own file

diff --git a/librender/openvg/OpenVGStyle.h b/librender/openvg/OpenVGStyle.h
new file mode 100644
index 0000000..ff43ee6
--- /dev/null
+++ b/librender/openvg/OpenVGStyle.h
@@ -0,0 +1,134 @@
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software 
Foundation, Inc.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+#ifndef GNASH_OPENVG_STYLE_H
+#define GNASH_OPENVG_STYLE_H
+
+#include "Geometry.h"
+#include "CachedBitmap.h"
+#include "GnashImage.h"
+#include "Renderer.h"
+#include "openvg/Renderer_ovg.h"
+
+namespace gnash {
+
+namespace renderer {
+
+namespace openvg {
+
+/// @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
+/// boost::apply_visitor() to bind one of these classes to the style
+/// to extract the data.
+
+/// 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& f) 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<const CachedBitmap *>
+{
+public:
+    const CachedBitmap *operator()(const SolidFill&) const {
+        return 0;
+    }
+    const CachedBitmap *operator()(const GradientFill&) const {
+        return 0;
+    }
+    const CachedBitmap *operator()(const BitmapFill& b) const {
+        return b.bitmap();
+    }
+};
+
+/// 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();
+    }
+};
+
+} // namespace gnash::renderer::openvg
+} // namespace gnash::renderer
+} // namespace gnash
+
+#endif // __RENDER_OPENVG_STYLE_H__
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: nil
+// End:
diff --git a/librender/openvg/Renderer_ovg.cpp 
b/librender/openvg/Renderer_ovg.cpp
index e58c4b3..87bf2dd 100644
--- a/librender/openvg/Renderer_ovg.cpp
+++ b/librender/openvg/Renderer_ovg.cpp
@@ -44,7 +44,8 @@
 #include "Range2d.h"
 #include "SWFCxForm.h"
 #include "openvg/Renderer_ovg.h"
-#include "openvg/Renderer_ovg_bitmap.h"
+#include "openvg/OpenVGBitmap.h"
+#include "openvg/OpenVGStyle.h"
 #include "SWFMatrix.h"
 #include "swf/ShapeRecord.h"
 #include "CachedBitmap.h"
@@ -76,104 +77,6 @@ namespace renderer {
 
 namespace openvg {
 
-namespace {
-
-// FIXME: These helper classes should be moved to their own file.
-
-/// @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
-/// boost::apply_visitor() to bind one of these classes to the style
-/// to extract the data.
-
-/// 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& f) 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<const CachedBitmap *>
-{
-public:
-    const CachedBitmap *operator()(const SolidFill&) const {
-        return 0;
-    }
-    const CachedBitmap *operator()(const GradientFill&) const {
-        return 0;
-    }
-    const CachedBitmap *operator()(const BitmapFill& b) const {
-        return b.bitmap();
-    }
-};
-
-/// 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();
-    }
-};
-
-}
-
 class eglScopeMatrix : public boost::noncopyable
 {
 public:
@@ -268,7 +171,7 @@ preparepath(VGPath path, const std::vector<Edge>& edges,
 #if 0
 // Use the image class copy constructor; it's not important any more
 // what kind of image it is.
-bitmap_info_ovg::bitmap_info_ovg(std::auto_ptr<gnash::image::GnashImage> img,
+OpenVGBitmap::OpenVGBitmap(std::auto_ptr<gnash::image::GnashImage> img,
                                  VGImageFormat pixelformat, VGPaint vgpaint)
     : _image(img.release()),
       _pixel_format(pixelformat),
@@ -290,7 +193,7 @@ 
bitmap_info_ovg::bitmap_info_ovg(std::auto_ptr<gnash::image::GnashImage> img,
     log_debug("Current Texture size: %d", tex_size);
 }   
 
-bitmap_info_ovg::~bitmap_info_ovg()
+OpenVGBitmap::~OpenVGBitmap()
 {
     GNASH_REPORT_FUNCTION;
 
@@ -304,7 +207,7 @@ bitmap_info_ovg::~bitmap_info_ovg()
 }
 
 void
-bitmap_info_ovg::apply(const gnash::SWFMatrix& bitmap_matrix,
+OpenVGBitmap::apply(const gnash::SWFMatrix& bitmap_matrix,
                        bitmap_wrap_mode wrap_mode) const
 {
     GNASH_REPORT_FUNCTION;
@@ -418,7 +321,7 @@ 
Renderer_ovg::createCachedBitmap(std::auto_ptr<image::GnashImage> im)
     GNASH_REPORT_FUNCTION;
 
     // OpenVG don't support 24bit RGB, need translate colorspace
-    return reinterpret_cast<CachedBitmap *>(new bitmap_info_ovg(im, 
VG_sRGB_565, 0));
+    return reinterpret_cast<CachedBitmap *>(new OpenVGBitmap(im, VG_sRGB_565, 
0));
 }
 
 // Since we store drawing operations in display lists, we take special care
@@ -892,24 +795,24 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       case SWF::FILL_RADIAL_GRADIENT:
       case SWF::FILL_FOCAL_GRADIENT:
       {
-          GradientFill::Type gr;
+          GradientFill::Type gt;
           switch (fill_type) {
           case SWF::FILL_LINEAR_GRADIENT:
-              gr = GradientFill::LINEAR;
+              gt = GradientFill::LINEAR;
               break;
           case SWF::FILL_RADIAL_GRADIENT:
           case SWF::FILL_FOCAL_GRADIENT:
-              gr = GradientFill::RADIAL;
+              gt = GradientFill::RADIAL;
               break;
           default:
               std::abort();
           }
-          GradientFill gf(gr, mat);
+          GradientFill gf(gt, mat);
 
-          const bitmap_info_ovg* binfo = reinterpret_cast<const 
bitmap_info_ovg *>(
+          const OpenVGBitmap* binfo = reinterpret_cast<const OpenVGBitmap *>(
                createGradientBitmap(gf, this));
 
-          binfo->apply(gf.matrix(), bitmap_info_ovg::WRAP_CLAMP); 
+          binfo->apply(gf.matrix(), OpenVGBitmap::WRAP_CLAMP); 
           vgSetParameteri (m_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
           break;
       }
@@ -917,9 +820,9 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       case SWF::FILL_TILED_BITMAP:
       {
           const CachedBitmap *cb = boost::apply_visitor(GetBitmap(), 
style.fill);
-          const bitmap_info_ovg* binfo = dynamic_cast<const bitmap_info_ovg 
*>(cb);
+          const OpenVGBitmap* binfo = dynamic_cast<const OpenVGBitmap *>(cb);
           SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);        
  
-          binfo->apply(sm, bitmap_info_ovg::WRAP_REPEAT);
+          binfo->apply(sm, OpenVGBitmap::WRAP_REPEAT);
           vgSetParameteri (m_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
           break;
       }
@@ -928,10 +831,10 @@ Renderer_ovg::apply_fill_style(const FillStyle& style, 
const SWFMatrix& mat,
       case SWF::FILL_CLIPPED_BITMAP_HARD:
       {     
           const CachedBitmap *cb = boost::apply_visitor(GetBitmap(), 
style.fill);
-          const bitmap_info_ovg* binfo = dynamic_cast<const bitmap_info_ovg 
*>(cb);     
+          const OpenVGBitmap* binfo = dynamic_cast<const OpenVGBitmap *>(cb);  
   
 
           SWFMatrix sm = boost::apply_visitor(GetMatrix(), style.fill);
-          binfo->apply(sm, bitmap_info_ovg::WRAP_CLAMP);
+          binfo->apply(sm, OpenVGBitmap::WRAP_CLAMP);
           vgSetParameteri (m_fillpaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
           break;
       } 

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


commit 7f564050a02bfbec255119867e6ace97fac5a7f5
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 19:02:02 2010 -0700

    derive from CachedBitmap

diff --git a/librender/openvg/Renderer_ovg_bitmap.h 
b/librender/openvg/Renderer_ovg_bitmap.h
index 6e92063..7febf84 100644
--- a/librender/openvg/Renderer_ovg_bitmap.h
+++ b/librender/openvg/Renderer_ovg_bitmap.h
@@ -36,8 +36,7 @@ namespace renderer {
 
 namespace openvg {
 
-// FIXME: this should really be derived from CachedBitmap
-class bitmap_info_ovg //: public CachedBitmap
+class bitmap_info_ovg : public CachedBitmap
 {
 public:
     /// Set line and fill styles for mesh & line_strip rendering.
@@ -85,7 +84,7 @@ public:
         vgDestroyImage(_vgimage);
     }
 
-    void disposed()  { _image.reset(); }
+    void dispose()  { _image.reset(); }
     bool disposed() const { return !_image.get(); }
 
     image::GnashImage& image() {

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

Summary of changes:
 librender/Makefile.am                              |    5 +-
 librender/agg/Renderer_agg_bitmap.h                |    2 +-
 .../{Renderer_ovg_bitmap.h => OpenVGBitmap.h}      |   23 ++---
 librender/openvg/OpenVGStyle.h                     |  134 ++++++++++++++++++++
 librender/openvg/Renderer_ovg.cpp                  |  129 +++-----------------
 librender/openvg/Renderer_ovg.h                    |    2 +-
 6 files changed, 163 insertions(+), 132 deletions(-)
 rename librender/openvg/{Renderer_ovg_bitmap.h => OpenVGBitmap.h} (88%)
 create mode 100644 librender/openvg/OpenVGStyle.h


hooks/post-receive
-- 
Gnash



reply via email to

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