[poppler] poppler/splash: Makefile.am, 1.1.1.1, 1.2 SplashFTFont.cc, 1.2, 1.3 SplashMath.h, 1.1.1.1, 1.2 SplashTypes.h, 1.1.1.1, 1.2

Marco Pesenti Gritti marco at freedesktop.org
Fri Sep 16 11:21:40 PDT 2005


Update of /cvs/poppler/poppler/splash
In directory gabe:/tmp/cvs-serv3392/splash

Modified Files:
	Makefile.am SplashFTFont.cc SplashMath.h SplashTypes.h 
Log Message:
2005-09-16  Marco Pesenti Gritti  <mpg at redhat.com>

        * configure.ac:
        * goo/Makefile.am:
        * splash/Makefile.am:
        * splash/SplashFTFont.cc:
        * splash/SplashMath.h:
        * splash/SplashTypes.h:

        Merge support for fixed point



Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/splash/Makefile.am,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Makefile.am	3 Mar 2005 19:45:59 -0000	1.1.1.1
+++ Makefile.am	16 Sep 2005 18:21:38 -0000	1.2
@@ -1,5 +1,6 @@
 INCLUDES =					\
 	-I$(top_srcdir)				\
+	-I$(top_srcdir)/goo			\
 	$(FREETYPE_CFLAGS)
 
 noinst_LTLIBRARIES = libsplash.la

Index: SplashFTFont.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashFTFont.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SplashFTFont.cc	2 May 2005 00:44:26 -0000	1.2
+++ SplashFTFont.cc	16 Sep 2005 18:21:38 -0000	1.3
@@ -116,10 +116,17 @@
   }
 
   // compute the transform matrix
+#if USE_FIXEDPOINT
+  matrix.xx = (FT_Fixed)((mat[0] / size).getRaw());
+  matrix.yx = (FT_Fixed)((mat[1] / size).getRaw());
+  matrix.xy = (FT_Fixed)((mat[2] / size).getRaw());
+  matrix.yy = (FT_Fixed)((mat[3] / size).getRaw());
+#else
   matrix.xx = (FT_Fixed)((mat[0] / size) * 65536);
   matrix.yx = (FT_Fixed)((mat[1] / size) * 65536);
   matrix.xy = (FT_Fixed)((mat[2] / size) * 65536);
   matrix.yy = (FT_Fixed)((mat[3] / size) * 65536);
+#endif
 }
 
 SplashFTFont::~SplashFTFont() {

Index: SplashMath.h
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashMath.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SplashMath.h	3 Mar 2005 19:45:59 -0000	1.1.1.1
+++ SplashMath.h	16 Sep 2005 18:21:38 -0000	1.2
@@ -7,31 +7,59 @@
 #ifndef SPLASHMATH_H
 #define SPLASHMATH_H
 
+#if USE_FIXEDPONT
+#include "FixedPoint.h"
+#else
 #include <math.h>
+#endif
 #include "SplashTypes.h"
 
 static inline SplashCoord splashAbs(SplashCoord x) {
+#if USE_FIXEDPOINT
+  return FixedPoint::abs(x);
+#else
   return fabs(x);
+#endif
 }
 
 static inline int splashFloor(SplashCoord x) {
-  return (int)floor(x);
+  #if USE_FIXEDPOINT
+    return FixedPoint::floor(x);
+  #else
+    return (int)floor(x);
+  #endif
 }
 
 static inline int splashCeil(SplashCoord x) {
+#if USE_FIXEDPOINT
+  return FixedPoint::ceil(x);
+#else
   return (int)ceil(x);
+#endif
 }
 
 static inline int splashRound(SplashCoord x) {
+#if USE_FIXEDPOINT
+  return FixedPoint::round(x);
+#else
   return (int)floor(x + 0.5);
+#endif
 }
 
 static inline SplashCoord splashSqrt(SplashCoord x) {
+#if USE_FIXEDPOINT
+  return FixedPoint::sqrt(x);
+#else
   return sqrt(x);
+#endif
 }
 
 static inline SplashCoord splashPow(SplashCoord x, SplashCoord y) {
+#if USE_FIXEDPOINT
+  return FixedPoint::pow(x, y);
+#else
   return pow(x, y);
+#endif
 }
 
 static inline SplashCoord splashDist(SplashCoord x0, SplashCoord y0,
@@ -39,7 +67,11 @@
   SplashCoord dx, dy;
   dx = x1 - x0;
   dy = y1 - y0;
+#if USE_FIXEDPOINT
+  return FixedPoint::sqrt(dx * dx + dy * dy);
+#else
   return sqrt(dx * dx + dy * dy);
+#endif
 }
 
 #endif

Index: SplashTypes.h
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashTypes.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SplashTypes.h	3 Mar 2005 19:45:59 -0000	1.1.1.1
+++ SplashTypes.h	16 Sep 2005 18:21:38 -0000	1.2
@@ -13,7 +13,12 @@
 // coordinates
 //------------------------------------------------------------------------
 
+#if USE_FIXEDPOINT
+#include "FixedPoint.h"
+typedef FixedPoint SplashCoord;
+#else
 typedef double SplashCoord;
+#endif
 
 //------------------------------------------------------------------------
 // colors



More information about the poppler mailing list