aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultglyphnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultglyphnode.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode.cpp b/src/quick/scenegraph/qsgdefaultglyphnode.cpp
index 0d42102f36..ba286b8a36 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode.cpp
@@ -42,8 +42,9 @@
QT_BEGIN_NAMESPACE
-QSGDefaultGlyphNode::QSGDefaultGlyphNode()
- : m_glyphNodeType(RootGlyphNode)
+QSGDefaultGlyphNode::QSGDefaultGlyphNode(QSGRenderContext *context)
+ : m_context(context)
+ , m_glyphNodeType(RootGlyphNode)
, m_dirtyGeometry(false)
{
setFlag(UsePreprocess);
@@ -75,14 +76,14 @@ void QSGDefaultGlyphNode::update()
QMargins margins(0, 0, 0, 0);
if (m_style == QQuickText::Normal) {
- m_material = new QSGTextMaskMaterial(font);
+ m_material = new QSGTextMaskMaterial(m_context, font);
} else if (m_style == QQuickText::Outline) {
- QSGOutlinedTextMaterial *material = new QSGOutlinedTextMaterial(font);
+ QSGOutlinedTextMaterial *material = new QSGOutlinedTextMaterial(m_context, font);
material->setStyleColor(m_styleColor);
m_material = material;
margins = QMargins(1, 1, 1, 1);
} else {
- QSGStyledTextMaterial *material = new QSGStyledTextMaterial(font);
+ QSGStyledTextMaterial *material = new QSGStyledTextMaterial(m_context, font);
if (m_style == QQuickText::Sunken) {
material->setStyleShift(QVector2D(0, -1));
margins.setTop(1);
@@ -158,7 +159,7 @@ void QSGDefaultGlyphNode::updateGeometry()
subNodeGlyphRun.setGlyphIndexes(glyphInfo.indexes);
subNodeGlyphRun.setPositions(glyphInfo.positions);
- QSGDefaultGlyphNode *subNode = new QSGDefaultGlyphNode();
+ QSGDefaultGlyphNode *subNode = new QSGDefaultGlyphNode(m_context);
subNode->setGlyphNodeType(SubGlyphNode);
subNode->setColor(m_color);
subNode->setStyle(m_style);