Prepare source code for amalgamation (3/6).

* src/smooth/ftgrays.c: s/TWorker/black_TWorker/,
s/PWorker/black_PWorker/.
* src/raster/ftraster.c: s/TWorker/gray_TWorker/,
s/PWorker/gray_PWorker/
This commit is contained in:
Vinnie Falco 2012-02-21 09:21:19 +01:00 committed by Werner Lemberg
parent 5ccebc4e1e
commit d55f16df11
3 changed files with 48 additions and 38 deletions

View File

@ -1,3 +1,12 @@
2012-02-20  Vinnie Falco <vinnie.falco@gmail.com>
Prepare source code for amalgamation (3/6).
* src/smooth/ftgrays.c: s/TWorker/black_TWorker/,
s/PWorker/black_PWorker/.
* src/raster/ftraster.c: s/TWorker/gray_TWorker/,
s/PWorker/gray_PWorker/
2012-02-20  Vinnie Falco <vinnie.falco@gmail.com> 2012-02-20  Vinnie Falco <vinnie.falco@gmail.com>
Prepare source code for amalgamation (2/6). Prepare source code for amalgamation (2/6).

View File

@ -396,8 +396,8 @@
#else /* !FT_STATIC_RASTER */ #else /* !FT_STATIC_RASTER */
#define RAS_ARGS PWorker worker, #define RAS_ARGS black_PWorker worker,
#define RAS_ARG PWorker worker #define RAS_ARG black_PWorker worker
#define RAS_VARS worker, #define RAS_VARS worker,
#define RAS_VAR worker #define RAS_VAR worker
@ -408,7 +408,7 @@
#endif /* !FT_STATIC_RASTER */ #endif /* !FT_STATIC_RASTER */
typedef struct TWorker_ TWorker, *PWorker; typedef struct black_TWorker_ black_TWorker, *black_PWorker;
/* prototypes used for sweep function dispatch */ /* prototypes used for sweep function dispatch */
@ -446,7 +446,7 @@
/* Thus, their offset can be coded with less opcodes, resulting in a */ /* Thus, their offset can be coded with less opcodes, resulting in a */
/* smaller executable. */ /* smaller executable. */
struct TWorker_ struct black_TWorker_
{ {
Int precision_bits; /* precision related variables */ Int precision_bits; /* precision related variables */
Int precision; Int precision;
@ -546,18 +546,18 @@
typedef struct TRaster_ typedef struct TRaster_
{ {
char* buffer; char* buffer;
long buffer_size; long buffer_size;
void* memory; void* memory;
PWorker worker; black_PWorker worker;
Byte grays[5]; Byte grays[5];
Short gray_width; Short gray_width;
} TRaster, *PRaster; } TRaster, *PRaster;
#ifdef FT_STATIC_RASTER #ifdef FT_STATIC_RASTER
static TWorker cur_ras; static black_TWorker cur_ras;
#define ras cur_ras #define ras cur_ras
#else /* !FT_STATIC_RASTER */ #else /* !FT_STATIC_RASTER */
@ -3485,9 +3485,9 @@
{ {
if ( raster ) if ( raster )
{ {
if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 ) if ( pool_base && pool_size >= (long)sizeof ( black_TWorker ) + 2048 )
{ {
PWorker worker = (PWorker)pool_base; black_PWorker worker = (black_PWorker)pool_base;
raster->buffer = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 ); raster->buffer = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 );
@ -3537,7 +3537,7 @@
{ {
const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Outline* outline = (const FT_Outline*)params->source;
const FT_Bitmap* target_map = params->target; const FT_Bitmap* target_map = params->target;
PWorker worker; black_PWorker worker;
if ( !raster || !raster->buffer || !raster->buffer_size ) if ( !raster || !raster->buffer || !raster->buffer_size )

View File

@ -234,8 +234,8 @@ typedef ptrdiff_t FT_PtrDist;
#ifndef FT_STATIC_RASTER #ifndef FT_STATIC_RASTER
#define RAS_ARG PWorker worker #define RAS_ARG gray_PWorker worker
#define RAS_ARG_ PWorker worker, #define RAS_ARG_ gray_PWorker worker,
#define RAS_VAR worker #define RAS_VAR worker
#define RAS_VAR_ worker, #define RAS_VAR_ worker,
@ -315,15 +315,15 @@ typedef ptrdiff_t FT_PtrDist;
typedef struct TCell_ typedef struct TCell_
{ {
TPos x; /* same with TWorker.ex */ TPos x; /* same with gray_TWorker.ex */
TCoord cover; /* same with TWorker.cover */ TCoord cover; /* same with gray_TWorker.cover */
TArea area; TArea area;
PCell next; PCell next;
} TCell; } TCell;
typedef struct TWorker_ typedef struct gray_TWorker_
{ {
TCoord ex, ey; TCoord ex, ey;
TPos min_ex, max_ex; TPos min_ex, max_ex;
@ -334,7 +334,7 @@ typedef ptrdiff_t FT_PtrDist;
TCoord cover; TCoord cover;
int invalid; int invalid;
PCell cells; PCell cells;
FT_PtrDist max_cells; FT_PtrDist max_cells;
FT_PtrDist num_cells; FT_PtrDist num_cells;
@ -368,23 +368,23 @@ typedef ptrdiff_t FT_PtrDist;
PCell* ycells; PCell* ycells;
TPos ycount; TPos ycount;
} TWorker, *PWorker; } gray_TWorker, *gray_PWorker;
#ifndef FT_STATIC_RASTER #ifndef FT_STATIC_RASTER
#define ras (*worker) #define ras (*worker)
#else #else
static TWorker ras; static gray_TWorker ras;
#endif #endif
typedef struct TRaster_ typedef struct TRaster_
{ {
void* buffer; void* buffer;
long buffer_size; long buffer_size;
int band_size; int band_size;
void* memory; void* memory;
PWorker worker; gray_PWorker worker;
} TRaster, *PRaster; } TRaster, *PRaster;
@ -1115,7 +1115,7 @@ typedef ptrdiff_t FT_PtrDist;
static int static int
gray_move_to( const FT_Vector* to, gray_move_to( const FT_Vector* to,
PWorker worker ) gray_PWorker worker )
{ {
TPos x, y; TPos x, y;
@ -1137,7 +1137,7 @@ typedef ptrdiff_t FT_PtrDist;
static int static int
gray_line_to( const FT_Vector* to, gray_line_to( const FT_Vector* to,
PWorker worker ) gray_PWorker worker )
{ {
gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) ); gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
return 0; return 0;
@ -1147,7 +1147,7 @@ typedef ptrdiff_t FT_PtrDist;
static int static int
gray_conic_to( const FT_Vector* control, gray_conic_to( const FT_Vector* control,
const FT_Vector* to, const FT_Vector* to,
PWorker worker ) gray_PWorker worker )
{ {
gray_render_conic( RAS_VAR_ control, to ); gray_render_conic( RAS_VAR_ control, to );
return 0; return 0;
@ -1158,7 +1158,7 @@ typedef ptrdiff_t FT_PtrDist;
gray_cubic_to( const FT_Vector* control1, gray_cubic_to( const FT_Vector* control1,
const FT_Vector* control2, const FT_Vector* control2,
const FT_Vector* to, const FT_Vector* to,
PWorker worker ) gray_PWorker worker )
{ {
gray_render_cubic( RAS_VAR_ control1, control2, to ); gray_render_cubic( RAS_VAR_ control1, control2, to );
return 0; return 0;
@ -1169,7 +1169,7 @@ typedef ptrdiff_t FT_PtrDist;
gray_render_span( int y, gray_render_span( int y,
int count, int count,
const FT_Span* spans, const FT_Span* spans,
PWorker worker ) gray_PWorker worker )
{ {
unsigned char* p; unsigned char* p;
FT_Bitmap* map = &worker->target; FT_Bitmap* map = &worker->target;
@ -1862,7 +1862,7 @@ typedef ptrdiff_t FT_PtrDist;
{ {
const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Outline* outline = (const FT_Outline*)params->source;
const FT_Bitmap* target_map = params->target; const FT_Bitmap* target_map = params->target;
PWorker worker; gray_PWorker worker;
if ( !raster || !raster->buffer || !raster->buffer_size ) if ( !raster || !raster->buffer || !raster->buffer_size )
@ -2016,14 +2016,15 @@ typedef ptrdiff_t FT_PtrDist;
if ( raster ) if ( raster )
{ {
if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 ) if ( pool_base && pool_size >= (long)sizeof ( gray_TWorker ) + 2048 )
{ {
PWorker worker = (PWorker)pool_base; gray_PWorker worker = (gray_PWorker)pool_base;
rast->worker = worker; rast->worker = worker;
rast->buffer = pool_base + rast->buffer = pool_base +
( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) & ( ( sizeof ( gray_TWorker ) +
sizeof ( TCell ) - 1 ) &
~( sizeof ( TCell ) - 1 ) ); ~( sizeof ( TCell ) - 1 ) );
rast->buffer_size = (long)( ( pool_base + pool_size ) - rast->buffer_size = (long)( ( pool_base + pool_size ) -
(char*)rast->buffer ) & (char*)rast->buffer ) &