Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QSGDISTANCEFIELDGLYPHNODE_P_H
5#define QSGDISTANCEFIELDGLYPHNODE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qsgadaptationlayer_p.h>
19#include <QtQuick/qsgtexture.h>
20
21#include <QtQuick/private/qquicktext_p.h>
22
24
26
29
31{
32public:
35
36 QPointF baseLine() const override { return m_baseLine; }
37 void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override;
38 void setColor(const QColor &color) override;
39
41 void setRenderTypeQuality(int renderTypeQuality) override;
42
43 void setStyle(QQuickText::TextStyle style) override;
44 void setStyleColor(const QColor &color) override;
45
46 void update() override;
47 void preprocess() override;
48
49 void invalidateGlyphs(const QVector<quint32> &glyphs) override;
50
51 void updateGeometry();
52
53private:
54 enum DistanceFieldGlyphNodeType {
55 RootGlyphNode,
56 SubGlyphNode
57 };
58
59 void setGlyphNodeType(DistanceFieldGlyphNodeType type) { m_glyphNodeType = type; }
60 void updateMaterial();
61
62 DistanceFieldGlyphNodeType m_glyphNodeType;
63 QColor m_color;
64 QPointF m_baseLine;
65 QSGRenderContext *m_context;
67 QPointF m_originalPosition;
68 QPointF m_position;
69 QGlyphRun m_glyphs;
70 QSGDistanceFieldGlyphCache *m_glyph_cache;
71 QSGGeometry m_geometry;
73 QColor m_styleColor;
74 AntialiasingMode m_antialiasingMode;
75 QRectF m_boundingRect;
77 int m_renderTypeQuality;
78
79 struct GlyphInfo {
80 QVector<quint32> indexes;
81 QVector<QPointF> positions;
82 };
83 QSet<quint32> m_allGlyphIndexesLookup;
84 // m_glyphs holds pointers to the GlyphInfo.indexes and positions arrays, so we need to hold on to them
85 QHash<const QSGDistanceFieldGlyphCache::Texture *, GlyphInfo> m_glyphsInOtherTextures;
86
87 uint m_dirtyGeometry: 1;
88 uint m_dirtyMaterial: 1;
89
90 static qint64 m_totalAllocation; // all SG glyph vertices and indices; only for qCDebug metrics
91};
92
94
95#endif
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QGlyphRun class provides direct access to the internal glyphs in a font.
Definition qglyphrun.h:20
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qrect.h:484
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 invalidateGlyphs(const QVector< quint32 > &glyphs) override
void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
Definition qsggeometry.h:15
Combined button and popup list for selecting options.
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum mode
GLuint color
[2]
GLenum type
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
unsigned int uint
Definition qtypes.h:34
long long qint64
Definition qtypes.h:60