[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Freetype performance question?
From: |
David Turner |
Subject: |
Re: [ft] Freetype performance question? |
Date: |
Wed, 21 Jun 2006 08:48:09 +0200 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
Michael Sander a écrit :
Most users of freetype on a X system first use the freetype2 engine to
render the font to some in-memory bitmap and then use XPutImage to
render the image to the screen.
I wouldn't say "most users", since the typical scheme used to display
anti-aliased text doesn't need
composition of in-memory bitmaps and XPutImage. Instead, it is the
following:
- the client generates (monochrome or anti-aliased) glyph images for the
characters it needs. it
supposedly does so only *once* per character / size / transform, and
lazily (i.e., on-demand)
- the client sends these glyph bitmap images to the X Server through the
XRender extension.
The X Server globally caches them.
- when the client needs to draw some text, it simply sends the positions
and glyph 'indices' needed
to the X Server, the latter retrieves the bitmaps from its global
cache, and performs the composition
on the target drawable.
This is much more network efficient than having to send the glyph
bitmaps each time, and the
composition can be trivially hardware-accellerated by the X Server.
Does anyone have any performance benchmarks compared to simple X
rendering (i.e. XDrawString). I am especially concerned over slow X
connections. If one is rendering a full screen of text using freetype
on a slow X connection they have to effectively transfer a full screen
bitmap image.
To get back to your point, if you use some sort of glyph bitmap cache,
your performance will probably
be dominated by the composition code that you'll be using to draw the
glyphs into your in-memory
bitmap, as well as the network transfer of the result. The performance
of FreeType will be totally
irrelevant.
It will be much slower than a simple XDrawString, because this one can
be hardware accellerated by
the X Server. However, note that XDrawString is incapable of performing
anti-aliased text rendering.
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)
***********************************************************************************
Information contained in this email message is confidential and may be
privileged, and is intended only for use of the individual or entity named
above. If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this communication
in error, please immediately notify the address@hidden and destroy the original
message.
***********************************************************************************