gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/BevelFilter.cpp server/B...


From: Chad Musick
Subject: [Gnash-commit] gnash ChangeLog server/BevelFilter.cpp server/B...
Date: Wed, 29 Aug 2007 03:32:59 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Chad Musick <cmusick>   07/08/29 03:32:59

Modified files:
        .              : ChangeLog 
        server         : BevelFilter.cpp BevelFilter.h BitmapFilter.h 
                         BlurFilter.cpp BlurFilter.h 
                         ColorMatrixFilter.cpp ColorMatrixFilter.h 
                         ConvolutionFilter.cpp ConvolutionFilter.h 
                         DropShadowFilter.cpp DropShadowFilter.h 
                         GlowFilter.cpp GlowFilter.h 
                         GradientBevelFilter.cpp GradientBevelFilter.h 
                         GradientGlowFilter.cpp GradientGlowFilter.h 
        server/asobj   : BevelFilter_as.cpp BitmapFilter_as.cpp 
                         BitmapFilter_as.h BlurFilter_as.cpp 
                         ColorMatrixFilter_as.cpp 
                         ConvolutionFilter_as.cpp 
                         DropShadowFilter_as.cpp GlowFilter_as.cpp 
                         GradientBevelFilter_as.cpp 
                         GradientGlowFilter_as.cpp prophelper.h 
        server/parser  : filter_factory.cpp 

Log message:
        Separate as_object from filters, use multiple inheritance instead fo 
exposing 
        functionality to AS.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4142&r2=1.4143
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BevelFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BevelFilter.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BitmapFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BlurFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BlurFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ColorMatrixFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ColorMatrixFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ConvolutionFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ConvolutionFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DropShadowFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DropShadowFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GlowFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GlowFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientBevelFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientBevelFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientGlowFilter.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientGlowFilter.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/BevelFilter_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/BitmapFilter_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/BitmapFilter_as.h?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/BlurFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ColorMatrixFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ConvolutionFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/DropShadowFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/GlowFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/GradientBevelFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/GradientGlowFilter_as.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/prophelper.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/filter_factory.cpp?cvsroot=gnash&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4142
retrieving revision 1.4143
diff -u -b -r1.4142 -r1.4143
--- ChangeLog   29 Aug 2007 02:49:17 -0000      1.4142
+++ ChangeLog   29 Aug 2007 03:32:57 -0000      1.4143
@@ -1,3 +1,28 @@
+2007-08-29 Chad Musick <address@hidden>
+
+       * server/asobj/BlurFilter_as.cpp,.h
+       * server/asobj/ColorMatrixFilter_as.cpp,.h
+       * server/asobj/ConvolutionFilter_as.cpp,.h
+       * server/asobj/DropShadowFilter_as.cpp,.h
+       * server/asobj/GlowFilter_as.cpp,.h
+       * server/asobj/GradientBevelFilter_as.cpp,.h
+       * server/asobj/GradientGlowFilter_as.cpp,.h
+       * server/asobj/BevelFilter_as.cpp,.h
+       * server/asobj/BitmapFilter_as.cpp,.h
+         Change to use multiple inheritance for adaptation
+       * server/BevelFilter.h,.cpp
+       * server/BlurFilter.h,.cpp
+       * server/ColorMatrixFilter.h,.cpp
+       * server/ConvolutionFilter.h,.cpp
+       * server/DropShadowFilter.h,.cpp
+       * server/GlowFilter.h,.cpp
+       * server/GradientBevelFilter.h,.cpp
+       * server/GradientGlowFilter.h,.cpp
+         Changing to use multiple inheritance for adaptation
+       * server/asobj/prophelper.h Update for using multiple inheritance
+       * server/parser/filter_factory.cpp
+         Change to use correct type of operator for array pushes.
+
 2007-08-29 Sandro Santilli <address@hidden>
 
        * libbase/utility.h: fix the frnd() function to behave as

Index: server/BevelFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/BevelFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/BevelFilter.cpp      27 Aug 2007 03:06:41 -0000      1.2
+++ server/BevelFilter.cpp      29 Aug 2007 03:32:57 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BevelFilter.cpp,v 1.2 2007/08/27 03:06:41 cmusick Exp $ */
+/* $Id: BevelFilter.cpp,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
 
 #include "BevelFilter.h"
 
@@ -24,17 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool BevelFilter::read(stream* in);
 
-Filter const
-BevelFilter::clone()
-{
-    Filter p(new BevelFilter(m_distance, m_angle, m_highlightColor,
-        m_highlightAlpha, m_shadowColor, m_shadowAlpha,
-        m_blurX, m_blurY, m_strength, m_quality, m_type, m_knockout));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/BevelFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BevelFilter.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/BevelFilter.h        27 Aug 2007 18:13:39 -0000      1.3
+++ server/BevelFilter.h        29 Aug 2007 03:32:57 -0000      1.4
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BevelFilter.h,v 1.3 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: BevelFilter.h,v 1.4 2007/08/29 03:32:57 cmusick Exp $ */
 
 #ifndef GNASH_BEVELFILTER_H
 #define GNASH_BEVELFILTER_H
