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
27
29{
30public:
33
34 QPointF baseLine() const override { return m_baseLine; }
35 void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override;
36 void setColor(const QColor &color) override;
37
39 void setRenderTypeQuality(int renderTypeQuality) override;
40
41 void setStyle(QQuickText::TextStyle style) override;
42 void setStyleColor(const QColor &color) override;
43
44 void update() override;
45 void preprocess() override;
46
47 void invalidateGlyphs(const QVector<quint32> &glyphs) override;
48
49 void updateGeometry();
50
51private:
52 enum DistanceFieldGlyphNodeType {
53 RootGlyphNode,
54 SubGlyphNode
55 };
56
57 void setGlyphNodeType(DistanceFieldGlyphNodeType type) { m_glyphNodeType = type; }
58 void updateMaterial();
59
60 DistanceFieldGlyphNodeType m_glyphNodeType;
61 QColor m_color;
62 QPointF m_baseLine;
63 QSGRenderContext *m_context;
65 QPointF m_originalPosition;
66 QPointF m_position;
67 QGlyphRun m_glyphs;
68 QSGDistanceFieldGlyphCache *m_glyph_cache;
69 QSGGeometry m_geometry;
71 QColor m_styleColor;
72 AntialiasingMode m_antialiasingMode;
73 QRectF m_boundingRect;
75 int m_renderTypeQuality;
76
77 struct GlyphInfo {
78 QVector<quint32> indexes;
79 QVector<QPointF> positions;
80 };
81 QSet<quint32> m_allGlyphIndexesLookup;
82 // m_glyphs holds pointers to the GlyphInfo.indexes and positions arrays, so we need to hold on to them
83 QHash<const QSGDistanceFieldGlyphCache::Texture *, GlyphInfo> m_glyphsInOtherTextures;
84
85 uint m_dirtyGeometry: 1;
86 uint m_dirtyMaterial: 1;
87
88 static qint64 m_totalAllocation; // all SG glyph vertices and indices; only for qCDebug metrics
89};
90
92
93#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.
static void * context
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