gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/Color.cpp testsuit...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/Color.cpp testsuit...
Date: Fri, 02 Nov 2007 17:50:50 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/11/02 17:50:50

Modified files:
        .              : ChangeLog 
        server/asobj   : Color.cpp 
        testsuite/actionscript.all: Color.as 
        testsuite/swfdec: PASSING 

Log message:
                * server/asobj/Color.cpp: more bug fixes.
                * testsuite/actionscript.all/Color.as: more tests. Most pass
                  except a suspicious one about some kind of rounding which is
                  not clear to me.
                * testsuite/swfdec/PASSING: two more tests pass.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4760&r2=1.4761
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Color.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Color.as?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.54&r2=1.55

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4760
retrieving revision 1.4761
diff -u -b -r1.4760 -r1.4761
--- ChangeLog   2 Nov 2007 15:10:42 -0000       1.4760
+++ ChangeLog   2 Nov 2007 17:50:49 -0000       1.4761
@@ -1,5 +1,13 @@
 2007-11-02 Sandro Santilli <address@hidden>
 
+       * server/asobj/Color.cpp: more bug fixes.
+       * testsuite/actionscript.all/Color.as: more tests. Most pass
+         except a suspicious one about some kind of rounding which is
+         not clear to me.
+       * testsuite/swfdec/PASSING: two more tests pass.
+
+2007-11-02 Sandro Santilli <address@hidden>
+
        * server/asobj/Global.cpp: don't forget to initialize the Color class.
        * server/sprite_instance.{cpp,h}: add a _userCxform and accessor 
          methods; override get_world_cxform to take it into account.

Index: server/asobj/Color.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Color.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/asobj/Color.cpp      2 Nov 2007 15:10:43 -0000       1.13
+++ server/asobj/Color.cpp      2 Nov 2007 17:50:49 -0000       1.14
@@ -217,10 +217,10 @@
        ret->init_member("ba", cx.m_[2][0]*100);
        ret->init_member("aa", cx.m_[3][0]*100);
 
-       ret->init_member("rb", cx.m_[0][1]*255);
-       ret->init_member("gb", cx.m_[1][1]*255);
-       ret->init_member("bb", cx.m_[2][1]*255);
-       ret->init_member("ab", cx.m_[3][1]*255);
+       ret->init_member("rb", cx.m_[0][1]);
+       ret->init_member("gb", cx.m_[1][1]);
+       ret->init_member("bb", cx.m_[2][1]);
+       ret->init_member("ab", cx.m_[3][1]);
 
        return ret;
 }
@@ -242,12 +242,15 @@
 
        int r = (color&0xFF0000) >> 16;
        int g = (color&0x00FF00) >> 8;
-       int b = (color&0x0000FF) >> 8;
+       int b = (color&0x0000FF);
 
-       cxform newTrans;
+       cxform newTrans = obj->getTransform();
        newTrans.m_[0][1] = r;
        newTrans.m_[1][1] = g;
        newTrans.m_[2][1] = b;
+       newTrans.m_[0][0] = 0;
+       newTrans.m_[1][0] = 0;
+       newTrans.m_[2][0] = 0;
 
        obj->setTransform(newTrans);
 
@@ -262,7 +265,7 @@
 
        if ( ! obj.get_member(key, &tmp) ) return;
        d = tmp.to_number(&env);
-       if ( scale ) *target = d/100;
+       if ( scale ) *target = d/100.0;
        else *target = d;
 }
 

Index: testsuite/actionscript.all/Color.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Color.as,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- testsuite/actionscript.all/Color.as 2 Nov 2007 15:10:43 -0000       1.11
+++ testsuite/actionscript.all/Color.as 2 Nov 2007 17:50:50 -0000       1.12
@@ -21,7 +21,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: Color.as,v 1.11 2007/11/02 15:10:43 strk Exp $";
+rcsid="$Id: Color.as,v 1.12 2007/11/02 17:50:50 strk Exp $";
 
 #include "check.as"
 
