freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Rasterizer performance benchmark


From: Magnus Andersson
Subject: [ft-devel] Rasterizer performance benchmark
Date: Fri, 21 Mar 2008 09:58:36 +0100

Hi!

I'm working on a vector shape rasterizer and I would like to benchmark it to FreeType to see how good it really is. To make the test as fair as possible I just want to make a few things clear so I havn't misunderstood anything. So please correct me if I'm wrong :)
The rasterizer I should benchmark against for anti-aliased renderings is ftgrays? From what I can read in that code there is no hinting done in this? And there is no performance decrease in setting the STANDALONE flag, right? And lastly, the ftgrays rasterizer is truly _exact_ as it claims?

As I mentioned, I am only interested in the performance of the rasterization step. Therefore in my test I allocate memory for all target bitmaps, rescale all glyphs and so on. So basically what I feed the rasterizers with is the point set which is the recaled glyph and the target bitmap. I also give ftgrays 32k of mem, so it has a plenty of that not to slow it down.

After the setup I run the same tests on my rasterizer and ftgrays. That is I rasterize all glyphs in the font Vrinda.ttf 1000 times and measure how long it takes, and I only use font sizes up to ~40 px. The reason I ask for your help here is because from my test it seems that I get better performance, which I find highly unlikely.

So the main issue here is, is my test valid and fair? This is what is called in the for-loops for the ftgrays-test:

ft_raster_params.source = &glyph[i];
ft_raster_params.target->buffer = ft_buffer[j].bm[i]; // just a bitmap of the right size
ft_raster_params.target->rows = high_y[i];
ft_raster_params.target->width = high_x[i];
ft_raster_params.target->pitch = high_x[i];
ft_grays_raster.raster_render(ft_raster, &ft_raster_params);


In the setup I've only set the flag:
ft_raster_params.flags = FT_RASTER_FLAG_AA;

Is there any other flag or any other thing that I have missed? Is this as fast as any anti-aliased FreeType rasterizer goes if I don't want any hinting, bitmap allocation or rescaling or anything, just measure the time it takes for the rasterizer to fill a bitmap with an already scaled point set? Could things like subdivision cutoff be tweaked or anything?

I should also mention that I compile for maximum speed.

All comments welcome of course! If you think that I could have missed the slightest thing I would really like to know!

Thanks in advance! :)

Med vänliga hälsningar
/Magnus Andersson

reply via email to

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