[raster] Slightly improve the pool design.
* src/raster/ftraster.c (TProfile): Include the variable array member and repackage with pointers first. (New_Profile): Advance the top using the variable array pointer.
This commit is contained in:
parent
d1e894b1f1
commit
a0e10a87f5
|
@ -305,16 +305,6 @@
|
||||||
typedef unsigned char Byte, *PByte;
|
typedef unsigned char Byte, *PByte;
|
||||||
typedef char Bool;
|
typedef char Bool;
|
||||||
|
|
||||||
|
|
||||||
typedef union Alignment_
|
|
||||||
{
|
|
||||||
Long l;
|
|
||||||
void* p;
|
|
||||||
void (*f)(void);
|
|
||||||
|
|
||||||
} Alignment, *PAlignment;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct TPoint_
|
typedef struct TPoint_
|
||||||
{
|
{
|
||||||
Long x;
|
Long x;
|
||||||
|
@ -345,31 +335,28 @@
|
||||||
|
|
||||||
struct TProfile_
|
struct TProfile_
|
||||||
{
|
{
|
||||||
FT_F26Dot6 X; /* current coordinate during sweep */
|
|
||||||
PProfile link; /* link to next profile (various purposes) */
|
PProfile link; /* link to next profile (various purposes) */
|
||||||
|
PProfile next; /* next profile in same contour, used */
|
||||||
|
/* during drop-out control */
|
||||||
PLong offset; /* start of profile's data in render pool */
|
PLong offset; /* start of profile's data in render pool */
|
||||||
|
Long height; /* profile's height in scanlines */
|
||||||
|
Long start; /* profile's starting scanline */
|
||||||
UShort flags; /* Bit 0-2: drop-out mode */
|
UShort flags; /* Bit 0-2: drop-out mode */
|
||||||
/* Bit 3: profile orientation (up/down) */
|
/* Bit 3: profile orientation (up/down) */
|
||||||
/* Bit 4: is top profile? */
|
/* Bit 4: is top profile? */
|
||||||
/* Bit 5: is bottom profile? */
|
/* Bit 5: is bottom profile? */
|
||||||
Long height; /* profile's height in scanlines */
|
|
||||||
Long start; /* profile's starting scanline */
|
|
||||||
|
|
||||||
Int countL; /* number of lines to step before this */
|
Int countL; /* number of lines to step before this */
|
||||||
/* profile becomes drawable */
|
/* profile becomes drawable */
|
||||||
|
FT_F26Dot6 X; /* current coordinate during sweep */
|
||||||
PProfile next; /* next profile in same contour, used */
|
Long x[1]; /* actually variable array of scanline */
|
||||||
/* during drop-out control */
|
/* intersections with `height` elements */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef PProfile TProfileList;
|
typedef PProfile TProfileList;
|
||||||
typedef PProfile* PProfileList;
|
typedef PProfile* PProfileList;
|
||||||
|
|
||||||
|
|
||||||
#define AlignProfileSize \
|
|
||||||
( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( Long ) )
|
|
||||||
|
|
||||||
|
|
||||||
#undef RAS_ARG
|
#undef RAS_ARG
|
||||||
#undef RAS_ARGS
|
#undef RAS_ARGS
|
||||||
#undef RAS_VAR
|
#undef RAS_VAR
|
||||||
|
@ -670,7 +657,7 @@
|
||||||
if ( !ras.cProfile || ras.cProfile->height )
|
if ( !ras.cProfile || ras.cProfile->height )
|
||||||
{
|
{
|
||||||
ras.cProfile = (PProfile)ras.top;
|
ras.cProfile = (PProfile)ras.top;
|
||||||
ras.top += AlignProfileSize;
|
ras.top = ras.cProfile->x;
|
||||||
|
|
||||||
if ( ras.top >= ras.maxBuff )
|
if ( ras.top >= ras.maxBuff )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue