Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsgdistancefieldglyphnode_p_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_P_H
5#define QSGDISTANCEFIELDGLYPHNODE_P_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 <QtQuick/qsgmaterial.h>
19#include <QtQuick/private/qsgplaintexture_p.h>
22
24
25class QSGPlainTexture;
26
27class Q_QUICK_PRIVATE_EXPORT QSGDistanceFieldTextMaterial: public QSGMaterial
28{
29public:
32
33 QSGMaterialType *type() const override;
35 int compare(const QSGMaterial *other) const override;
36
37 virtual void setColor(const QColor &color);
38 const QVector4D &color() const { return m_color; }
39
40 void setGlyphCache(QSGDistanceFieldGlyphCache *a) { m_glyph_cache = a; }
41 QSGDistanceFieldGlyphCache *glyphCache() const { return m_glyph_cache; }
42
43 void setTexture(const QSGDistanceFieldGlyphCache::Texture * tex) { m_texture = tex; }
44 const QSGDistanceFieldGlyphCache::Texture * texture() const { return m_texture; }
45
46 void setFontScale(qreal fontScale) { m_fontScale = fontScale; }
47 qreal fontScale() const { return m_fontScale; }
48
49 QSize textureSize() const { return m_size; }
50
51 bool updateTextureSize();
52 bool updateTextureSizeAndWrapper();
53 QSGTexture *wrapperTexture() const { return m_sgTexture; }
54
55protected:
62};
63
65{
66public:
69
70 QSGMaterialType *type() const override = 0;
72 int compare(const QSGMaterial *other) const override;
73
74 void setStyleColor(const QColor &color);
75 const QVector4D &styleColor() const { return m_styleColor; }
76
77protected:
79};
80
82{
83public:
86
87 QSGMaterialType *type() const override;
89};
90
92{
93public:
96
97 QSGMaterialType *type() const override;
99 int compare(const QSGMaterial *other) const override;
100
101 void setShift(const QPointF &shift) { m_shift = shift; }
102 const QPointF &shift() const { return m_shift; }
103
104protected:
106};
107
109{
110public:
111 QSGMaterialType *type() const override;
113 void setColor(const QColor &color) override {
114 const auto rgbColor = color.toRgb();
115 m_color = QVector4D(rgbColor.redF(), rgbColor.greenF(), rgbColor.blueF(), rgbColor.alphaF());
116 }
117};
118
120{
121public:
122 QSGMaterialType *type() const override;
124 void setColor(const QColor &color) override {
125 const auto rgbColor = color.toRgb();
126 m_color = QVector4D(rgbColor.redF(), rgbColor.greenF(), rgbColor.blueF(), rgbColor.alphaF());
127 }
128};
129
131
132#endif
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore\reentrant
Definition qpoint.h:214
QSGMaterialType * type() const override=0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override=0
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
const QSGDistanceFieldGlyphCache::Texture * m_texture
const QSGDistanceFieldGlyphCache::Texture * texture() const
void setGlyphCache(QSGDistanceFieldGlyphCache *a)
void setTexture(const QSGDistanceFieldGlyphCache::Texture *tex)
QSGDistanceFieldGlyphCache * glyphCache() const
QSGDistanceFieldGlyphCache * m_glyph_cache
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
virtual QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const =0
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
virtual int compare(const QSGMaterial *other) const
Compares this material to other and returns 0 if they are equal; -1 if this material should sort befo...
virtual QSGMaterialType * type() const =0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
The QVector4D class represents a vector or vertex in 4D space.
Definition qvectornd.h:330
Combined button and popup list for selecting options.
static QT_WARNING_DISABLE_FLOAT_COMPARE ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qreal threshold)
Definition qbezier.cpp:309
GLboolean GLboolean GLboolean GLboolean a
[7]
double qreal
Definition qtypes.h:92
QSharedPointer< T > other(t)
[5]
myFilter setColor(QColor(128, 0, 0))
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.