aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquicktextnode.cpp8
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp24
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h3
3 files changed, 7 insertions, 28 deletions
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index 18ee1a479d..1133636a74 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -144,11 +144,9 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun
{
QSGRenderContext *sg = QQuickItemPrivate::get(m_ownerElement)->sceneGraphRenderContext();
QRawFont font = glyphs.rawFont();
- bool smoothScalable = QFontDatabase().isSmoothlyScalable(font.familyName(),
- font.styleName());
- QSGGlyphNode *node = m_useNativeRenderer || !smoothScalable
- ? sg->sceneGraphContext()->createNativeGlyphNode(sg)
- : sg->sceneGraphContext()->createGlyphNode(sg);
+ bool smoothScalable = QFontDatabase().isSmoothlyScalable(font.familyName(), font.styleName());
+ bool preferNativeGlyphNode = m_useNativeRenderer || !smoothScalable;
+ QSGGlyphNode *node = sg->sceneGraphContext()->createGlyphNode(sg, preferNativeGlyphNode);
node->setOwnerElement(m_ownerElement);
node->setGlyphs(position + QPointF(0, glyphs.rawFont().ascent()), glyphs);
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 829d33a0d7..202ae91ac3 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -253,32 +253,14 @@ QSGImageNode *QSGContext::createImageNode()
}
/*!
- Factory function for scene graph backends of the Text elements which supports native
- text rendering. Used in special cases where native look and feel is a main objective.
-*/
-QSGGlyphNode *QSGContext::createNativeGlyphNode(QSGRenderContext *rc)
-{
-#if defined(QT_OPENGL_ES) && !defined(QT_OPENGL_ES_2_ANGLE)
- Q_D(QSGContext);
- if (d->distanceFieldDisabled)
- return new QSGDefaultGlyphNode;
- else
- return createGlyphNode(rc);
-#else
- Q_UNUSED(rc);
- return new QSGDefaultGlyphNode;
-#endif
-}
-
-/*!
Factory function for scene graph backends of the Text elements;
*/
-QSGGlyphNode *QSGContext::createGlyphNode(QSGRenderContext *rc)
+QSGGlyphNode *QSGContext::createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode)
{
Q_D(QSGContext);
- if (d->distanceFieldDisabled) {
- return createNativeGlyphNode(rc);
+ if (d->distanceFieldDisabled || preferNativeGlyphNode) {
+ return new QSGDefaultGlyphNode;
} else {
QSGDistanceFieldGlyphNode *node = new QSGDistanceFieldGlyphNode(rc);
node->setPreferredAntialiasingMode(d->distanceFieldAntialiasing);
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index c1bf78a018..883287e35d 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -158,8 +158,7 @@ public:
virtual QSGRectangleNode *createRectangleNode();
virtual QSGImageNode *createImageNode();
- virtual QSGGlyphNode *createGlyphNode(QSGRenderContext *rc);
- virtual QSGGlyphNode *createNativeGlyphNode(QSGRenderContext *rc);
+ virtual QSGGlyphNode *createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode);
virtual QAnimationDriver *createAnimationDriver(QObject *parent);
virtual QSize minimumFBOSize() const;