Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgcurveglyphnode_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSGCURVEGLYPHNODE_P_H
6#define QSGCURVEGLYPHNODE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <qtquickexports.h>
20#include <private/qsgadaptationlayer_p.h>
21#include <private/qsgbasicglyphnode_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QSGCurveGlyphAtlas;
26class QSGCurveFillNode;
28
29class Q_QUICK_EXPORT QSGCurveGlyphNode : public QSGGlyphNode
30{
31public:
32 QSGCurveGlyphNode(QSGRenderContext *context);
33 ~QSGCurveGlyphNode();
34 void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override;
35 void update() override;
36 void preprocess() override;
37 void setPreferredAntialiasingMode(AntialiasingMode) override;
38 void updateGeometry();
39 void setColor(const QColor &color) override;
40 void setStyle(QQuickText::TextStyle style) override;
41
42 void setStyleColor(const QColor &color) override;
43 QPointF baseLine() const override { return m_baseLine; }
44
45private:
46 QSGRenderContext *m_context;
47 QSGGeometry m_geometry;
48 QColor m_color = Qt::black;
49
50 struct GlyphInfo {
51 QList<quint32> indexes;
52 QList<QPointF> positions;
53 };
54
55 uint m_dirtyGeometry: 1;
56 qreal m_fontSize = 0.0f;
57 QGlyphRun m_glyphs;
58 QQuickText::TextStyle m_style;
59 QColor m_styleColor;
60 QPointF m_baseLine;
61 QPointF m_position;
62
63 QSGCurveFillNode *m_glyphNode = nullptr;
64 QSGCurveAbstractNode *m_styleNode = nullptr;
65};
66
67QT_END_NAMESPACE
68
69#endif