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
22QT_BEGIN_NAMESPACE
23
24class QSGCurveGlyphAtlas;
25class QSGCurveFillNode;
27
28class Q_QUICK_EXPORT QSGCurveGlyphNode : public QSGGlyphNode
29{
30public:
31 QSGCurveGlyphNode(QSGRenderContext *context);
32 ~QSGCurveGlyphNode();
33 void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override;
34 void update() override;
35 void preprocess() override;
36 void setPreferredAntialiasingMode(AntialiasingMode) override;
37 void updateGeometry();
38 void setColor(const QColor &color) override;
39 void setStyle(QQuickText::TextStyle style) override;
40
41 void setStyleColor(const QColor &color) override;
42 QPointF baseLine() const override { return m_baseLine; }
43
44 void recycle() override;
45
46private:
47 void cleanup();
48
49 QSGRenderContext *m_context;
50 QSGGeometry m_geometry;
51 QColor m_color = Qt::black;
52
53 struct GlyphInfo {
54 QList<quint32> indexes;
55 QList<QPointF> positions;
56 };
57
58 uint m_dirtyGeometry: 1;
59 qreal m_fontSize = 0.0f;
60 QGlyphRun m_glyphs;
61 QQuickText::TextStyle m_style = QQuickText::Normal;
62 QColor m_styleColor;
63 QPointF m_baseLine;
64 QPointF m_position;
65
66 QSGCurveFillNode *m_glyphNode = nullptr;
67 QSGCurveAbstractNode *m_styleNode = nullptr;
68};
69
70QT_END_NAMESPACE
71
72#endif