Avoid glyph rendering with FT when not needed
authorJiang Jiang <jiang.jiang@nokia.com>
Fri, 2 Mar 2012 13:22:10 +0000 (14:22 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 4 May 2012 13:35:30 +0000 (15:35 +0200)
commit295ec32a74502e225f6ebb606536587786708676
treebb125c8402883cf9680245639c79ba345026dd79
parentac300a166f801a6f6c0b15278e6893720a5726f8
Avoid glyph rendering with FT when not needed

If we only need to access the font metrics (like in scenegraph) for
layout, we don't need to render glyphs with FreeType at all.

Increase cached linearAdvance to 22 bits so that no overflow will
happen: FreeType returns 16.16 fixed point linearHoriAdvance, but
QFixed is 26.6, we store

    glyph->linearAdvance = linearHoriAdvance >> 10

Apparently 'short' is not enough since it's only 16 bits.

Change-Id: Id14eafa19f01a687de11997526281f9e7e860482
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/gui/text/qfontengine_ft.cpp
src/gui/text/qfontengine_ft_p.h