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_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_EXPORT QSGDistanceFieldTextMaterial: public QSGMaterial
28{
29public:
32
33 QSGMaterialType *type() const override;
34 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) 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
90
92{
93public:
96
97 QSGMaterialType *type() const override;
98 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) 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;
112 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) 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;
123 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) 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:217
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
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:207
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint color
[2]
GLenum type
static int compare(quint64 a, quint64 b)
double qreal
Definition qtypes.h:187
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.