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
qsgdistancefieldglyphnode_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QSGDISTANCEFIELDGLYPHNODE_P_H
6#define QSGDISTANCEFIELDGLYPHNODE_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 <private/qsgadaptationlayer_p.h>
20#include <QtQuick/qsgtexture.h>
21
22#include <QtQuick/private/qquicktext_p.h>
23
25
27
28class QSGRenderContext;
29class QSGDistanceFieldTextMaterial;
30
32{
33public:
34 QSGDistanceFieldGlyphNode(QSGRenderContext *context);
36
37 QPointF baseLine() const override { return m_baseLine; }
38 void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override;
39 void setColor(const QColor &color) override;
40
41 void setPreferredAntialiasingMode(AntialiasingMode mode) override;
42 void setRenderTypeQuality(int renderTypeQuality) override;
43
44 void setStyle(QQuickText::TextStyle style) override;
45 void setStyleColor(const QColor &color) override;
46
47 void update() override;
48 void preprocess() override;
49
50 void invalidateGlyphs(const QList<quint32> &glyphs) override;
51
52 void updateGeometry();
53
54private:
55 enum DistanceFieldGlyphNodeType {
56 RootGlyphNode,
57 SubGlyphNode
58 };
59
60 void setGlyphNodeType(DistanceFieldGlyphNodeType type) { m_glyphNodeType = type; }
61 void updateMaterial();
62
63 DistanceFieldGlyphNodeType m_glyphNodeType;
64 QColor m_color;
65 QPointF m_baseLine;
66 QSGRenderContext *m_context;
67 QSGDistanceFieldTextMaterial *m_material;
68 QPointF m_originalPosition;
69 QPointF m_position;
70 QGlyphRun m_glyphs;
71 QSGDistanceFieldGlyphCache *m_glyph_cache;
72 QSGGeometry m_geometry;
73 QQuickText::TextStyle m_style;
74 QColor m_styleColor;
75 AntialiasingMode m_antialiasingMode;
76 QRectF m_boundingRect;
77 const QSGDistanceFieldGlyphCache::Texture *m_texture;
78 int m_renderTypeQuality;
79
80 struct GlyphInfo {
81 QList<quint32> indexes;
82 QList<QPointF> positions;
83 };
84 QSet<quint32> m_allGlyphIndexesLookup;
85 // m_glyphs holds pointers to the GlyphInfo.indexes and positions arrays, so we need to hold on to them
86 QHash<const QSGDistanceFieldGlyphCache::Texture *, GlyphInfo> m_glyphsInOtherTextures;
87
88 uint m_dirtyGeometry: 1;
89 uint m_dirtyMaterial: 1;
90};
91
92QT_END_NAMESPACE
93
94#endif
void invalidateGlyphs(const QList< quint32 > &glyphs) override
QSGDistanceFieldGlyphNode(QSGRenderContext *context)
void setStyleColor(const QColor &color) override
void setStyle(QQuickText::TextStyle style) override
void setRenderTypeQuality(int renderTypeQuality) override
void setColor(const QColor &color) override
void setPreferredAntialiasingMode(AntialiasingMode mode) override
void preprocess() override
Override this function to do processing on the node before it is rendered.
void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)