Avoid double caching glyphs in raster/QPA/FreeType
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Fri, 16 Sep 2011 14:00:04 +0000 (16:00 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 20 Sep 2011 10:00:23 +0000 (12:00 +0200)
commit070d9c00c488a5ee6811f04170cf488ead79bf80
treeef3511a994b4ec4b8d563393ea2fb1a4783ad095
parent57368c7037c6d2a6c8cc18d9d41399bf740abe5c
Avoid double caching glyphs in raster/QPA/FreeType

Since FreeType has internal caching, it has had a special
code path in the raster engine which avoided using Qt's glyph
cache, as that would be redundant. However, when compiling
with QPA, we want the same behavior without being able to
access the QFontEngineFT class. To achieve this, I've made
a new abstraction and added it to QFontEngine which allows
the FT engine to provide direct pointers into the alpha maps
stored by FT. This requires a locking/unlocking mechanism.

Yes, the QFontEngine::alphaMap* API is slowly becoming a horrible
mess, but due to time constraints, the task of refactoring these
functions into a more flexible API needs to wait. I've added a
TODO comment for this.

Change-Id: I08237403c2967f8fb952258178676f33a87c0353
Reviewed-on: http://codereview.qt-project.org/5155
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/image/qimage.cpp
src/gui/image/qimage_p.h
src/gui/painting/qpaintengine_raster.cpp
src/gui/text/qfontengine.cpp
src/gui/text/qfontengine_ft.cpp
src/gui/text/qfontengine_ft_p.h
src/gui/text/qfontengine_p.h