@@ -28,14 +28,10 @@
 
 namespace gnash {
 
-class BevelFilter_as; // Adapter class for AS use.
-
 // A bevel effect filter.
 class BevelFilter : public BitmapFilter
 {
 public:
-    friend class BevelFilter_as;
-
     typedef enum
     {
         OUTER_BEVEL = 1,
@@ -48,17 +44,6 @@
 
     virtual ~BevelFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BevelFilter
-    Filter const clone();
-
-    BevelFilter(as_object* o) : BitmapFilter(o),
-        m_distance(0.0f), m_angle(0.0f), m_highlightColor(0),
-        m_highlightAlpha(0), m_shadowColor(0), m_shadowAlpha(0),
-        m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
-        m_type(FULL_BEVEL), m_knockout(false)
-    { return; }
-
     BevelFilter() : 
         m_distance(0.0f), m_angle(0.0f), m_highlightColor(0),
         m_highlightAlpha(0), m_shadowColor(0), m_shadowAlpha(0),
@@ -76,7 +61,7 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-private:
+protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     uint32_t m_highlightColor; // Color of the highlight.

Index: server/BitmapFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BitmapFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/BitmapFilter.h       27 Aug 2007 03:06:41 -0000      1.2
+++ server/BitmapFilter.h       29 Aug 2007 03:32:57 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BitmapFilter.h,v 1.2 2007/08/27 03:06:41 cmusick Exp $ */
+/* $Id: BitmapFilter.h,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
 
 #ifndef GNASH_BITMAPFILTER_H
 #define GNASH_BITMAPFILTER_H
@@ -24,32 +24,23 @@
 #include "config.h"
 #endif
 
-#include "as_object.h"
+#include <boost/shared_ptr.hpp>
 
 namespace gnash {
 
 class stream;
 class BitmapFilter;
-class BitmapFilter_as; // Adapter pattern to ActionScript
-typedef boost::intrusive_ptr<BitmapFilter> Filter;
+typedef boost::shared_ptr<BitmapFilter> Filter;
 
 // The common base class for AS display filters.
-class BitmapFilter : public as_object
+class BitmapFilter
 {
 public:
-    friend class BitmapFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* /*in*/) { return true; }
 
-    // Pass the interface up the chain.
-    BitmapFilter(as_object *interface) : as_object(interface) { return; }
-    // For non-ActionScript use.
     BitmapFilter() { return; }
     virtual ~BitmapFilter() { return; }
-
-    // Clone this object and return a copy of it. (AS accessible function.)
-    virtual Filter const clone() { return NULL; }
 };
 
 } // Namespace gnash

Index: server/BlurFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/BlurFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/BlurFilter.cpp       27 Aug 2007 18:13:39 -0000      1.2
+++ server/BlurFilter.cpp       29 Aug 2007 03:32:57 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BlurFilter.cpp,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: BlurFilter.cpp,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
 
 #include "BlurFilter.h"
 
@@ -24,15 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool BlurFilter::read(stream* in);
 
