gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/matrix.cpp testsuite/act...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/matrix.cpp testsuite/act...
Date: Sat, 14 Apr 2007 22:23:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/14 22:23:05

Modified files:
        .              : ChangeLog 
        server         : matrix.cpp 
        testsuite/actionscript.all: MovieClip.as 
        testsuite/misc-ming.all: matrix_test.c 
        testsuite/server: MatrixTest.cpp 

Log message:
                * testsuite/actionscript.all/MovieClip.as,
                  testsuite/misc-ming.all/matrix_test.c,
                  testsuite/server/MatrixTest.cpp: more successes
                  after Eric patch ! A few more tests added in
                  matrix_test.c too, and more will be needed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2874&r2=1.2875
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/matrix_test.c?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/MatrixTest.cpp?cvsroot=gnash&r1=1.5&r2=1.6

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2874
retrieving revision 1.2875
diff -u -b -r1.2874 -r1.2875
--- ChangeLog   14 Apr 2007 18:19:49 -0000      1.2874
+++ ChangeLog   14 Apr 2007 22:23:04 -0000      1.2875
@@ -1,3 +1,16 @@
+2007-04-15 Sandro Santilli <address@hidden>
+
+       * testsuite/actionscript.all/MovieClip.as,
+         testsuite/misc-ming.all/matrix_test.c,
+         testsuite/server/MatrixTest.cpp: more successes
+         after Eric patch ! A few more tests added in
+         matrix_test.c too, and more will be needed.
+
+2007-04-15 Eric Hughes <address@hidden>
+
+       * server/matrix.cpp (get_x_scale, get_y_scale): fixed implementations
+         to match the interpretation of matrix used in set_scale_rotation.
+
 2007-04-14 Sandro Santilli <address@hidden>
 
        * server/character.cpp (height_getset, width_getset): round

Index: server/matrix.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/matrix.cpp   14 Apr 2007 14:38:28 -0000      1.10
+++ server/matrix.cpp   14 Apr 2007 22:23:05 -0000      1.11
@@ -18,7 +18,7 @@
 //
 // Original author: Thatcher Ulrich <address@hidden> 2003
 //
-// $Id: matrix.cpp,v 1.10 2007/04/14 14:38:28 strk Exp $ 
+// $Id: matrix.cpp,v 1.11 2007/04/14 22:23:05 strk Exp $ 
 //
 
 #ifdef HAVE_CONFIG_H
@@ -343,8 +343,13 @@
        // @@ not 100% sure what the heck I'm doing here.  I
        // think this is roughly what I want; take the max
        // length of the two basis vectors.
-       float   basis0_length2 = m_[0][0] * m_[0][0] + m_[0][1] * m_[0][1];
-       float   basis1_length2 = m_[1][0] * m_[1][0] + m_[1][1] * m_[1][1];
+
+       //float basis0_length2 = m_[0][0] * m_[0][0] + m_[0][1] * m_[0][1];
+       float   basis0_length2 = m_[0][0] * m_[0][0] + m_[1][0] * m_[1][0];
+
+       //float basis1_length2 = m_[1][0] * m_[1][0] + m_[1][1] * m_[1][1];
+       float   basis1_length2 = m_[0][1] * m_[0][1] + m_[1][1] * m_[1][1];
+
        float   max_length2 = fmax(basis0_length2, basis1_length2);
        return sqrtf(max_length2);
 }