@@ -113,37 +113,115 @@
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0xFF0000 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, 100 );
+check_equals ( trans2.rb, 255 );
+check_equals ( trans2.ga, 100 );
+check_equals ( trans2.gb, 0 );
+check_equals ( trans2.ba, 100 );
+check_equals ( trans2.bb, 0 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 trans.gb = 128;
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0xFF8000 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, 100 );
+check_equals ( trans2.rb, 255 );
+check_equals ( trans2.ga, 100 );
+check_equals ( trans2.gb, 128 );
+check_equals ( trans2.ba, 100 );
+check_equals ( trans2.bb, 0 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 trans.bb = 32; 
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0xFF8020 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, 100 );
+check_equals ( trans2.rb, 255 );
+check_equals ( trans2.ga, 100 );
+check_equals ( trans2.gb, 128 );
+check_equals ( trans2.ba, 100 );
+check_equals ( trans2.bb, 32 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 trans = { ra:-100, ga:-50, ba:50 };
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0xFF8020 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, -100 );
+check_equals ( trans2.rb, 255 );
+check_equals ( trans2.ga, -50 );
+check_equals ( trans2.gb, 128 );
+check_equals ( trans2.ba, 50 );
+check_equals ( trans2.bb, 32 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 trans = { rb:0 }; // only modify the red channel
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0x008020 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, -100 );
+check_equals ( trans2.rb, 0 );
+check_equals ( trans2.ga, -50 );
+check_equals ( trans2.gb, 128 );
+check_equals ( trans2.ba, 50 );
+check_equals ( trans2.bb, 32 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 o = {}; o.valueOf = function() { return 255; };
 trans = { gb:o }; // only modify the green channel
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0x00FF20 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, -100 );
+check_equals ( trans2.rb, 0 );
+check_equals ( trans2.ga, -50 );
+check_equals ( trans2.gb, 255 );
+check_equals ( trans2.ba, 50 );
+check_equals ( trans2.bb, 32 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 trans = { bb:2 }; // only modify the blue channel
 colorObj.setTransform(trans);
 rgb = colorObj.getRGB();
 check_equals ( rgb, 0x00FF02 );
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, -100 );
+check_equals ( trans2.rb, 0 );
+check_equals ( trans2.ga, -50 );
+check_equals ( trans2.gb, 255 );
+check_equals ( trans2.ba, 50 );
+check_equals ( trans2.bb, 2 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
+
+trans = { ba:32 }; // modify the scale of blue channel
+colorObj.setTransform(trans);
+rgb = colorObj.getRGB();
+check_equals ( rgb, 0x00FF02 );
+
+trans2 = colorObj.getTransform();
+check_equals ( trans2.ra, -100 );
+check_equals ( trans2.rb, 0 );
+check_equals ( trans2.ga, -50 );
+check_equals ( trans2.gb, 255 );
+xcheck_equals ( Math.round(trans2.ba*100)/100, 31.64 ); // gnash returns 32, 
who's right ?
+check_equals ( trans2.bb, 2 );
+check_equals ( trans2.aa, 100 );
+check_equals ( trans2.ab, 0 );
 
 //-----------------------------------------------------------
 // test the Color::setRGB method
@@ -151,14 +229,14 @@
 
 check_equals ( typeof(colorObj.setRGB), 'function');
 colorObj.setRGB(0x667799);
-xcheck_equals ( colorObj.getRGB(), 0x667799 );
+check_equals ( colorObj.getRGB(), 0x667799 );
 trans = colorObj.getTransform();
-xcheck_equals ( trans.ra, 0 );
-xcheck_equals ( trans.rb, 102 );
-xcheck_equals ( trans.ga, 0 );
-xcheck_equals ( trans.gb, 119 );
-xcheck_equals ( trans.ba, 0 );
-xcheck_equals ( trans.bb, 153 );
+check_equals ( trans.ra, 0 );
+check_equals ( trans.rb, 102 );
+check_equals ( trans.ga, 0 );
+check_equals ( trans.gb, 119 );
+check_equals ( trans.ba, 0 );
+check_equals ( trans.bb, 153 );
 check_equals ( trans.aa, 100 );
 check_equals ( trans.ab, 0 );
 

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- testsuite/swfdec/PASSING    2 Nov 2007 15:10:43 -0000       1.54
+++ testsuite/swfdec/PASSING    2 Nov 2007 17:50:50 -0000       1.55
@@ -54,6 +54,8 @@
 clonesprite-depths-8.swf:af472e7f31b31e886ca86430fb71106f
 color-getters.swf:4cee4418f75171e7bf423759a468b36b
 color-new.swf:b19cf3d46f416b919eb312da473b6756
+color-setRGB.swf:0841414e9ac7d2f9b57e40aec3d2f44f
+color-setTransform-empty.swf:2a72a5273ab8713ee289ff1726b0959c
 color-setTransform-negative.swf:0bc0510c35fc5c82de31b0db887fe535
 comparisons-5.swf:d4dfeb4ec80ec1f5a7390eb699e269ee
 comparisons-6.swf:5a7bf1ffb3a4dd23828d6e180f1871b0




reply via email to

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