-Filter const
-BlurFilter::clone()
-{
-    Filter p(new BlurFilter(m_blurX, m_blurY, m_quality));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/BlurFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BlurFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/BlurFilter.h 27 Aug 2007 18:13:39 -0000      1.2
+++ server/BlurFilter.h 29 Aug 2007 03:32:57 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BlurFilter.h,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: BlurFilter.h,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
 
 #ifndef GNASH_BLURFILTER_H
 #define GNASH_BLURFILTER_H
@@ -28,27 +28,15 @@
 
 namespace gnash {
 
-class BlurFilter_as; // Adapater for ActionScript
-
 // A blur effect filter.
 class BlurFilter : public BitmapFilter
 {
 public:
-    friend class BlurFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* in);
 
     virtual ~BlurFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BlurFilter
-    Filter const clone();
-
-    BlurFilter(as_object* obj) : BitmapFilter(obj),
-        m_blurX(0.0f), m_blurY(0.0f), m_quality(0)
-    { return; }
-
     BlurFilter() : 
         m_blurX(0.0f), m_blurY(0.0f), m_quality(0)
     { return; }
@@ -57,7 +45,7 @@
         m_blurX(blurX), m_blurY(blurY), m_quality(quality)
     { return; }
 
-private:
+protected:
     float m_blurX; // How much horizontal blur.
     float m_blurY; // How much vertical blur.
     uint8_t m_quality; // How many passes to take.

Index: server/ColorMatrixFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/ColorMatrixFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/ColorMatrixFilter.cpp        27 Aug 2007 18:13:39 -0000      1.2
+++ server/ColorMatrixFilter.cpp        29 Aug 2007 03:32:57 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ColorMatrixFilter.cpp,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: ColorMatrixFilter.cpp,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
 
 #include "ColorMatrixFilter.h"
 
@@ -24,15 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool ConvolutionFilter::read(stream* in);
 
-Filter const
-ColorMatrixFilter::clone()
-{
-    Filter p(new ColorMatrixFilter(m_matrix));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/ColorMatrixFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/ColorMatrixFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/ColorMatrixFilter.h  27 Aug 2007 18:13:39 -0000      1.2
+++ server/ColorMatrixFilter.h  29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ColorMatrixFilter.h,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: ColorMatrixFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_COLORMATRIXFILTER_H
 #define GNASH_COLORMATRIXFILTER_H
@@ -24,42 +24,30 @@
 #include "config.h"
 #endif
 
-#include "array.h"
 #include "BitmapFilter.h"
+#include <vector>
 
 namespace gnash {
 
-class ColorMatrixFilter_as; // Adapter for ActionScript
-
 // A color matrix effect filter.
 class ColorMatrixFilter : public BitmapFilter
 {
 public:
-    friend class ColorMatrixFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* in);
 
     virtual ~ColorMatrixFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to ColorMatrixFilter
-    Filter const clone();
-
-    ColorMatrixFilter(as_object* obj) : BitmapFilter(obj),
-        m_matrix()
-    { return; }
-
     ColorMatrixFilter() : 
         m_matrix()
     { return; }
 
-    ColorMatrixFilter(boost::intrusive_ptr<as_array_object> a_matrix) :
+    ColorMatrixFilter(std::vector<float> a_matrix) :
         m_matrix(a_matrix)
     { return; }
 
-private:
-    boost::intrusive_ptr<as_array_object> m_matrix; // The color matrix
+protected:
+    std::vector<float> m_matrix; // The color matrix
 };
 
 } // Namespace gnash

Index: server/ConvolutionFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/ConvolutionFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/ConvolutionFilter.cpp        27 Aug 2007 18:13:39 -0000      1.2
+++ server/ConvolutionFilter.cpp        29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ConvolutionFilter.cpp,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: ConvolutionFilter.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #include "ConvolutionFilter.h"
 
@@ -24,16 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool ConvolutionFilter::read(stream* in);
 
-Filter const
-ConvolutionFilter::clone()
-{
-    Filter p(new ConvolutionFilter(m_matrixX, m_matrixY, m_matrix,
-        m_divisor, m_bias, m_preserveAlpha, m_clamp, m_color, m_alpha));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/ConvolutionFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/ConvolutionFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/ConvolutionFilter.h  27 Aug 2007 18:13:39 -0000      1.2
+++ server/ConvolutionFilter.h  29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ConvolutionFilter.h,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: ConvolutionFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_CONVOLUTIONFILTER_H
 #define GNASH_CONVOLUTIONFILTER_H
@@ -24,40 +24,27 @@
 #include "config.h"
 #endif
 
-#include "array.h"
 #include "BitmapFilter.h"
+#include <vector>
 
 namespace gnash {
 
-class ConvolutionFilter_as; // Adapter to ActionScript
-
 // A convolution effect filter.
 class ConvolutionFilter : public BitmapFilter
 {
 public:
-    friend class ConvolutionFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* in);
 
     virtual ~ConvolutionFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to ConvolutionFilter
-    Filter const clone();
-
-    ConvolutionFilter(as_object* obj) : BitmapFilter(obj),
-        m_matrixX(), m_matrixY(), m_matrix(), m_divisor(), m_bias(),
-        m_preserveAlpha(false), m_clamp(false), m_color(), m_alpha()
-    { return; }
-
     ConvolutionFilter() : 
         m_matrixX(), m_matrixY(), m_matrix(), m_divisor(), m_bias(),
         m_preserveAlpha(false), m_clamp(false), m_color(), m_alpha()
     { return; }
 
     ConvolutionFilter(uint8_t matrixX, uint8_t matrixY, 
-        boost::intrusive_ptr<as_array_object> a_matrix,
+        std::vector<float> a_matrix,
         float divisor, float bias, bool preserveAlpha, bool clamp, uint32_t 
color,
         uint8_t alpha) :
         m_matrixX(matrixX), m_matrixY(matrixY), m_matrix(a_matrix),
@@ -65,10 +52,10 @@
         m_clamp(clamp), m_color(color), m_alpha(alpha)
     { return; }
 
-private:
+protected:
     uint8_t m_matrixX; // Number of columns
     uint8_t m_matrixY; // Number of rows
-    boost::intrusive_ptr<as_array_object> m_matrix; // The convolution matrix
+    std::vector<float> m_matrix; // The convolution matrix
     float m_divisor;
     float m_bias;
     bool m_preserveAlpha; // If true, don't convolute the alpha channel

Index: server/DropShadowFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/DropShadowFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/DropShadowFilter.cpp 27 Aug 2007 18:13:39 -0000      1.2
+++ server/DropShadowFilter.cpp 29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: DropShadowFilter.cpp,v 1.2 2007/08/27 18:13:39 cmusick Exp $ */
+/* $Id: DropShadowFilter.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #include "DropShadowFilter.h"
 
@@ -24,16 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool DropShadowFilter::read(stream* in);
 
-Filter const
-DropShadowFilter::clone()
-{
-    Filter p(new DropShadowFilter(m_distance, m_angle, m_color, m_alpha,
-        m_blurX, m_blurY, m_strength, m_quality, m_inner, m_knockout,
-        m_hideObject));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/DropShadowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/DropShadowFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/DropShadowFilter.h   27 Aug 2007 18:13:40 -0000      1.2
+++ server/DropShadowFilter.h   29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: DropShadowFilter.h,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: DropShadowFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_DROPSHADOWFILTER_H
 #define GNASH_DROPSHADOWFILTER_H
@@ -28,29 +28,15 @@
 
 namespace gnash {
 
-class DropShadowFilter_as;
-
 // A drop shadow effect filter.
 class DropShadowFilter : public BitmapFilter
 {
 public:
-    friend class DropShadowFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* in);
 
     virtual ~DropShadowFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BlurFilter
-    Filter const clone();
-
-    DropShadowFilter(as_object* obj) : BitmapFilter(obj),
-        m_distance(0.0f), m_angle(0.0f), m_color(0), m_alpha(0),
-        m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
-        m_inner(false), m_knockout(false), m_hideObject(false)
-    { return; }
-
     DropShadowFilter() : 
         m_distance(0.0f), m_angle(0.0f), m_color(0), m_alpha(0),
         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
@@ -66,7 +52,7 @@
         m_hideObject(hideObject)
     { return; }
 
-private:
+protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     uint32_t m_color; // RGB color.

Index: server/GlowFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/GlowFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GlowFilter.cpp       27 Aug 2007 18:13:40 -0000      1.2
+++ server/GlowFilter.cpp       29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GlowFilter.cpp,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GlowFilter.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #include "GlowFilter.h"
 
@@ -24,15 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool DropShadowFilter::read(stream* in);
 
-Filter const
-GlowFilter::clone()
-{
-    Filter p(new GlowFilter(m_color, m_alpha,
-        m_blurX, m_blurY, m_strength, m_quality, m_inner, m_knockout));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/GlowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GlowFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GlowFilter.h 27 Aug 2007 18:13:40 -0000      1.2
+++ server/GlowFilter.h 29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GlowFilter.h,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GlowFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_GLOWFILTER_H
 #define GNASH_GLOWFILTER_H
@@ -28,29 +28,15 @@
 
 namespace gnash {
 
-class GlowFilter_as;
-
 // A glow effect filter.
 class GlowFilter : public BitmapFilter
 {
 public:
-    friend class GlowFilter_as;
-
     // Fill from a stream. See parser/filter_factory.cpp for the 
implementations.
     virtual bool read(stream* in);
 
     virtual ~GlowFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BlurFilter
-    Filter const clone();
-
-    GlowFilter(as_object* obj) : BitmapFilter(obj),
-        m_color(0), m_alpha(0),
-        m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
-        m_inner(false), m_knockout(false)
-    { return; }
-
     GlowFilter() : 
         m_color(0), m_alpha(0),
         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
@@ -65,7 +51,7 @@
         m_quality(quality), m_inner(inner), m_knockout(knockout)
     { return; }
 
-private:
+protected:
     uint32_t m_color; // RGB color.
     uint8_t m_alpha; // Alpha strength, as a percentage(?)
     float m_blurX; // horizontal blur

Index: server/GradientBevelFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/GradientBevelFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GradientBevelFilter.cpp      27 Aug 2007 18:13:40 -0000      1.2
+++ server/GradientBevelFilter.cpp      29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientBevelFilter.cpp,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GradientBevelFilter.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #include "GradientBevelFilter.h"
 
@@ -24,15 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool GradientBevelFilter::read(stream* in);
 
-Filter const
-GradientBevelFilter::clone()
-{
-    Filter p(new GradientBevelFilter(m_distance, m_angle, m_colors, m_alphas,
-        m_ratios, m_blurX, m_blurY, m_strength, m_quality, m_type, 
m_knockout));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/GradientBevelFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GradientBevelFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GradientBevelFilter.h        27 Aug 2007 18:13:40 -0000      1.2
+++ server/GradientBevelFilter.h        29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientBevelFilter.h,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GradientBevelFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_GRADIENTBEVELFILTER_H
 #define GNASH_GRADIENTBEVELFILTER_H
@@ -24,19 +24,16 @@
 #include "config.h"
 #endif
 
-#include "array.h"
+#include <vector>
+
 #include "BitmapFilter.h"
 
 namespace gnash {
 
-class GradientBevelFilter_as;
-
 // A gradient bevel effect filter.
 class GradientBevelFilter : public BitmapFilter
 {
 public:
-    friend class GradientBevelFilter_as;
-
     typedef enum
     {
         INNER_BEVEL = 2,
@@ -49,16 +46,6 @@
 
     virtual ~GradientBevelFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BlurFilter
-    Filter const clone();
-
-    GradientBevelFilter(as_object *obj) : BitmapFilter(obj),
-        m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
-        m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
-        m_type(INNER_BEVEL), m_knockout(false)
-    { return; }
-
     GradientBevelFilter() : 
         m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
@@ -66,9 +53,9 @@
     { return; }
 
     GradientBevelFilter(float distance, float angle,
-        boost::intrusive_ptr<as_array_object> colors,
-        boost::intrusive_ptr<as_array_object> alphas,
-        boost::intrusive_ptr<as_array_object> ratios,
+        std::vector<uint32_t> colors,
+        std::vector<uint8_t> alphas,
+        std::vector<uint8_t> ratios,
         float blurX, float blurY, float strength,
         uint8_t quality, glow_types type, bool knockout) :
         m_distance(distance), m_angle(angle),
@@ -77,12 +64,12 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-private:
+protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
-    boost::intrusive_ptr<as_array_object> m_colors; // Colors of the gradients.
-    boost::intrusive_ptr<as_array_object> m_alphas; // Alphas of the gradients.
-    boost::intrusive_ptr<as_array_object> m_ratios; // Ratios of the gradients.
+    std::vector<uint32_t> m_colors; // Colors of the gradients.
+    std::vector<uint8_t> m_alphas; // Alphas of the gradients.
+    std::vector<uint8_t> m_ratios; // Ratios of the gradients.
     float m_blurX; // horizontal blur
     float m_blurY; // vertical blur
     float m_strength; // How strong is the filter.

Index: server/GradientGlowFilter.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/GradientGlowFilter.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GradientGlowFilter.cpp       27 Aug 2007 18:13:40 -0000      1.2
+++ server/GradientGlowFilter.cpp       29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientGlowFilter.cpp,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GradientGlowFilter.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #include "GradientGlowFilter.h"
 
@@ -24,15 +24,5 @@
 // See parser/filter_factory.cpp for the implementation. Purposefully not here.
 //bool GradientGlowFilter::read(stream* in);
 
-Filter const
-GradientGlowFilter::clone()
-{
-    Filter p(new GradientGlowFilter(m_distance, m_angle, m_colors, m_alphas,
-        m_ratios, m_blurX, m_blurY, m_strength, m_quality, m_type, 
m_knockout));
-    p->set_prototype(get_prototype());
-    p->copyProperties(*this);
-    return p;
-}
-
 } // Namespace gnash
 

Index: server/GradientGlowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GradientGlowFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/GradientGlowFilter.h 27 Aug 2007 18:13:40 -0000      1.2
+++ server/GradientGlowFilter.h 29 Aug 2007 03:32:58 -0000      1.3
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientGlowFilter.h,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: GradientGlowFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
 #ifndef GNASH_GRADIENTGLOWFILTER_H
 #define GNASH_GRADIENTGLOWFILTER_H
@@ -24,19 +24,16 @@
 #include "config.h"
 #endif
 
-#include "array.h"
+#include <vector>
+
 #include "BitmapFilter.h"
 
 namespace gnash {
 
-class GradientGlowFilter_as;
-
 // A gradient glow effect filter.
 class GradientGlowFilter : public BitmapFilter
 {
 public:
-    friend class GradientGlowFilter_as;
-
     typedef enum
     {
         INNER_GLOW = 2,
@@ -49,16 +46,6 @@
 
     virtual ~GradientGlowFilter() { return; }
 
-    // Clone this object and return a copy of it. (AS accessible function.)
-    // Guaranteed to return an object which can be cast to BlurFilter
-    Filter const clone();
-
-    GradientGlowFilter(as_object* obj) : BitmapFilter(obj),
-        m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
-        m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
-        m_type(INNER_GLOW), m_knockout(false)
-    { return; }
-
     GradientGlowFilter() : 
         m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
@@ -66,9 +53,9 @@
     { return; }
 
     GradientGlowFilter(float distance, float angle,
-        boost::intrusive_ptr<as_array_object> colors,
-        boost::intrusive_ptr<as_array_object> alphas,
-        boost::intrusive_ptr<as_array_object> ratios,
+        std::vector<uint32_t> colors,
+        std::vector<uint8_t> alphas,
+        std::vector<uint8_t> ratios,
         float blurX, float blurY, float strength,
         uint8_t quality, glow_types type, bool knockout) :
         m_distance(distance), m_angle(angle), m_colors(colors), 
m_alphas(alphas),
@@ -76,12 +63,12 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-private:
+protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
-    boost::intrusive_ptr<as_array_object> m_colors; // Colors of the gradients.
-    boost::intrusive_ptr<as_array_object> m_alphas; // Alphas of the gradients.
-    boost::intrusive_ptr<as_array_object> m_ratios; // Ratios of the gradients.
+    std::vector<uint32_t> m_colors; // Colors of the gradients.
+    std::vector<uint8_t> m_alphas; // Alphas of the gradients.
+    std::vector<uint8_t> m_ratios; // Ratios of the gradients.
     float m_blurX; // horizontal blur
     float m_blurY; // vertical blur
     float m_strength; // How strong is the filter.

Index: server/asobj/BevelFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/BevelFilter_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/BevelFilter_as.cpp     27 Aug 2007 18:13:40 -0000      1.2
+++ server/asobj/BevelFilter_as.cpp     29 Aug 2007 03:32:58 -0000      1.3
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BevelFilter_as.cpp,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: BevelFilter_as.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "BevelFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -25,12 +25,12 @@
 // These _must_ be defined for prophelpers to work correctly.
 // This is enforced by the file itself.
 #define phelp_helper BevelFilter_as
-#define phelp_class BevelFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class BevelFilter_as
+class BevelFilter_as : public as_object, public BevelFilter
 {
     phelp_base_def;
 public:
@@ -46,12 +46,16 @@
     phelp_gs(quality);
     phelp_gs(type);
     phelp_gs(knockout);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), BevelFilter);
 
-// Filters are purely property based.
-phelp_i_attach_empty
+// Replace BitmapFilter clone.
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 // Begin attaching properties, then attach them, then end.
 phelp_gs_attach_begin
@@ -81,10 +85,12 @@
 phelp_property(uint8_t, number<uint8_t>, quality)
 phelp_property(bool, bool, knockout)
 
+easy_clone(BevelFilter_as)
+
 as_value
 BevelFilter_as::type_gs(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter> ptr = 
ensureType<BevelFilter>(fn.this_ptr);
+    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0) // getter
     {
@@ -117,7 +123,7 @@
 as_value
 BevelFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
BevelFilter(BevelFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
BevelFilter_as(BevelFilter_as::Interface());
     BevelFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/BitmapFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/BitmapFilter_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/BitmapFilter_as.cpp    27 Aug 2007 18:13:40 -0000      1.2
+++ server/asobj/BitmapFilter_as.cpp    29 Aug 2007 03:32:58 -0000      1.3
@@ -15,8 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BitmapFilter_as.cpp,v 1.2 2007/08/27 18:13:40 cmusick Exp $ */
+/* $Id: BitmapFilter_as.cpp,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
 
+#include "as_object.h"
 #include "BitmapFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -27,11 +28,13 @@
 
 namespace gnash {
 
-class BitmapFilter_as
+class BitmapFilter_as : public as_object, public BitmapFilter
 {
     phelp_base_def;
 public:
     phelp_i(bitmap_clone);
+
+    virtual boost::intrusive_ptr<as_object> clone();
 };
 
 phelp_base_imp( , BitmapFilter);
@@ -40,20 +43,29 @@
 phelp_i_attach(clone, bitmap_clone);
 phelp_i_attach_end
 
+// Clone this object.
+boost::intrusive_ptr<as_object> BitmapFilter_as::clone()
+{
+    boost::intrusive_ptr<as_object> o = new 
BitmapFilter_as(BitmapFilter_as::Interface());
+    return o;
+}
+
 as_value
 BitmapFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
BitmapFilter(BitmapFilter_as::Interface());
-    return as_value(obj.get());
+    boost::intrusive_ptr<as_object> obj = new 
BitmapFilter_as(BitmapFilter_as::Interface());
+    return as_value(obj);
 }
 
 as_value BitmapFilter_as::bitmap_clone(const fn_call& fn)
 {
-    boost::intrusive_ptr<BitmapFilter> filter = ensureType<BitmapFilter> 
(fn.this_ptr);
-    boost::intrusive_ptr<as_object> retval = filter->clone();
-    retval->set_prototype(filter->get_prototype());
+    boost::intrusive_ptr<BitmapFilter_as> to_copy = 
ensureType<BitmapFilter_as> (fn.this_ptr);
+    boost::intrusive_ptr<BitmapFilter_as> filter = new 
BitmapFilter_as(*to_copy);
+    filter->set_prototype(filter->get_prototype());
+    filter->copyProperties(*filter);
+    boost::intrusive_ptr<as_object> r = filter;
 
-    return as_value(retval);
+    return as_value(r);
 }
 
 as_object*

Index: server/asobj/BitmapFilter_as.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/BitmapFilter_as.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/BitmapFilter_as.h      27 Aug 2007 18:13:41 -0000      1.2
+++ server/asobj/BitmapFilter_as.h      29 Aug 2007 03:32:58 -0000      1.3
@@ -38,3 +38,19 @@
 // __GNASH_ASOBJ_BITMAPFILTER_H__
 #endif
 
+#ifdef phelp_helper
+#ifndef easy_clone
+#define easy_clone(sp_name) \
+as_value \
+sp_name::bitmap_clone(const fn_call& fn) \
+{ \
+    boost::intrusive_ptr<sp_name> ptr = ensureType<sp_name>(fn.this_ptr); \
+    boost::intrusive_ptr<sp_name> obj = new sp_name(*ptr); \
+    boost::intrusive_ptr<as_object> r = obj; \
+    r->set_prototype(ptr->get_prototype()); \
+    r->copyProperties(*ptr); \
+\
+    return as_value(r); \
+}
+#endif /* easy_clone */
+#endif /* phelp_helper */

Index: server/asobj/BlurFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/BlurFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/BlurFilter_as.cpp      27 Aug 2007 18:13:41 -0000      1.1
+++ server/asobj/BlurFilter_as.cpp      29 Aug 2007 03:32:58 -0000      1.2
@@ -15,33 +15,37 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: BlurFilter_as.cpp,v 1.1 2007/08/27 18:13:41 cmusick Exp $ */
+/* $Id: BlurFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "BlurFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
 
 // These _must_ be defined.
 #define phelp_helper BlurFilter_as
-#define phelp_class BlurFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class BlurFilter_as
+class BlurFilter_as : public as_object, public BlurFilter
 {
     phelp_base_def;
 public:
     phelp_gs(blurX);
     phelp_gs(blurY);
     phelp_gs(quality);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), BlurFilter);
 
 // Filters are property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 phelp_gs_attach_begin
 phelp_gs_attach(blurX);
@@ -53,13 +57,15 @@
 phelp_property(float, number<float>, blurY)
 phelp_property(uint8_t, number<uint8_t>, quality)
 
+easy_clone(BlurFilter_as)
+
 as_value
 BlurFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
BlurFilter(BlurFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
BlurFilter_as(BlurFilter_as::Interface());
     BlurFilter_as::attachProperties(*obj);
 
-    return as_value(obj.get());
+    return as_value(obj);
 }
 
 } // Namespace gnash

Index: server/asobj/ColorMatrixFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/ColorMatrixFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/ColorMatrixFilter_as.cpp       27 Aug 2007 18:13:41 -0000      
1.1
+++ server/asobj/ColorMatrixFilter_as.cpp       29 Aug 2007 03:32:58 -0000      
1.2
@@ -15,41 +15,47 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ColorMatrixFilter_as.cpp,v 1.1 2007/08/27 18:13:41 cmusick Exp $ */
+/* $Id: ColorMatrixFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "ColorMatrixFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
 
 #define phelp_helper ColorMatrixFilter_as
-#define phelp_class ColorMatrixFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class ColorMatrixFilter_as
+class ColorMatrixFilter_as : public as_object, public ColorMatrixFilter
 {
     phelp_base_def;
 public:
     phelp_gs(matrix);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), ColorMatrixFilter);
 
 // Filters are purely property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 phelp_gs_attach_begin
 phelp_gs_attach(matrix);
 phelp_gs_attach_end
 
-phelp_array_property(matrix);
+phelp_array_property(matrix)
+
+easy_clone(ColorMatrixFilter_as)
 
 as_value
 ColorMatrixFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
ColorMatrixFilter(ColorMatrixFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
ColorMatrixFilter_as(ColorMatrixFilter_as::Interface());
     ColorMatrixFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/ConvolutionFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/ConvolutionFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/ConvolutionFilter_as.cpp       27 Aug 2007 18:13:41 -0000      
1.1
+++ server/asobj/ConvolutionFilter_as.cpp       29 Aug 2007 03:32:58 -0000      
1.2
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ConvolutionFilter_as.cpp,v 1.1 2007/08/27 18:13:41 cmusick Exp $ */
+/* $Id: ConvolutionFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "ConvolutionFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -25,10 +25,11 @@
 #define phelp_helper ConvolutionFilter_as
 #define phelp_class ConvolutionFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class ConvolutionFilter_as
+class ConvolutionFilter_as : public as_object, public ConvolutionFilter
 {
     phelp_base_def;
 public:
@@ -41,11 +42,15 @@
     phelp_gs(clamp);
     phelp_gs(color);
     phelp_gs(alpha);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), ConvolutionFilter);
 
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 phelp_gs_attach_begin
 phelp_gs_attach(matrixX);
@@ -69,10 +74,12 @@
 phelp_property(uint8_t, number<uint8_t>, alpha)
 phelp_array_property(matrix)
 
+easy_clone(ConvolutionFilter_as)
+
 as_value
 ConvolutionFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
ConvolutionFilter(ConvolutionFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
ConvolutionFilter_as(ConvolutionFilter_as::Interface());
     ConvolutionFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/DropShadowFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/DropShadowFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/DropShadowFilter_as.cpp        27 Aug 2007 18:13:42 -0000      
1.1
+++ server/asobj/DropShadowFilter_as.cpp        29 Aug 2007 03:32:58 -0000      
1.2
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: DropShadowFilter_as.cpp,v 1.1 2007/08/27 18:13:42 cmusick Exp $ */
+/* $Id: DropShadowFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "DropShadowFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -26,10 +26,11 @@
 #define phelp_helper DropShadowFilter_as
 #define phelp_class DropShadowFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class DropShadowFilter_as
+class DropShadowFilter_as : public as_object, public DropShadowFilter
 {
     phelp_base_def;
 public:
@@ -44,12 +45,16 @@
     phelp_gs(inner); 
     phelp_gs(knockout);
     phelp_gs(hideObject);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), DropShadowFilter);
 
 // Filters are property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 phelp_gs_attach_begin
 phelp_gs_attach(distance);
@@ -77,10 +82,12 @@
 phelp_property(bool, bool, knockout)
 phelp_property(bool, bool, hideObject)
 
+easy_clone(DropShadowFilter_as)
+
 as_value
 DropShadowFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
DropShadowFilter(DropShadowFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
DropShadowFilter_as(DropShadowFilter_as::Interface());
     DropShadowFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/GlowFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/GlowFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/GlowFilter_as.cpp      27 Aug 2007 18:13:42 -0000      1.1
+++ server/asobj/GlowFilter_as.cpp      29 Aug 2007 03:32:58 -0000      1.2
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GlowFilter_as.cpp,v 1.1 2007/08/27 18:13:42 cmusick Exp $ */
+/* $Id: GlowFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "GlowFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -26,10 +26,11 @@
 #define phelp_helper GlowFilter_as
 #define phelp_class GlowFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class GlowFilter_as
+class GlowFilter_as : public as_object, public GlowFilter
 {
     phelp_base_def;
 public:
@@ -41,12 +42,16 @@
     phelp_gs(quality);
     phelp_gs(inner); 
     phelp_gs(knockout);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), GlowFilter);
 
 // Filters are property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 phelp_gs_attach_begin
 phelp_gs_attach(color);
@@ -68,10 +73,12 @@
 phelp_property(bool, bool, inner)
 phelp_property(bool, bool, knockout)
 
+easy_clone(GlowFilter_as)
+
 as_value
 GlowFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GlowFilter(GlowFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
GlowFilter_as(GlowFilter_as::Interface());
     GlowFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/GradientBevelFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/GradientBevelFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/GradientBevelFilter_as.cpp     27 Aug 2007 18:13:43 -0000      
1.1
+++ server/asobj/GradientBevelFilter_as.cpp     29 Aug 2007 03:32:58 -0000      
1.2
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientBevelFilter_as.cpp,v 1.1 2007/08/27 18:13:43 cmusick Exp $ */
+/* $Id: GradientBevelFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "GradientBevelFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -27,10 +27,11 @@
 #define phelp_helper GradientBevelFilter_as
 #define phelp_class GradientBevelFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class GradientBevelFilter_as
+class GradientBevelFilter_as : public as_object, public GradientBevelFilter
 {
     phelp_base_def;
 public:
@@ -45,12 +46,16 @@
     phelp_gs(quality);
     phelp_gs(type); // No automation
     phelp_gs(knockout);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), GradientBevelFilter);
 
 // Filters are purely property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 // Begin attaching properties, then attach them, then end.
 phelp_gs_attach_begin
@@ -79,10 +84,12 @@
 // Type is not automatable.
 phelp_property(bool, bool, knockout)
 
+easy_clone(GradientBevelFilter_as)
+
 as_value
 GradientBevelFilter_as::type_gs(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter> ptr = 
ensureType<GradientBevelFilter>(fn.this_ptr);
+    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0) // getter
     {
@@ -115,7 +122,7 @@
 as_value
 GradientBevelFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GradientBevelFilter(GradientBevelFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
GradientBevelFilter_as(GradientBevelFilter_as::Interface());
     GradientBevelFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/GradientGlowFilter_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/GradientGlowFilter_as.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/GradientGlowFilter_as.cpp      27 Aug 2007 18:13:43 -0000      
1.1
+++ server/asobj/GradientGlowFilter_as.cpp      29 Aug 2007 03:32:58 -0000      
1.2
@@ -15,9 +15,9 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: GradientGlowFilter_as.cpp,v 1.1 2007/08/27 18:13:43 cmusick Exp $ */
+/* $Id: GradientGlowFilter_as.cpp,v 1.2 2007/08/29 03:32:58 cmusick Exp $ */
 
-#include "BitmapFilter_as.h"
+#include "as_object.h"
 #include "GradientGlowFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
@@ -27,10 +27,11 @@
 #define phelp_helper GradientGlowFilter_as
 #define phelp_class GradientGlowFilter
 #include "prophelper.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class GradientGlowFilter_as
+class GradientGlowFilter_as : public as_object, public GradientGlowFilter
 {
     phelp_base_def;
 public:
@@ -45,12 +46,16 @@
     phelp_gs(quality);
     phelp_gs(type); // No automation
     phelp_gs(knockout);
+
+    phelp_i(bitmap_clone);
 };
 
 phelp_base_imp((bitmapFilter_interface()), GradientGlowFilter);
 
 // Filters are purely property based.
-phelp_i_attach_empty
+phelp_i_attach_begin
+phelp_i_replace(clone, bitmap_clone);
+phelp_i_attach_end
 
 // Begin attaching properties, then attach them, then end.
 phelp_gs_attach_begin
@@ -79,10 +84,12 @@
 // Type is not automatable.
 phelp_property(bool, bool, knockout)
 
+easy_clone(GradientGlowFilter_as)
+
 as_value
 GradientGlowFilter_as::type_gs(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientGlowFilter> ptr = 
ensureType<GradientGlowFilter>(fn.this_ptr);
+    boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0) // getter
     {
@@ -115,7 +122,7 @@
 as_value
 GradientGlowFilter_as::ctor(const fn_call& /*fn*/)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GradientGlowFilter(GradientGlowFilter_as::Interface());
+    boost::intrusive_ptr<as_object> obj = new 
GradientGlowFilter_as(GradientGlowFilter_as::Interface());
     GradientGlowFilter_as::attachProperties(*obj);
 
     return as_value(obj.get());

Index: server/asobj/prophelper.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/prophelper.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/prophelper.h   27 Aug 2007 18:13:43 -0000      1.1
+++ server/asobj/prophelper.h   29 Aug 2007 03:32:58 -0000      1.2
@@ -30,7 +30,6 @@
 //
 #ifdef phelp_done
 #undef phelp_helper
-#undef phelp_class
 #undef phelp_property
 #undef phelp_array_property
 #undef phelp_base_def
@@ -47,13 +46,12 @@
 #undef phelp_i_attach_empty
 #else /* phelp_done */
 #ifdef phelp_helper
-#ifdef phelp_class
 
 #define phelp_property(sp_type, sp_convert, sp_name) \
 as_value \
 phelp_helper::sp_name##_gs(const fn_call& fn) \
 { \
-    boost::intrusive_ptr<phelp_class> ptr = 
ensureType<phelp_class>(fn.this_ptr); \
+    boost::intrusive_ptr<phelp_helper> ptr = 
ensureType<phelp_helper>(fn.this_ptr); \
 \
     if (fn.nargs == 0) /* getter */ \
     { \
@@ -70,7 +68,11 @@
 as_value \
 phelp_helper::sp_name##_gs(const fn_call& fn) \
 { \
-    boost::intrusive_ptr<phelp_class> ptr = 
ensureType<phelp_class>(fn.this_ptr); \
+    boost::intrusive_ptr<phelp_helper> ptr = 
ensureType<phelp_helper>(fn.this_ptr); \
+    return as_value(); \
+}
+#if 0
+    boost::intrusive_ptr<phelp_helper> ptr = 
ensureType<phelp_helper>(fn.this_ptr); \
 \
     if (fn.nargs == 0) /* getter */ \
     { \
@@ -84,9 +86,11 @@
 \
     return as_value(); \
 }
+#endif /* 0 */
 
 #define phelp_base_def \
 public: \
+    phelp_helper(as_object *obj) : as_object(obj) { return; } \
     static as_object* Interface(); \
     static void attachInterface(as_object& o); \
     static void attachProperties(as_object& o); \
@@ -181,9 +185,9 @@
 #define phelp_i_attach(sp_name, sp_code_name) \
     o.init_member(#sp_name , new builtin_function(sp_code_name))
 
-#else /* phelp_class */
-#error phelp_class must be defined.
-#endif /* phelp_class */
+#define phelp_i_replace(sp_name, sp_code_name) \
+    o.set_member(#sp_name , new builtin_function(sp_code_name))
+
 #else /* phelp_helper */
 #error phelp_helper must be defined.
 #endif /* phelp_helper */

Index: server/parser/filter_factory.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/filter_factory.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/parser/filter_factory.cpp    27 Aug 2007 18:13:43 -0000      1.4
+++ server/parser/filter_factory.cpp    29 Aug 2007 03:32:59 -0000      1.5
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: filter_factory.cpp,v 1.4 2007/08/27 18:13:43 cmusick Exp $ */
+/* $Id: filter_factory.cpp,v 1.5 2007/08/29 03:32:59 cmusick Exp $ */
 
 #include "filter_factory.h"
 #include "BitmapFilter.h"
@@ -198,15 +198,18 @@
 {
     uint8_t count = in->read_u8(); // How many colorings.
 
+    m_colors.reserve(count);
+    m_alphas.reserve(count);
+    m_ratios.reserve(count);
     for (int i = 0; i < count; ++i)
     {
-        m_colors->push(as_value(in->read_u8() << 16 + in->read_u8() << 8 + 
in->read_u8()));
-        m_alphas->push(as_value(in->read_u8()));
+        m_colors.push_back(in->read_u8() << 16 + in->read_u8() << 8 + 
in->read_u8());
+        m_alphas.push_back(in->read_u8());
     }
 
     for (int i = 0; i < count; ++i)
     {
-        m_ratios->push(as_value(in->read_u8()));
+        m_ratios.push_back(in->read_u8());
     }
 
     m_blurX = in->read_fixed();
@@ -237,14 +240,10 @@
     m_divisor = in->read_float();
     m_bias = in->read_float();
 
-    if (m_matrix == NULL)
-    {
-        m_matrix = new as_array_object;
-    }
-
+    m_matrix.reserve(m_matrixX * m_matrixY);
     for (int i = 0; i < m_matrixX * m_matrixY; ++i)
     {
-        m_matrix->push(as_value(in->read_float()));
+        m_matrix.push_back(in->read_float());
     }
 
     m_color = in->read_u8() << 16 + in->read_u8() << 8 + in->read_u8();
@@ -260,12 +259,10 @@
 
 bool ColorMatrixFilter::read(stream* in)
 {
-    if (m_matrix == NULL)
-        m_matrix = new as_array_object;
-
+    m_matrix.reserve(20);
     for (int i = 0; i < 20; ++i)
     {
-        m_matrix->push(in->read_float());
+        m_matrix.push_back(in->read_float());
     }
 
     return true;
@@ -275,15 +272,18 @@
 {
     uint8_t count = in->read_u8(); // How many colorings.
 
+    m_colors.reserve(count);
+    m_alphas.reserve(count);
+    m_ratios.reserve(count);
     for (int i = 0; i < count; ++i)
     {
-        m_colors->push(as_value(in->read_u8() << 16 + in->read_u8() << 8 + 
in->read_u8()));
-        m_alphas->push(as_value(in->read_u8()));
+        m_colors.push_back(in->read_u8() << 16 + in->read_u8() << 8 + 
in->read_u8());
+        m_alphas.push_back(in->read_u8());
     }
 
     for (int i = 0; i < count; ++i)
     {
-        m_ratios->push(as_value(in->read_u8()));
+        m_ratios.push_back(in->read_u8());
     }
 
     m_blurX = in->read_fixed();




reply via email to

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