diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-01-27 15:15:12 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-27 20:00:41 +0100 |
commit | 6c5b42b47e4b8b08d5188019171c779b3748236d (patch) | |
tree | e206558ee238e9712127bc9d0f2ec90b23890789 /src/quick/items/qquicktextnode.cpp | |
parent | c39e6e89a50b5a3d2618a6c5a20950f19a0f7dfc (diff) |
Move logic for determining native vs. DF text into single factory function
Makes QSGContext::createGlyphNode() the central point of determining which
glyph node to produce, instead of letting the caller call two different
versions of the factory, each one calling the other in various cases and
behind various ifdefs.
Change-Id: I30fb17cceab45d9e13ddf3ece7a65f220c5e5acd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquicktextnode.cpp')
-rw-r--r-- | src/quick/items/qquicktextnode.cpp | 8 |
1 files changed, 3 insertions, 5 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); |