[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/DynamicShape.cpp server/...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/DynamicShape.cpp server/... |
Date: |
Fri, 20 Jun 2008 13:28:56 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/06/20 13:28:56
Modified files:
. : ChangeLog
server : DynamicShape.cpp
server/asobj/flash/display: BitmapData_as.cpp BitmapData_as.h
server/asobj/flash/geom: Point_as.h
testsuite/actionscript.all: BitmapData.as
Log message:
* testsuite/actionscript.all/BitmapData.as: minor change.
* server/asobj/flash/geom/Point_as.h: header cleanup.
* server/asobj/flash/display/BitmapData_as.{h,cpp}: move class
definition to the header, as something will need to get the
bitmap data out.
* server/DynamicShape.cpp: drop <cfloat> include.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6996&r2=1.6997
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DynamicShape.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/display/BitmapData_as.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/display/BitmapData_as.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/Point_as.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/BitmapData.as?cvsroot=gnash&r1=1.2&r2=1.3
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6996
retrieving revision 1.6997
diff -u -b -r1.6996 -r1.6997
--- ChangeLog 20 Jun 2008 11:21:07 -0000 1.6996
+++ ChangeLog 20 Jun 2008 13:28:54 -0000 1.6997
@@ -1,5 +1,14 @@
2008-06-20 Benjamin Wolsey <address@hidden>
+ * testsuite/actionscript.all/BitmapData.as: minor change.
+ * server/asobj/flash/geom/Point_as.h: header cleanup.
+ * server/asobj/flash/display/BitmapData_as.{h,cpp}: move class
+ definition to the header, as something will need to get the
+ bitmap data out.
+ * server/DynamicShape.cpp: drop <cfloat> include.
+
+2008-06-20 Benjamin Wolsey <address@hidden>
+
* testsuite/actionscript.all/BitmapData.as: more tests.
* server/asobj/flash/display/BitmapData_as.cpp: implement
constructor, getPixel, getPixel32, height, width, transparency,
Index: server/DynamicShape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/DynamicShape.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/DynamicShape.cpp 2 May 2008 17:11:55 -0000 1.20
+++ server/DynamicShape.cpp 20 Jun 2008 13:28:55 -0000 1.21
@@ -20,7 +20,6 @@
#include "DynamicShape.h"
-#include <cfloat>
#include <algorithm>
Index: server/asobj/flash/display/BitmapData_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/display/BitmapData_as.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/asobj/flash/display/BitmapData_as.cpp 20 Jun 2008 11:21:08
-0000 1.6
+++ server/asobj/flash/display/BitmapData_as.cpp 20 Jun 2008 13:28:55
-0000 1.7
@@ -129,17 +129,7 @@
return o.get();
}
-class BitmapData_as: public as_object
-{
-
- typedef std::vector<boost::uint32_t> BitmapArray;
-
-public:
-
- // The constructor sets the fill colour and the
- // immutable size of the bitmap, as well as whether
- // it can handle transparency or not.
- BitmapData_as(size_t width, size_t height,
+BitmapData_as::BitmapData_as(size_t width, size_t height,
bool transparent, boost::uint32_t fillColor)
:
as_object(getBitmapDataInterface()),
@@ -147,36 +137,8 @@
_height(height),
_transparent(transparent),
_bitmapData(new BitmapArray(width * height, fillColor + (0xff
<< 24)))
- {}
-
- size_t getWidth() const { return _width; }
- size_t getHeight() const { return _height; }
- bool isTransparent() const { return _transparent; }
-
- // Returns an unsigned int representation of the pixel
- // at (x, y) either with or without transparency.
- boost::int32_t getPixel(int x, int y, bool transparency) const;
-
- // Fill the bitmap with a colour starting at x, y
- void fillRect(int x, int y, int w, int h, boost::uint32_t color);
-
-private:
-
- // The width of the image, max 2880. This is immutable.
- const size_t _width;
-
- // The height of the image, max 2880. This is immutable.
- const size_t _height;
-
- // Whether the image is transparent. This is immutable.
- const bool _transparent;
-
- // A static array of 32-bit values holding the actual bitmap data.
- // The maximum size is 2880 x 2880 * 4 bytes = 33177600 bytes, so
- // this must be heap allocated.
- std::auto_ptr<BitmapArray> _bitmapData;
-
-};
+{
+}
//
Index: server/asobj/flash/display/BitmapData_as.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/display/BitmapData_as.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/display/BitmapData_as.h 5 May 2008 08:57:30 -0000
1.1
+++ server/asobj/flash/display/BitmapData_as.h 20 Jun 2008 13:28:55 -0000
1.2
@@ -17,24 +17,74 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-#ifndef __GNASH_ASOBJ_BITMAPDATA_H__
-#define __GNASH_ASOBJ_BITMAPDATA_H__
+#ifndef GNASH_ASOBJ_BITMAPDATA_H
+#define GNASH_ASOBJ_BITMAPDATA_H
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
#endif
-//#include <memory> // for auto_ptr
+#include "smart_ptr.h"
+#include "as_object.h"
namespace gnash {
+class as_function;
class as_object;
+class BitmapData_as: public as_object
+{
+
+ typedef std::vector<boost::uint32_t> BitmapArray;
+
+public:
+
+ // The constructor sets the fill colour and the
+ // immutable size of the bitmap, as well as whether
+ // it can handle transparency or not.
+ BitmapData_as(size_t width, size_t height,
+ bool transparent, boost::uint32_t fillColor);
+
+ const size_t getWidth() const { return _width; }
+ const size_t getHeight() const { return _height; }
+ const bool isTransparent() const { return _transparent; }
+
+ const BitmapArray& getBitmapData() const
+ {
+ assert (_bitmapData.get());
+ return *_bitmapData;
+ }
+
+ // Returns an unsigned int representation of the pixel
+ // at (x, y) either with or without transparency.
+ boost::int32_t getPixel(int x, int y, bool transparency) const;
+
+ // Fill the bitmap with a colour starting at x, y
+ void fillRect(int x, int y, int w, int h, boost::uint32_t color);
+
+private:
+
+ // The width of the image, max 2880. This is immutable.
+ const size_t _width;
+
+ // The height of the image, max 2880. This is immutable.
+ const size_t _height;
+
+ // Whether the image is transparent. This is immutable.
+ const bool _transparent;
+
+ // A static array of 32-bit values holding the actual bitmap data.
+ // The maximum size is 2880 x 2880 * 4 bytes = 33177600 bytes, so
+ // this must be heap allocated.
+ std::auto_ptr<BitmapArray> _bitmapData;
+
+};
+
+
/// Initialize the global BitmapData class
void BitmapData_class_init(as_object& global);
-/// Return a BitmapData instance (in case the core lib needs it)
-//std::auto_ptr<as_object> init_BitmapData_instance();
+as_function* getFlashDisplayBitmapDataConstructor();
} // end of gnash namespace
Index: server/asobj/flash/geom/Point_as.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/Point_as.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/asobj/flash/geom/Point_as.h 10 Jun 2008 12:59:25 -0000 1.5
+++ server/asobj/flash/geom/Point_as.h 20 Jun 2008 13:28:55 -0000 1.6
@@ -24,12 +24,12 @@
#include "gnashconfig.h"
#endif
-#include "as_object.h" // For visibility to auto_ptr
-#include <memory> // for auto_ptr
+#include "smart_ptr.h" // boost::intrusive_ptr
namespace gnash {
class as_function;
+class as_object;
/// Initialize the global Point class
void Point_class_init(as_object& global);
@@ -42,5 +42,4 @@
} // end of gnash namespace
-// __GNASH_ASOBJ_POINT_H__
#endif
Index: testsuite/actionscript.all/BitmapData.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/BitmapData.as,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/actionscript.all/BitmapData.as 20 Jun 2008 11:21:09 -0000
1.2
+++ testsuite/actionscript.all/BitmapData.as 20 Jun 2008 13:28:56 -0000
1.3
@@ -20,7 +20,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: BitmapData.as,v 1.2 2008/06/20 11:21:09 bwy Exp $";
+rcsid="$Id: BitmapData.as,v 1.3 2008/06/20 13:28:56 bwy Exp $";
#include "check.as"
@@ -117,7 +117,7 @@
xcheck_equals(bmp, undefined);
bmp = new Bitmap(2881, 0);
-xcheck_equals(bmp, undefined);
+xcheck_equals(typeof(bmp), "undefined");
bmp = new Bitmap(0, 2881);
xcheck_equals(bmp, undefined);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/DynamicShape.cpp server/...,
Benjamin Wolsey <=