@@ -352,7 +357,9 @@
 float
 matrix::get_x_scale() const
 {
-       float   scale = sqrtf(m_[0][0] * m_[0][0] + m_[0][1] * m_[0][1]);
+       // Scale is applied before rotation, must match implementation
+       // in set_scale_rotation
+       float   scale = sqrtf(m_[0][0] * m_[0][0] + m_[1][0] * m_[1][0]);
 
        // Are we turned inside out?
        if (get_determinant() < 0.f)
@@ -366,7 +373,9 @@
 float
 matrix::get_y_scale() const
 {
-       return sqrtf(m_[1][1] * m_[1][1] + m_[1][0] * m_[1][0]);
+       // Scale is applied before rotation, must match implementation
+       // in set_scale_rotation
+       return sqrtf(m_[1][1] * m_[1][1] + m_[0][1] * m_[0][1]);
 }
 
 float

Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- testsuite/actionscript.all/MovieClip.as     14 Apr 2007 16:27:22 -0000      
1.57
+++ testsuite/actionscript.all/MovieClip.as     14 Apr 2007 22:23:05 -0000      
1.58
@@ -22,7 +22,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: MovieClip.as,v 1.57 2007/04/14 16:27:22 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.58 2007/04/14 22:23:05 strk Exp $";
 
 #include "check.as"
 
@@ -607,13 +607,13 @@
 check_equals(draw._height, 20);
 
 draw._rotation = 0;
-xcheck_equals(draw._width, 20);
-xcheck_equals(draw._height, 20);
+check_equals(draw._width, 20);
+check_equals(draw._height, 20);
 
 draw._visible = true;
 draw._xscale = 100;
 check_equals(draw._width, 10);
-xcheck_equals(draw._height, 20);
+check_equals(draw._height, 20);
 
 draw._yscale = 50;
 check_equals(draw._width, 10);

Index: testsuite/misc-ming.all/matrix_test.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/matrix_test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testsuite/misc-ming.all/matrix_test.c       14 Apr 2007 18:19:49 -0000      
1.1
+++ testsuite/misc-ming.all/matrix_test.c       14 Apr 2007 22:23:05 -0000      
1.2
@@ -122,8 +122,23 @@
        check_equals(mo, "staticmc._width", "85");
        check_equals(mo, "staticmc._height", "85");
 
+       SWFMovie_nextFrame(mo);        
+
+       SWFDisplayItem_scale(it, 2, 3);
+
+       check_equals(mo, "staticmc._x", "50");
+       check_equals(mo, "staticmc._y", "300");
+       check_equals(mo, "Math.round(staticmc._xscale)", "200");
+       check_equals(mo, "Math.round(staticmc._yscale)", "300");
+       check_equals(mo, "staticmc._rotation", "45");
+       check_equals(mo, "printBounds(staticmc.getBounds())", "'-30.05,-30.05 
30.05,30.05'");
+       check_equals(mo, "printBounds(staticmc.getBounds(_root))", 
"'-56.25,193.75 156.25,406.25'");
+       check_equals(mo, "staticmc._width", "212.5");
+       check_equals(mo, "staticmc._height", "212.5");
+
        // TODO:
-       // - test mixing rotation and scale !
+       // - test more rotations and scales (corner cases too!)
+       // - test 'skew' (since Ming supports it)
 
 
 

Index: testsuite/server/MatrixTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/MatrixTest.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/server/MatrixTest.cpp     12 Apr 2007 16:29:14 -0000      1.5
+++ testsuite/server/MatrixTest.cpp     14 Apr 2007 22:23:05 -0000      1.6
@@ -100,13 +100,13 @@
        check_equals(D(m1.get_rotation()), 2);
 
        m1.set_scale_rotation(2, 1, 2);
-       xcheck_equals(D(m1.get_x_scale()), 2);
-       xcheck_equals(D(m1.get_y_scale()), 1);
+       check_equals(D(m1.get_x_scale()), 2);
+       check_equals(D(m1.get_y_scale()), 1);
        check_equals(D(m1.get_rotation()), 2);
 
        m1.set_scale_rotation(1, 2, 2);
-       xcheck_equals(D(m1.get_x_scale()), 1);
-       xcheck_equals(D(m1.get_y_scale()), 2);
+       check_equals(D(m1.get_x_scale()), 1);
+       check_equals(D(m1.get_y_scale()), 2);
        check_equals(D(m1.get_rotation()), 2);
 }
 




reply via email to

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