diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2013-08-21 14:40:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-27 20:35:55 +0200 |
commit | 184e27c0e69f9f8c342339e83cdf79ec5a97b58e (patch) | |
tree | 0529dcf5a0b5b86b98c40d257f69ecb7dcb9b3ee /src/quick/scenegraph/qsgadaptationlayer.cpp | |
parent | cb9672c86d2679bcb0d9e10f76b12eb03f4c515e (diff) |
Updated distance field glyph caches to use QDistanceField.
Some OpenGL drivers assume alpha-only images are always tightly packed,
regardless of what is set for GL_UNPACK_ALIGNMENT. We now use
QDistanceField to store glyphs, which aligns scanlines on a 1-byte
boundary, instead of QImage which uses a 4-byte boundary. A previous
workaround uploaded scanlines one at a time, but this is also broken
with some other drivers...
Task-number: QTBUG-30908
Task-number: QTBUG-32861
Change-Id: I46527fb48de1e00116f776427c45baa752c6176d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgadaptationlayer.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 3536975e94..3c8772252c 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -168,13 +168,11 @@ void QSGDistanceFieldGlyphCache::update() qsg_render_timer.start(); #endif - QHash<glyph_t, QImage> distanceFields; - + QList<QDistanceField> distanceFields; for (int i = 0; i < m_pendingGlyphs.size(); ++i) { - glyph_t glyphIndex = m_pendingGlyphs.at(i); - - QImage distanceField = qt_renderDistanceFieldGlyph(m_referenceFont, glyphIndex, m_doubleGlyphResolution); - distanceFields.insert(glyphIndex, distanceField); + distanceFields.append(QDistanceField(m_referenceFont, + m_pendingGlyphs.at(i), + m_doubleGlyphResolution)); } #ifndef QSG_NO_RENDER_TIMING |