diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-11-19 14:24:08 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-11-19 14:24:08 (GMT) |
commit | e50e811461b54e07184af547f62aa44b3c5bb681 (patch) | |
tree | 45541bc05471d6c49305afeafa13f69031ccdecd /src/gui/text/qfontengine.cpp | |
parent | 05b65c2f9df1c2c56c72f313401a6adb422d381b (diff) | |
parent | b115770cc3bba68740a6848c7ccaed932399aca9 (diff) | |
download | Qt-e50e811461b54e07184af547f62aa44b3c5bb681.zip Qt-e50e811461b54e07184af547f62aa44b3c5bb681.tar.gz Qt-e50e811461b54e07184af547f62aa44b3c5bb681.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt
Conflicts:
src/gui/text/qfontengine_mac.mm
src/gui/text/qfontengine_p.h
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r-- | src/gui/text/qfontengine.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index f73b816..24c4664 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -605,6 +605,12 @@ void QFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int n addBitmapFontToPath(x, y, g, path, flags); } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, QFixed /*subPixelPosition*/) +{ + // For font engines don't support subpixel positioning + return alphaMapForGlyph(glyph); +} + QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &t) { QImage i = alphaMapForGlyph(glyph); @@ -615,6 +621,19 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &t) return i; } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) +{ + if (! supportsSubPixelPositions()) + return alphaMapForGlyph(glyph, t); + + QImage i = alphaMapForGlyph(glyph, subPixelPosition); + if (t.type() > QTransform::TxTranslate) + i = i.transformed(t).convertToFormat(QImage::Format_Indexed8); + Q_ASSERT(i.depth() <= 8); // To verify that transformed didn't change the format... + + return i; +} + QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed /*subPixelPosition*/, int /* margin */, const QTransform &t) { QImage alphaMask = alphaMapForGlyph(glyph, t); |