aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-01-27 15:15:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-27 20:00:41 +0100
commit6c5b42b47e4b8b08d5188019171c779b3748236d (patch)
treee206558ee238e9712127bc9d0f2ec90b23890789 /src/quick/scenegraph/qsgcontext.cpp
parentc39e6e89a50b5a3d2618a6c5a20950f19a0f7dfc (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/scenegraph/qsgcontext.cpp')
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp24
1 files changed, 3 insertions, 21 deletions
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);