gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] gnash ChangeLog server/parser/shape_character_d...


From: zou lunkai
Subject: Re: [Gnash-commit] gnash ChangeLog server/parser/shape_character_d...
Date: Tue, 28 Aug 2007 08:59:05 +0800

> -               float   cx = x + in->read_sint(num_bits);
> -               float   cy = y + in->read_sint(num_bits);
> -               float   ax = cx + in->read_sint(num_bits);
> -               float   ay = cy + in->read_sint(num_bits);
> +               int     cx = x + in->read_sint(num_bits);
> +               int     cy = y + in->read_sint(num_bits);
> +               int     ax = cx + in->read_sint(num_bits);
> +               int     ay = cy + in->read_sint(num_bits);
...

Good to see these changes.  It really meaningless to convert to float
numbers at parse time.  And AGG seldom uses float numbers(double and
integral numbers are choosed internally, IIRC).


On 8/28/07, Sandro Santilli <address@hidden> wrote:
> CVSROOT:        /sources/gnash
> Module name:    gnash
> Changes by:     Sandro Santilli <strk>  07/08/27 18:39:20
>
> Modified files:
>        .              : ChangeLog
>        server/parser  : shape_character_def.cpp
>
> Log message:
>                * server/parser/shape_character_def.cpp (read): use ints for 
> twips
>                  values, convert to float only when needed (construction of 
> the
>                  edges and paths). [last patch was bogus]
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4125&r2=1.4126
> http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.36&r2=1.37
>
> Patches:
> Index: ChangeLog
> ===================================================================
> RCS file: /sources/gnash/gnash/ChangeLog,v
> retrieving revision 1.4125
> retrieving revision 1.4126
> diff -u -b -r1.4125 -r1.4126
> --- ChangeLog   27 Aug 2007 18:14:44 -0000      1.4125
> +++ ChangeLog   27 Aug 2007 18:39:19 -0000      1.4126
> @@ -1,3 +1,9 @@
> +2007-08-28 Sandro Santilli <address@hidden>
> +
> +       * server/parser/shape_character_def.cpp (read): use ints for twips
> +         values, convert to float only when needed (construction of the
> +         edges and paths). [last patch was bogus]
> +
>  2007-08-28 Chad Musick <address@hidden>
>
>        * server/asobj/BlurFilter_as.cpp,.h
>
> Index: server/parser/shape_character_def.cpp
> ===================================================================
> RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
> retrieving revision 1.36
> retrieving revision 1.37
> diff -u -b -r1.36 -r1.37
> --- server/parser/shape_character_def.cpp       27 Aug 2007 17:28:02 -0000    
>   1.36
> +++ server/parser/shape_character_def.cpp       27 Aug 2007 18:39:19 -0000    
>   1.37
> @@ -17,7 +17,7 @@
>  // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>  //
>
> -/* $Id: shape_character_def.cpp,v 1.36 2007/08/27 17:28:02 strk Exp $ */
> +/* $Id: shape_character_def.cpp,v 1.37 2007/08/27 18:39:19 strk Exp $ */
>
>  // Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden> 
> 2003
>
> @@ -219,7 +219,7 @@
>     // is simple but not optimally efficient.
>     int        fill_base = 0;
>     int        line_base = 0;
> -    float      x = 0, y = 0;
> +    int                x = 0, y = 0;
>     path       current_path;
>
>  #define SHAPE_LOG 0
> @@ -255,8 +255,8 @@
>                int     move_x = in->read_sint(num_move_bits);
>                int     move_y = in->read_sint(num_move_bits);
>
> -               x = (float) move_x;
> -               y = (float) move_y;
> +               x = move_x;
> +               y = move_y;
>
>                // Set the beginning of the path.
>                current_path.m_ax = x;
> @@ -434,10 +434,10 @@
>            if (edge_flag == 0) {
>                // curved edge
>                int num_bits = 2 + in->read_uint(4);
> -               float   cx = x + in->read_sint(num_bits);
> -               float   cy = y + in->read_sint(num_bits);
> -               float   ax = cx + in->read_sint(num_bits);
> -               float   ay = cy + in->read_sint(num_bits);
> +               int     cx = x + in->read_sint(num_bits);
> +               int     cy = y + in->read_sint(num_bits);
> +               int     ax = cx + in->read_sint(num_bits);
> +               int     ay = cy + in->read_sint(num_bits);
>
>  #if SHAPE_LOG
>                IF_VERBOSE_PARSE (
> @@ -452,20 +452,20 @@
>            } else {
>                // straight edge
>                int     num_bits = 2 + in->read_uint(4);
> -               int     line_flag = in->read_uint(1);
> -               float   dx = 0, dy = 0;
> +               bool    line_flag = in->read_bit();
> +               int     dx = 0, dy = 0;
>                if (line_flag) {
>                    // General line.
> -                   dx = (float) in->read_sint(num_bits);
> -                   dy = (float) in->read_sint(num_bits);
> +                   dx = in->read_sint(num_bits);
> +                   dy = in->read_sint(num_bits);
>                } else {
> -                   int vert_flag = in->read_uint(1);
> +                   bool vert_flag = in->read_bit();
>                    if (vert_flag == 0) {
>                        // Horizontal line.
> -                       dx = (float) in->read_sint(num_bits);
> +                       dx = in->read_sint(num_bits);
>                    } else {
>                        // Vertical line.
> -                       dy = (float) in->read_sint(num_bits);
> +                       dy = in->read_sint(num_bits);
>                    }
>                }
>
>
>
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit
>




reply via email to

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