diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-12-09 16:50:05 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2014-12-10 21:49:55 +0100 |
commit | e9222e199d587f48bd1d0e597aa295ebbe0531e3 (patch) | |
tree | e418e7085915584a9c81d2c3f8f7bd3ecc66f320 /src/gui/painting/qtextureglyphcache.cpp | |
parent | e79cdd0e6df7dec2edaea13b6cff45965c3e7456 (diff) |
GL2PaintEngine: Prevent fillInPendingGlyphs from breaking gradients
The glyph cache internally uses the image texture unit when blitting,
but doesn't always activate the unit before binding its texture,
resulting in sometimes binding the glyph cache texture to the
wrong unit.
The image texture unit is also the same as the brush texture unit,
so any time we fill in pending glyphs we need to re-bind the brush
texture, otherwise drawing text with eg. gradients will fail after
the new glyphs have been filled.
The new hasPendingGlyphs() member function of the glyph cache
is an optimization so that we don't need to activate and rebind
unless there are glyphs that need to be filled.
Change-Id: Iac74130145d2d6d7bf95206b5e8a2fc760743cb5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index e12d61bbf4..be46a0fba3 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -222,7 +222,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const void QTextureGlyphCache::fillInPendingGlyphs() { - if (m_pendingGlyphs.isEmpty()) + if (!hasPendingGlyphs()) return; int requiredHeight = m_h; |