Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again. Problems reported by suyu@cooee.cn. * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS, FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define. [!_STANDALONE_]: Include ftspic.h only here. (ras): Define/declare after definition of `TWorker'. Use `RAS_VAR_' where necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
diff --git a/ChangeLog b/ChangeLog
index 5f1a00f..b13701c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-04-26 Werner Lemberg <wl@gnu.org>
+
+ Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again.
+ Problems reported by suyu@cooee.cn.
+
+ * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS,
+ FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define.
+ [!_STANDALONE_]: Include ftspic.h only here.
+ (ras): Define/declare after definition of `TWorker'.
+ Use `RAS_VAR_' where necessary.
+
2009-04-21 Karl Berry <karl@gnu.org>
Fix AC_CHECK_FT2.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index e779449..1fc1166 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008 by */
+/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -170,6 +170,34 @@
#endif /* !FT_DEBUG_LEVEL_TRACE */
+#define FT_DEFINE_OUTLINE_FUNCS( class_, \
+ move_to_, line_to_, \
+ conic_to_, cubic_to_, \
+ shift_, delta_ ) \
+ static const FT_Outline_Funcs class_ = \
+ { \
+ move_to_, \
+ line_to_, \
+ conic_to_, \
+ cubic_to_, \
+ shift_, \
+ delta_ \
+ };
+
+#define FT_DEFINE_RASTER_FUNCS( class_, glyph_format_, \
+ raster_new_, raster_reset_, \
+ raster_set_mode_, raster_render_, \
+ raster_done_ ) \
+ const FT_Raster_Funcs class_ = \
+ { \
+ glyph_format_, \
+ raster_new_, \
+ raster_reset_, \
+ raster_set_mode_, \
+ raster_render_, \
+ raster_done_ \
+ };
+
#else /* !_STANDALONE_ */
@@ -181,6 +209,8 @@
#include "ftsmerrs.h"
+#include "ftspic.h"
+
#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline
#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory
@@ -188,8 +218,6 @@
#endif /* !_STANDALONE_ */
-#include "ftspic.h"
-
#ifndef FT_MEM_SET
#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c )
#endif
@@ -202,27 +230,19 @@
#ifndef FT_STATIC_RASTER
-
#define RAS_ARG PWorker worker
#define RAS_ARG_ PWorker worker,
#define RAS_VAR worker
#define RAS_VAR_ worker,
-#define ras (*worker)
-
-
#else /* FT_STATIC_RASTER */
-
#define RAS_ARG /* empty */
#define RAS_ARG_ /* empty */
#define RAS_VAR /* empty */
#define RAS_VAR_ /* empty */
- static TWorker ras;
-
-
#endif /* FT_STATIC_RASTER */
@@ -344,6 +364,13 @@
} TWorker, *PWorker;
+#ifndef FT_STATIC_RASTER
+#define ras (*worker)
+#else
+ static TWorker ras;
+#endif
+
+
typedef struct TRaster_
{
void* buffer;
@@ -727,7 +754,7 @@
ras.cover += delta;
ey1 += incr;
- gray_set_cell( &ras, ex, ey1 );
+ gray_set_cell( RAS_VAR_ ex, ey1 );
delta = (int)( first + first - ONE_PIXEL );
area = (TArea)two_fx * delta;
@@ -737,7 +764,7 @@
ras.cover += delta;
ey1 += incr;
- gray_set_cell( &ras, ex, ey1 );
+ gray_set_cell( RAS_VAR_ ex, ey1 );
}
delta = (int)( fy2 - ONE_PIXEL + first );
@@ -1111,7 +1138,7 @@
x = UPSCALE( to->x );
y = UPSCALE( to->y );
- gray_start_cell( worker, TRUNC( x ), TRUNC( y ) );
+ gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );
worker->x = x;
worker->y = y;
@@ -1123,7 +1150,7 @@
gray_line_to( const FT_Vector* to,
PWorker worker )
{
- gray_render_line( worker, UPSCALE( to->x ), UPSCALE( to->y ) );
+ gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
return 0;
}
@@ -1133,7 +1160,7 @@
const FT_Vector* to,
PWorker worker )
{
- gray_render_conic( worker, control, to );
+ gray_render_conic( RAS_VAR_ control, to );
return 0;
}
@@ -1144,7 +1171,7 @@
const FT_Vector* to,
PWorker worker )
{
- gray_render_cubic( worker, control1, control2, to );
+ gray_render_cubic( RAS_VAR_ control1, control2, to );
return 0;
}
@@ -1920,7 +1947,7 @@
ras.clip_box.yMax = 32767L;
}
- gray_init_cells( worker, raster->buffer, raster->buffer_size );
+ gray_init_cells( RAS_VAR_ raster->buffer, raster->buffer_size );
ras.outline = *outline;
ras.num_cells = 0;