93#define QT_FT_COMPONENT trace_smooth
97#define QT_FT_ERR_XCAT( x, y ) x ## y
98#define QT_FT_ERR_CAT( x, y ) QT_FT_ERR_XCAT( x, y )
100#define QT_FT_BEGIN_STMNT do {
101#define QT_FT_END_STMNT } while ( 0 )
103#define QT_FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
104#define QT_FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
112#define QT_FT_HYPOT( x, y ) \
113 ( x = QT_FT_ABS( x ), \
114 y = QT_FT_ABS( y ), \
115 x > y ? x + ( 3 * y >> 3 ) \
116 : y + ( 3 * x >> 3 ) )
118#define ErrRaster_MemoryOverflow -4
121# include <vxWorksCommon.h>
127#define QT_FT_UINT_MAX UINT_MAX
129#define qt_ft_memset memset
131#define qt_ft_setjmp setjmp
132#define qt_ft_longjmp longjmp
133#define qt_ft_jmp_buf jmp_buf
138#define ErrRaster_Invalid_Mode -2
139#define ErrRaster_Invalid_Outline -1
140#define ErrRaster_Invalid_Argument -3
141#define ErrRaster_Memory_Overflow -4
142#define ErrRaster_OutOfMemory -6
144#define QT_FT_BEGIN_HEADER
145#define QT_FT_END_HEADER
147#include <private/qrasterdefs_p.h>
148#include <private/qgrayraster_p.h>
156#define QT_FT_UNUSED( x ) (void) x
158#define QT_FT_TRACE5( x ) do { } while ( 0 )
159#define QT_FT_TRACE7( x ) do { } while ( 0 )
160#define QT_FT_ERROR( x ) do { } while ( 0 )
161#define QT_FT_THROW( e ) QT_FT_ERR_CAT( ErrRaster_, e )
164#define QT_FT_MEM_SET( d, s, c ) qt_ft_memset( d, s, c )
167#ifndef QT_FT_MEM_ZERO
168#define QT_FT_MEM_ZERO( dest, count ) QT_FT_MEM_SET( dest, 0, count )
172#define RAS_ARG PWorker worker
173#define RAS_ARG_ PWorker worker,
175#define RAS_VAR worker
176#define RAS_VAR_ worker,
183#define ONE_PIXEL ( 1L << PIXEL_BITS )
184#define TRUNC( x ) (TCoord)( (x) >> PIXEL_BITS )
185#define FRACT( x ) (TCoord)( (x) & ( ONE_PIXEL - 1 ) )
188#define UPSCALE( x ) ( (x) * ( ONE_PIXEL >> 6 ) )
189#define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) )
191#define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) )
192#define DOWNSCALE( x ) ( (x) * ( 64 >> PIXEL_BITS ) )
198#define QT_FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
200 (quotient) = (type)( (dividend) / (divisor) ); \
201 (remainder) = (type)( (dividend) % (divisor) ); \
202 if ( (remainder) < 0 ) \
205 (remainder) += (type)(divisor); \
211#define QT_FT_UDIVPREP( b ) \
212 long b ## _r = (long)( ULONG_MAX >> PIXEL_BITS ) / ( b )
213#define QT_FT_UDIV( a, b ) \
214 ( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \
215 ( sizeof( long ) * CHAR_BIT - PIXEL_BITS ) )
232#define QT_FT_MAX_GRAY_SPANS 256
302 if ( raster && raster->
worker )
316 ras.buffer_size = byte_size;
342 ras.min_ex =
ras.max_ex = 0;
343 ras.min_ey =
ras.max_ey = 0;
347 ras.min_ex =
ras.max_ex = vec->
x;
348 ras.min_ey =
ras.max_ey = vec->
y;
352 for ( ; vec <
limit; vec++ )
358 if (
x <
ras.min_ex )
ras.min_ex =
x;
359 if (
x >
ras.max_ex )
ras.max_ex =
x;
360 if (
y <
ras.min_ey )
ras.min_ey =
y;
361 if (
y >
ras.max_ey )
ras.max_ey =
y;
365 ras.min_ex =
ras.min_ex >> 6;
366 ras.min_ey =
ras.min_ey >> 6;
367 ras.max_ex = (
ras.max_ex + 63 ) >> 6;
368 ras.max_ey = (
ras.max_ey + 63 ) >> 6;
383 if (
x >
ras.count_ex )
386 pcell = &
ras.ycells[
ras.ey];
390 if ( cell == NULL || cell->
x >
x )
399 if (
ras.num_cells >=
ras.max_cells )
402 cell =
ras.cells +
ras.num_cells++;
418 if (
ras.area |
ras.cover )
451 if ( ex >
ras.max_ex )
459 if ( ex !=
ras.ex || ey !=
ras.ey )
471 ras.invalid = ( (
unsigned int)ey >= (
unsigned int)
ras.count_ey ||
472 ex >=
ras.count_ex );
484 if ( ex >
ras.max_ex )
487 if ( ex <
ras.min_ex )
585 }
while ( ex1 != ex2 );
592 ras.area += (
TArea)( ( fx1 + fx2 ) * dy );
613 if ( ( ey1 >=
ras.max_ey && ey2 >=
ras.max_ey ) ||
614 ( ey1 <
ras.min_ey && ey2 <
ras.min_ey ) )
653 max_ey1 =
ras.count_ey +
ras.min_ey;
656 ey1 = (max_ey1 > ey2) ? max_ey1 : ey2;
662 while ( ey1 > ey2 && ey1 >=
ras.min_ey)
675 if (ey1 <
ras.min_ey) {
676 ey1 = (
ras.min_ey < ey2) ?
ras.min_ey : ey2;
682 while ( ey1 < ey2 && ey1 < max_ey1)
754 }
while ( ey1 != ey2 );
777 TPos dx, dy, fx1, fy1, fx2, fy2;
778 TCoord ex1, ex2, ey1, ey2;
787 if ( ( ey1 >=
ras.max_ey && ey2 >=
ras.max_ey ) ||
788 ( ey1 <
ras.min_ey && ey2 <
ras.min_ey ) )
797 if ( ex1 == ex2 && ey1 == ey2 )
810 ras.cover += ( fy2 - fy1 );
811 ras.area += ( fy2 - fy1 ) * fx1 * 2;
815 }
while ( ey1 != ey2 );
820 ras.cover += ( fy2 - fy1 );
821 ras.area += ( fy2 - fy1 ) * fx1 * 2;
825 }
while ( ey1 != ey2 );
829 TArea prod = dx * fy1 - dy * fx1;
845 ras.cover += ( fy2 - fy1 );
846 ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
857 ras.cover += ( fy2 - fy1 );
858 ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
869 ras.cover += ( fy2 - fy1 );
870 ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
881 ras.cover += ( fy2 - fy1 );
882 ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
889 }
while ( ex1 != ex2 || ey1 != ey2 );
895 ras.cover += ( fy2 - fy1 );
896 ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 );
915 base[2].x = (
a +
b ) / 2;
921 base[2].y = (
a +
b ) / 2;
943 if ( (
TRUNC( arc[0].
y ) >=
ras.max_ey &&
1002 base[2].x =
a = (
a +
c ) / 2;
1003 base[4].x =
b = (
b +
c ) / 2;
1004 base[3].x = (
a +
b ) / 2;
1012 base[2].y =
a = (
a +
c ) / 2;
1013 base[4].y =
b = (
b +
c ) / 2;
1014 base[3].y = (
a +
b ) / 2;
1025 TPos dx, dy, dx_, dy_;
1026 TPos dx1, dy1, dx2, dy2;
1040 if ( (
TRUNC( arc[0].
y ) >=
ras.max_ey &&
1063 dx = dx_ = arc[3].
x - arc[0].
x;
1064 dy = dy_ = arc[3].
y - arc[0].
y;
1069 if ( L >= (1 << 23) )
1076 dx1 = arc[1].
x - arc[0].
x;
1077 dy1 = arc[1].
y - arc[0].
y;
1084 dx2 = arc[2].
x - arc[0].
x;
1085 dy2 = arc[2].
y - arc[0].
y;
1094 if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 ||
1095 dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 )
1100 if ( arc == bez_stack )
1146 unsigned char coverage = spans->
coverage;
1149 p = (
unsigned char*)
map->buffer - spans->
y *
map->pitch;
1150 if (
map->pitch >= 0 )
1151 p += (
map->rows - 1 ) * (
unsigned int)
map->pitch;
1156 unsigned char*
q =
p + spans->
x;
1163 switch ( spans->
len )
1198 coverage = -coverage;
1204 if ( coverage > 256 )
1205 coverage = 512 - coverage;
1206 else if ( coverage == 256 )
1212 if ( coverage >= 256 )
1220 if (
x >= (1 << 23) )
1224 if (
y >= (1 << 23) )
1240 span->coverage == coverage )
1250 skip =
ras.skip_spans > 0 ?
ras.skip_spans : 0;
1251 ras.render_span(
ras.num_gray_spans - skip,
1252 ras.gray_spans + skip,
1253 ras.render_span_data );
1256 ras.skip_spans -=
ras.num_gray_spans;
1267 fprintf( stderr,
"y=%3d ",
y );
1270 fprintf( stderr,
"[%d..%d]:%02x ",
1272 fprintf( stderr,
"\n" );
1277 ras.num_gray_spans = 0;
1288 span->coverage = (
unsigned char)coverage;
1290 ras.num_gray_spans++;
1303 for ( yindex = 0; yindex <
ras.ycount; yindex++ )
1308 printf(
"%3d:", yindex );
1310 for ( cell =
ras.ycells[yindex]; cell != NULL; cell = cell->
next )
1311 printf(
" (%3d, c:%4d, a:%6d)", cell->
x, cell->
cover, cell->
area );
1327 if (
ras.num_cells == 0 )
1332 for ( yindex = 0; yindex <
ras.ycount; yindex++ )
1339 for ( ; cell != NULL; cell = cell->
next )
1344 if ( cell->
x >
x && cover != 0 )
1348 cover += cell->
cover;
1351 if (
area != 0 && cell->
x >= 0 )
1357 if (
ras.count_ex >
x && cover != 0 )
1399#define SCALED( x ) (x)
1426 goto Invalid_Outline;
1433 v_last = outline->
points[last];
1437 v_control = v_start;
1445 goto Invalid_Outline;
1462 v_start.
x = ( v_start.
x + v_last.
x ) / 2;
1463 v_start.
y = ( v_start.
y + v_last.
y ) / 2;
1472 v_start.
x / 64.0, v_start.
y / 64.0 ));
1477 while ( point <
limit )
1494 vec.
x / 64.0, vec.
y / 64.0 ));
1505 if ( point <
limit )
1521 " with control (%.2f, %.2f)\n",
1522 vec.
x / 64.0, vec.
y / 64.0,
1523 v_control.
x / 64.0, v_control.
y / 64.0 ));
1529 goto Invalid_Outline;
1531 v_middle.
x = ( v_control.
x + vec.
x ) / 2;
1532 v_middle.
y = ( v_control.
y + vec.
y ) / 2;
1535 " with control (%.2f, %.2f)\n",
1536 v_middle.
x / 64.0, v_middle.
y / 64.0,
1537 v_control.
x / 64.0, v_control.
y / 64.0 ));
1545 " with control (%.2f, %.2f)\n",
1546 v_start.
x / 64.0, v_start.
y / 64.0,
1547 v_control.
x / 64.0, v_control.
y / 64.0 ));
1557 if ( point + 1 >
limit ||
1559 goto Invalid_Outline;
1570 if ( point <=
limit )
1579 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
1580 vec.
x / 64.0, vec.
y / 64.0,
1581 vec1.
x / 64.0, vec1.
y / 64.0,
1588 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
1589 v_start.
x / 64.0, v_start.
y / 64.0,
1590 vec1.
x / 64.0, vec1.
y / 64.0,
1600 v_start.
x / 64.0, v_start.
y / 64.0 ));
1627 volatile int error = 0;
1648 TBand*
volatile band;
1649 int volatile n, num_bands;
1650 TPos volatile min, max, max_y;
1654 ras.num_gray_spans = 0;
1660 clip = &
ras.clip_box;
1676 num_bands = (int)( (
ras.max_ey -
ras.min_ey ) /
ras.band_size );
1677 if ( num_bands == 0 )
1679 if ( num_bands >= 39 )
1687 for (
n = 0;
n < num_bands;
n++, min = max )
1689 max = min +
ras.band_size;
1690 if (
n == num_bands - 1 || max > max_y )
1697 while ( band >= bands )
1705 int cell_start, cell_end, cell_mod;
1711 cell_start =
sizeof (
PCell ) *
ras.ycount;
1712 cell_mod = cell_start %
sizeof (
TCell );
1714 cell_start +=
sizeof (
TCell ) - cell_mod;
1716 cell_end =
ras.buffer_size;
1717 cell_end -= cell_end %
sizeof(
TCell );
1719 cells_max = (
PCell)( (
char*)
ras.buffer + cell_end );
1720 ras.cells = (
PCell)( (
char*)
ras.buffer + cell_start );
1721 if (
ras.cells >= cells_max )
1724 ras.max_cells = (int)(cells_max -
ras.cells);
1725 if (
ras.max_cells < 2 )
1728 for ( yindex = 0; yindex <
ras.ycount; yindex++ )
1729 ras.ycells[yindex] = NULL;
1760 fprintf( stderr,
"Rotten glyph!\n" );
1769 band[1].
max = middle;
1770 band[0].
min = middle;
1776 if (
ras.render_span &&
ras.num_gray_spans >
ras.skip_spans )
1778 skip =
ras.skip_spans > 0 ?
ras.skip_spans : 0;
1779 ras.render_span(
ras.num_gray_spans - skip,
1780 ras.gray_spans + skip,
1781 ras.render_span_data );
1784 ras.skip_spans -=
ras.num_gray_spans;
1786 if (
ras.band_shoot > 8 &&
ras.band_size > 16 )
1787 ras.band_size =
ras.band_size / 2;
1840 if ( !target_map->
width || !target_map->
rows )
1843 if ( !target_map->
buffer )
1855 ras.clip_box.xMin = 0;
1856 ras.clip_box.yMin = 0;
1857 ras.clip_box.xMax = target_map->
width;
1858 ras.clip_box.yMax = target_map->
rows;
1866 ras.clip_box.xMin = -(1 << 23);
1867 ras.clip_box.yMin = -(1 << 23);
1868 ras.clip_box.xMax = (1 << 23) - 1;
1869 ras.clip_box.yMax = (1 << 23) - 1;
1874 ras.outline = *outline;
1880 ras.target = *target_map;
1883 ras.render_span_data = &
ras;
1901 *araster = malloc(
sizeof(
TRaster));
1934 rast->
buffer = pool_base +
1936 ~(
sizeof (
TCell ) - 1 ) );
1937 rast->
buffer_size = (long)( ( pool_base + pool_size ) -
1939 ~(
sizeof (
TCell ) - 1 );
1941 ( sizeof (
TCell ) * 8 ) );
1943 else if ( pool_base)
1946 rast->
buffer = pool_base;
1962 QT_FT_GLYPH_FORMAT_OUTLINE,
QMap< QString, QString > map
[6]
AudioChannelLayoutTag tag
DBusConnection const char DBusError * error
#define QT_FT_MAX_GRAY_SPANS
static int gray_move_to(const QT_FT_Vector *to, PWorker worker)
static void gray_record_cell(RAS_ARG)
#define QT_FT_MEM_ZERO(dest, count)
#define ErrRaster_Memory_Overflow
static PCell gray_find_cell(RAS_ARG)
struct TWorker_ * PWorker
static void gray_raster_done(QT_FT_Raster raster)
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
static int gray_convert_glyph_inner(RAS_ARG)
static void gray_start_cell(RAS_ARG_ TCoord ex, TCoord ey)
static void gray_split_conic(QT_FT_Vector *base)
#define ErrRaster_Invalid_Argument
static int gray_raster_new(QT_FT_Raster *araster)
static int QT_FT_Outline_Decompose(const QT_FT_Outline *outline, void *user)
#define QT_FT_DIV_MOD(type, dividend, divisor, quotient, remainder)
#define QT_FT_HYPOT(x, y)
static void gray_render_cubic(RAS_ARG_ const QT_FT_Vector *control1, const QT_FT_Vector *control2, const QT_FT_Vector *to)
static int gray_convert_glyph(RAS_ARG)
static int gray_raster_render(QT_FT_Raster raster, const QT_FT_Raster_Params *params)
#define ErrRaster_Invalid_Mode
static void gray_raster_reset(QT_FT_Raster raster, char *pool_base, long pool_size)
int q_gray_rendered_spans(TRaster *raster)
static void gray_compute_cbox(RAS_ARG)
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
#define ErrRaster_OutOfMemory
const QT_FT_Raster_Funcs qt_ft_grays_raster
#define QT_FT_MEM_SET(d, s, c)
#define QT_FT_UDIVPREP(b)
static void gray_init_cells(RAS_ARG_ void *buffer, long byte_size)
static void gray_render_conic(RAS_ARG_ const QT_FT_Vector *control, const QT_FT_Vector *to)
struct TRaster_ * PRaster
static void gray_sweep(RAS_ARG_ const QT_FT_Bitmap *target)
static void gray_render_scanline(RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
static void gray_render_span(int count, const QT_FT_Span *spans, PWorker worker)
#define ErrRaster_Invalid_Outline
static void gray_split_cubic(QT_FT_Vector *base)
static void gray_hline(RAS_ARG_ TCoord x, TCoord y, TPos area, int acount)
#define MINIMUM_POOL_SIZE
static int area(const QSize &s)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLfixed GLfixed GLfixed y2
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void GLsizei void void * span
#define QT_FT_RASTER_FLAG_CLIP
#define QT_FT_Raster_Reset_Func
#define QT_FT_OUTLINE_EVEN_ODD_FILL
#define QT_FT_RASTER_FLAG_DIRECT
#define QT_FT_CURVE_TAG_ON
#define QT_FT_Raster_Span_Func
#define QT_FT_Raster_New_Func
#define QT_FT_CURVE_TAG_CONIC
#define QT_FT_Raster_Render_Func
#define QT_FT_CURVE_TAG_CUBIC
#define QT_FT_RASTER_FLAG_AA
#define QT_FT_Raster_Set_Mode_Func
#define QT_FT_CURVE_TAG(flag)
#define QT_FT_Raster_Done_Func
static void split(QT_FT_Vector *b)
myFilter draw(painter, QPoint(0, 0), originalPixmap)
long buffer_allocated_size
qt_ft_jmp_buf jump_buffer
QT_FT_Raster_Span_Func render_span
QT_FT_Span gray_spans[QT_FT_MAX_GRAY_SPANS]
virtual HRESULT STDMETHODCALLTYPE Close(void)=0