From e9222e199d587f48bd1d0e597aa295ebbe0531e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 9 Dec 2014 16:50:05 +0100 Subject: GL2PaintEngine: Prevent fillInPendingGlyphs from breaking gradients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tor Arne Vestbø --- src/gui/painting/qtextureglyphcache_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/painting/qtextureglyphcache_p.h') diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index 50c2c9dcc6..2d2fcdfc93 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -104,6 +104,7 @@ public: bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions); + bool hasPendingGlyphs() const { return !m_pendingGlyphs.isEmpty(); }; void fillInPendingGlyphs(); virtual void createTextureData(int width, int height) = 0; -- cgit v1.2.3