Index: src/Makefile.am =================================================================== RCS file: /cvs/cairo/cairo/src/Makefile.am,v retrieving revision 1.54 diff -p -u -r1.54 Makefile.am --- src/Makefile.am 21 Jul 2005 13:52:13 -0000 1.54 +++ src/Makefile.am 27 Jul 2005 01:42:23 -0000 @@ -86,7 +86,6 @@ libcairo_la_SOURCES = \ cairo-array.c \ cairo-cache.c \ cairo-color.c \ - cairo-fixed.c \ cairo-font.c \ cairo-font-options.c \ cairo-gstate.c \ Index: src/cairo-fixed.c =================================================================== RCS file: src/cairo-fixed.c diff -N src/cairo-fixed.c --- src/cairo-fixed.c 22 Feb 2005 19:35:03 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,91 +0,0 @@ -/* cairo - a vector graphics library with display and print output - * - * Copyright © 2003 University of Southern California - * - * This library is free software; you can redistribute it and/or - * modify it either under the terms of the GNU Lesser General Public - * License version 2.1 as published by the Free Software Foundation - * (the "LGPL") or, at your option, under the terms of the Mozilla - * Public License Version 1.1 (the "MPL"). If you do not alter this - * notice, a recipient may use your version of this file under either - * the MPL or the LGPL. - * - * You should have received a copy of the LGPL along with this library - * in the file COPYING-LGPL-2.1; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * You should have received a copy of the MPL along with this library - * in the file COPYING-MPL-1.1 - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY - * OF ANY KIND, either express or implied. See the LGPL or the MPL for - * the specific language governing rights and limitations. - * - * The Original Code is the cairo graphics library. - * - * The Initial Developer of the Original Code is University of Southern - * California. - * - * Contributor(s): - * Carl D. Worth - */ - -#include "cairoint.h" - -cairo_fixed_t -_cairo_fixed_from_int (int i) -{ - return i << 16; -} - -cairo_fixed_t -_cairo_fixed_from_double (double d) -{ - return (cairo_fixed_t) (d * 65536); -} - -cairo_fixed_t -_cairo_fixed_from_26_6 (uint32_t i) -{ - return i << 10; -} - -double -_cairo_fixed_to_double (cairo_fixed_t f) -{ - return ((double) f) / 65536.0; -} - -int -_cairo_fixed_is_integer (cairo_fixed_t f) -{ - return (f & 0xFFFF) == 0; -} - -int -_cairo_fixed_integer_part (cairo_fixed_t f) -{ - return f >> 16; -} - -int -_cairo_fixed_integer_floor (cairo_fixed_t f) -{ - if (f >= 0) - return f >> 16; - else - return -((-f - 1) >> 16) - 1; -} - -int -_cairo_fixed_integer_ceil (cairo_fixed_t f) -{ - if (f >= 0) - return ((f - 1)>>16) + 1; - else - return - (-f >> 16); -} Index: src/cairoint.h =================================================================== RCS file: /cvs/cairo/cairo/src/cairoint.h,v retrieving revision 1.169 diff -p -u -r1.169 cairoint.h --- src/cairoint.h 25 Jul 2005 23:23:05 -0000 1.169 +++ src/cairoint.h 27 Jul 2005 01:42:24 -0000 @@ -183,6 +183,16 @@ typedef cairo_int128_t cairo_fixed_96_32 /* The common 16.16 format gets a shorter name */ typedef cairo_fixed_16_16_t cairo_fixed_t; +/* Standard operations on 16.16 format values */ +#define _cairo_fixed_from_int(i) ((i) << 16) +#define _cairo_fixed_from_double(d) (cairo_fixed_t) ((d) * 65536) +#define _cairo_fixed_from_26_6(i) ((i) << 10) +#define _cairo_fixed_to_double(f) (((double) (f)) / 65536.0) +#define _cairo_fixed_is_integer(f) (((f) & 0xFFFF) == 0) +#define _cairo_fixed_integer_part(f) ((f) >> 16) +#define _cairo_fixed_integer_floor(f) (((f) >= 0) ? ((f) >> 16) : (-((-(f) - 1) >> 16) - 1)) +#define _cairo_fixed_integer_ceil(f) ((f >= 0) ? ((((f) - 1)>>16) + 1) : (-(-(f) >> 16))) + #define CAIRO_MAXSHORT SHRT_MAX #define CAIRO_MINSHORT SHRT_MIN @@ -994,31 +1004,6 @@ typedef struct _cairo_stroke_face { cairo_private void _cairo_restrict_value (double *value, double min, double max); -/* cairo_fixed.c */ -cairo_private cairo_fixed_t -_cairo_fixed_from_int (int i); - -cairo_private cairo_fixed_t -_cairo_fixed_from_double (double d); - -cairo_private cairo_fixed_t -_cairo_fixed_from_26_6 (uint32_t i); - -cairo_private double -_cairo_fixed_to_double (cairo_fixed_t f); - -cairo_private int -_cairo_fixed_is_integer (cairo_fixed_t f); - -cairo_private int -_cairo_fixed_integer_part (cairo_fixed_t f); - -cairo_private int -_cairo_fixed_integer_floor (cairo_fixed_t f); - -cairo_private int -_cairo_fixed_integer_ceil (cairo_fixed_t f); - /* cairo_gstate.c */ cairo_private cairo_gstate_t * _cairo_gstate_create (cairo_surface_t *target);