diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 5a66f1dfef..db889c3102 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -764,13 +764,13 @@ void QSGTextMaskMaterial::updateCache(QFontEngine::GlyphFormat glyphFormat) if (!fontEngine->supportsTransformation(glyphCacheTransform)) glyphCacheTransform = QTransform(); - //QColor color = glyphFormat == QFontEngine::Format_ARGB ? QColor::fromRgbF(m_color.x(), m_color.y(), m_color.z(), m_color.w()) : QColor(); - m_glyphCache = fontEngine->glyphCache(cacheKey, glyphFormat, glyphCacheTransform); // ### restore color arg when merges are done + QColor color = glyphFormat == QFontEngine::Format_ARGB ? QColor::fromRgbF(m_color.x(), m_color.y(), m_color.z(), m_color.w()) : QColor(); + m_glyphCache = fontEngine->glyphCache(cacheKey, glyphFormat, glyphCacheTransform, color); if (!m_glyphCache || int(m_glyphCache->glyphFormat()) != glyphFormat) { if (m_rhi) - m_glyphCache = new QSGRhiTextureGlyphCache(m_rhi, glyphFormat, glyphCacheTransform); // ### color + m_glyphCache = new QSGRhiTextureGlyphCache(m_rhi, glyphFormat, glyphCacheTransform, color); else - m_glyphCache = new QOpenGLTextureGlyphCache(glyphFormat, glyphCacheTransform); // ### restore color arg when merges are done + m_glyphCache = new QOpenGLTextureGlyphCache(glyphFormat, glyphCacheTransform, color); fontEngine->setGlyphCache(cacheKey, m_glyphCache.data()); m_rc->registerFontengineForCleanup(fontEngine); diff --git a/src/quick/scenegraph/qsgrhitextureglyphcache.cpp b/src/quick/scenegraph/qsgrhitextureglyphcache.cpp index f181d101c6..99761302e2 100644 --- a/src/quick/scenegraph/qsgrhitextureglyphcache.cpp +++ b/src/quick/scenegraph/qsgrhitextureglyphcache.cpp @@ -43,8 +43,9 @@ QT_BEGIN_NAMESPACE -QSGRhiTextureGlyphCache::QSGRhiTextureGlyphCache(QRhi *rhi, QFontEngine::GlyphFormat format, const QTransform &matrix) - : QImageTextureGlyphCache(format, matrix), +QSGRhiTextureGlyphCache::QSGRhiTextureGlyphCache(QRhi *rhi, QFontEngine::GlyphFormat format, const QTransform &matrix, + const QColor &color) + : QImageTextureGlyphCache(format, matrix, color), m_rhi(rhi) { // Some OpenGL implementations, for instance macOS, have issues with diff --git a/src/quick/scenegraph/qsgrhitextureglyphcache_p.h b/src/quick/scenegraph/qsgrhitextureglyphcache_p.h index 1533beb162..75d82de90d 100644 --- a/src/quick/scenegraph/qsgrhitextureglyphcache_p.h +++ b/src/quick/scenegraph/qsgrhitextureglyphcache_p.h @@ -59,7 +59,8 @@ QT_BEGIN_NAMESPACE class QSGRhiTextureGlyphCache : public QImageTextureGlyphCache { public: - QSGRhiTextureGlyphCache(QRhi *rhi, QFontEngine::GlyphFormat format, const QTransform &matrix); + QSGRhiTextureGlyphCache(QRhi *rhi, QFontEngine::GlyphFormat format, const QTransform &matrix, + const QColor &color = QColor()); ~QSGRhiTextureGlyphCache(); void createTextureData(int width, int height) override;