gnash-commit
[Top][All Lists]
Advanced

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

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


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog server/styles.cpp testsuite/act...
Date: Fri, 23 May 2008 02:30:21 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  08/05/23 02:30:21

Modified files:
        .              : ChangeLog 
        server         : styles.cpp 
        testsuite/actionscript.all: Color.as 

Log message:
        * server/styles.cpp: read_bit() reduction, cleanups. 
        * testsuite/actionscript.all/color.as: one xcheck to check, probably
          already passed before.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6679&r2=1.6680
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Color.as?cvsroot=gnash&r1=1.19&r2=1.20

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6679
retrieving revision 1.6680
diff -u -b -r1.6679 -r1.6680
--- ChangeLog   22 May 2008 21:35:40 -0000      1.6679
+++ ChangeLog   23 May 2008 02:30:19 -0000      1.6680
@@ -1,3 +1,9 @@
+2008-05-23 Zou Lunkai <address@hidden>
+       
+       * server/styles.cpp: read_bit() reduction, cleanups. 
+       * testsuite/actionscript.all/color.as: one xcheck to check, probably
+         already passed before. 
+       
 2008-05-22 Russ Nelson <address@hidden>
 
        * doc/C/Makefile.am: list the files one by one, not the subdir.

Index: server/styles.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/styles.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/styles.cpp   18 May 2008 20:36:12 -0000      1.44
+++ server/styles.cpp   23 May 2008 02:30:20 -0000      1.45
@@ -58,31 +58,26 @@
        m_width = in->read_u16();
        pOther->m_width = in->read_u16();
 
-       // TODO: Same as in read(...), use these.
-       // 0 -- Round caps, 1 -- No caps, 2 -- square caps
-       _startCapStyle = (cap_style_e) in->read_uint(2);
-       // 0 -- Round join, 1 -- Bevel join, 2 -- Miter join
-       _joinStyle = (join_style_e) in->read_uint(2);
-       bool has_fill = in->read_bit();
-       _scaleHorizontally = ! in->read_bit();
-       _scaleVertically = ! in->read_bit();
-       _pixelHinting = in->read_bit();
-
-       static_cast<void> (in->read_uint(5));
-       _noClose = in->read_bit();
-       _endCapStyle = (cap_style_e) in->read_uint(2); // As caps above.
+    int flags1 = in->read_u8();
+    int flags2 = in->read_u8();
+    _startCapStyle =  (cap_style_e)((flags1 & 0xC0) >> 6);
+    _joinStyle     = (join_style_e)((flags1 & 0x30) >> 4);
+    bool has_fill      =   flags1 & (1 << 3);
+    _scaleHorizontally = !(flags1 & (1 << 2));
+    _scaleVertically   = !(flags1 & (1 << 1));
+    _pixelHinting      =   flags1 & (1 << 0);
+       _noClose = flags2 & (1 << 2);
+       _endCapStyle = (cap_style_e) (flags2 & 0x03); 
 
-       if (_joinStyle == JOIN_MITER)  // style 2
+       if (_joinStyle == JOIN_MITER)  
        {
                in->ensureBytes(2);
                _miterLimitFactor = in->read_short_ufixed();
        }
        if (has_fill)
        {
-               // TODO: Throwing this away is not the right thing.
-               // What is?
-               // A fill style is here.
-               // Answer (Udo): Should be passed to renderer somehow.
+        // read fill styles for strokes.
+        // TODO: don't throw away this information, should be passed to 
renderer.
                fill_style f, g;
                f.read(in, tag_type, md, &g);
                m_color = f.get_color();
@@ -106,33 +101,31 @@
                return;
        }
 
-       // TODO: Unfinished. Temporary to allow define shape 4 to work in many
+       // TODO: Unfinished. Temporary to allow DefineShape4 to work in many
        // cases, but does not work correctly in all cases.
        in->ensureBytes(2+2);
        m_width = in->read_u16();
 
-       // 0 -- Round caps, 1 -- No caps, 2 -- square caps
-       _startCapStyle = (cap_style_e) in->read_uint(2);
-       // 0 -- Round join, 1 -- Bevel join, 2 -- Miter join
-       _joinStyle = (join_style_e) in->read_uint(2);
-       bool has_fill = in->read_bit();
-       _scaleHorizontally = ! in->read_bit();
-       _scaleVertically = ! in->read_bit();
-       _pixelHinting = in->read_bit();
-       static_cast<void> (in->read_uint(5));
-       _noClose = in->read_bit();
-       _startCapStyle = (cap_style_e) in->read_uint(2); // As caps above.
+    int flags1 = in->read_u8();
+    int flags2 = in->read_u8();
+    _startCapStyle =  (cap_style_e)((flags1 & 0xC0) >> 6);
+    _joinStyle     = (join_style_e)((flags1 & 0x30) >> 4);
+    bool has_fill      =   flags1 & (1 << 3);
+    _scaleHorizontally = !(flags1 & (1 << 2));
+    _scaleVertically   = !(flags1 & (1 << 1));
+    _pixelHinting      =   flags1 & (1 << 0);
+       _noClose = flags2 & (1 << 2);
+       _endCapStyle = (cap_style_e) (flags2 & 0x03); 
 
-       if (_joinStyle == JOIN_MITER)  // style 2
+       if (_joinStyle == JOIN_MITER) 
        {
                in->ensureBytes(2);
                _miterLimitFactor = in->read_short_ufixed();
        }
        if (has_fill)
        {
-               // TODO: Throwing this away is not the right thing.
-               // What is?
-               // A fill style is here.
+        // read fill styles for strokes.
+        // TODO: don't throw away this information, should be passed to 
renderer.
                fill_style f;
                f.read(in, tag_type, md);
                m_color = f.get_color();
@@ -159,7 +152,6 @@
        }
 }
 
-
 // end of namespace
 }
 

Index: testsuite/actionscript.all/Color.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Color.as,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- testsuite/actionscript.all/Color.as 21 May 2008 07:56:45 -0000      1.19
+++ testsuite/actionscript.all/Color.as 23 May 2008 02:30:21 -0000      1.20
@@ -22,7 +22,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: Color.as,v 1.19 2008/05/21 07:56:45 zoulunkai Exp $";
+rcsid="$Id: Color.as,v 1.20 2008/05/23 02:30:21 zoulunkai Exp $";
 #include "check.as"
 
 //--------------------------------
@@ -274,7 +274,7 @@
 // 59.765625: value retrieved from AS
 // int(60 / 100.0 * 256): value stored in cxform. 
 // 59.765625 == int(60 / 100.0 * 256) / 2.56
-xcheck(trans2.aa - 59.765625 < 0.0000001);
+check(trans2.aa - 59.765625 < 0.0000001);
 check_equals(trans.ab, 10);
 #endif
 




reply via email to

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