diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-10-10 14:23:33 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-11-11 11:42:49 +0100 |
commit | bde55ad574ac84440e2cdc9c1122a344bb1cb67a (patch) | |
tree | abb8d486eec2761630df6437019e2a54cb7259c6 /src/quick/scenegraph/qsgdefaultcontext.cpp | |
parent | 6df497920c696b44ab826c7b4cd775255c220511 (diff) |
Introduce a CurveRendering backend for text
This moves the internals of the curve renderer out from
Qt Quick Shapes and into a more centralized location
in Qt Quick, so that we can use the same code to create
a new text backend for rendering large scale text without
artifacts.
Change-Id: I3f7e6f7961c1bbe230fcb531c0ca028e038c1afd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultcontext.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index f37e0661b7..379debfe82 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -7,6 +7,7 @@ #include <QtQuick/private/qsgdefaultinternalimagenode_p.h> #include <QtQuick/private/qsgdefaultpainternode_p.h> #include <QtQuick/private/qsgdefaultglyphnode_p.h> +#include <QtQuick/private/qsgcurveglyphnode_p.h> #include <QtQuick/private/qsgdistancefieldglyphnode_p.h> #include <QtQuick/private/qsgdistancefieldglyphnode_p_p.h> #include <QtQuick/private/qsgrhisupport_p.h> @@ -146,10 +147,12 @@ QSGPainterNode *QSGDefaultContext::createPainterNode(QQuickPaintedItem *item) } QSGGlyphNode *QSGDefaultContext::createGlyphNode(QSGRenderContext *rc, - bool preferNativeGlyphNode, + QSGTextNode::RenderType renderType, int renderTypeQuality) { - if (m_distanceFieldDisabled || preferNativeGlyphNode) { + if (renderType == QSGTextNode::CurveRendering) { + return new QSGCurveGlyphNode(rc); + } else if (m_distanceFieldDisabled || renderType == QSGTextNode::NativeRendering) { return new QSGDefaultGlyphNode(rc); } else { QSGDistanceFieldGlyphNode *node = new QSGDistanceFieldGlyphNode(rc); |