freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One more problem in Gray rasterizer ... (I think this is last :-)


From: Boris Letocha
Subject: One more problem in Gray rasterizer ... (I think this is last :-)
Date: Tue, 13 Jun 2000 20:46:14 +0200

Hello FreeTypers :-)

I found another problem in GrayScale rasterizer (Maybe problem does not appear in font rendering, but as standalone it can surely)

Look at source:

  /* a macro comparing two cell pointers.  Returns true if a <= b. */
#if 1
#define PACK( a )          ( ( (long)(a)->y << 16 ) | (a)->x )  // <---- PROBLEM IS HERE
#define LESS_THAN( a, b )  ( PACK(a) < PACK(b) )
#else /* 1 */
#define LESS_THAN( a, b )  ( (a)->y < (b)->y || \
                             ( (a)->y == (b)->y && (a)->x < (b)->x ) )
#endif /* 1 */

Problem is that (a)->x can be -1. And oring -1 is bad ... So solution is use the second LESS_THAN, or change problem line to this:

#define PACK( a )          ( ( (long)(a)->y << 16 ) + (a)->x )  // <---- PROBLEM IS FIXED HERE :-)

speeds of "|" and "+" are same everythere (minimaly on Intels...) and "+" gives right compare answer for x==-1.

I make really extensive testing of GrayScale reneder till today. And I must say it is FAAAAST and gives VERY ACCURATE results. And now it look also bug free I hope :-)

Also one comment now I give 128KB for cells buffer and even big polygons are rasterized in one pass.

Boris Letocha


reply via email to

[Prev in Thread] Current Thread [Next in Thread]