![]() |
Qt 6.x
The Qt SDK
|
#include <qsgdistancefieldglyphnode_p_p.h>
Public Member Functions | |
QSGDistanceFieldTextMaterial () | |
~QSGDistanceFieldTextMaterial () | |
QSGMaterialType * | type () const override |
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader(). | |
QSGMaterialShader * | createShader (QSGRendererInterface::RenderMode renderMode) const override |
This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial. | |
int | compare (const QSGMaterial *other) const override |
Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before. | |
virtual void | setColor (const QColor &color) |
const QVector4D & | color () const |
void | setGlyphCache (QSGDistanceFieldGlyphCache *a) |
QSGDistanceFieldGlyphCache * | glyphCache () const |
void | setTexture (const QSGDistanceFieldGlyphCache::Texture *tex) |
const QSGDistanceFieldGlyphCache::Texture * | texture () const |
void | setFontScale (qreal fontScale) |
qreal | fontScale () const |
QSize | textureSize () const |
bool | updateTextureSize () |
bool | updateTextureSizeAndWrapper () |
QSGTexture * | wrapperTexture () const |
![]() | |
QSGMaterial () | |
virtual | ~QSGMaterial () |
virtual QSGMaterialType * | type () const =0 |
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader(). | |
virtual QSGMaterialShader * | createShader (QSGRendererInterface::RenderMode renderMode) const =0 |
This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial. | |
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 before other and 1 if other should sort before. | |
QSGMaterial::Flags | flags () const |
Returns the material's flags. | |
void | setFlag (Flags flags, bool on=true) |
Sets the flags flags on this material if on is true; otherwise clears the attribute. | |
Protected Attributes | |
QSize | m_size |
QVector4D | m_color |
QSGDistanceFieldGlyphCache * | m_glyph_cache |
const QSGDistanceFieldGlyphCache::Texture * | m_texture |
qreal | m_fontScale |
QSGPlainTexture * | m_sgTexture |
Additional Inherited Members | |
![]() | |
enum | Flag { Blending = 0x0001 , RequiresDeterminant = 0x0002 , RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant , RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate , NoBatching = 0x0010 } |
\value Blending Set this flag to true if the material requires blending to be enabled during rendering. More... | |
Definition at line 27 of file qsgdistancefieldglyphnode_p_p.h.
QSGDistanceFieldTextMaterial::QSGDistanceFieldTextMaterial | ( | ) |
Definition at line 153 of file qsgdistancefieldglyphnode_p.cpp.
References QSGMaterial::Blending, QSGMaterial::RequiresDeterminant, and QSGMaterial::setFlag().
QSGDistanceFieldTextMaterial::~QSGDistanceFieldTextMaterial | ( | ) |
Definition at line 162 of file qsgdistancefieldglyphnode_p.cpp.
References m_sgTexture.
|
inline |
Definition at line 38 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGHiQSubPixelDistanceFieldTextMaterialRhiShader::updateGraphicsPipelineState(), and QSGDistanceFieldTextMaterialRhiShader::updateUniformData().
|
overridevirtual |
Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before.
The scene graph can reorder geometry nodes to minimize state changes. The compare function is called during the sorting process so that the materials can be sorted to minimize state changes in each call to QSGMaterialShader::updateState().
The this pointer and other is guaranteed to have the same type().
Reimplemented from QSGMaterial.
Definition at line 218 of file qsgdistancefieldglyphnode_p.cpp.
References m_color, m_fontScale, m_glyph_cache, m_texture, o, other(), Q_ASSERT, t1, QSGDistanceFieldGlyphCache::Texture::texture, and type().
Referenced by QSGDistanceFieldStyledTextMaterial::compare().
|
overridevirtual |
This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial.
The function will be called only once for each combination of material type and renderMode and will be cached internally.
For most materials, the renderMode can be ignored. A few materials may need custom handling for specific render modes. For instance if the material implements antialiasing in a way that needs to account for perspective transformations when RenderMode3D is in use.
Implements QSGMaterial.
Reimplemented in QSGHiQSubPixelDistanceFieldTextMaterial, and QSGLoQSubPixelDistanceFieldTextMaterial.
Definition at line 180 of file qsgdistancefieldglyphnode_p.cpp.
References QSGDistanceFieldGlyphCache::eightBitFormatIsAlphaSwizzled(), m_glyph_cache, QSGRendererInterface::RenderMode3D, and QSGDistanceFieldGlyphCache::screenSpaceDerivativesSupported().
|
inline |
Definition at line 47 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateUniformData(), DistanceFieldOutlineTextMaterialRhiShader::updateUniformData(), DistanceFieldShiftedStyleTextMaterialRhiShader::updateUniformData(), and QSGHiQSubPixelDistanceFieldTextMaterialRhiShader::updateUniformData().
|
inline |
Definition at line 41 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateUniformData(), and DistanceFieldOutlineTextMaterialRhiShader::updateUniformData().
Reimplemented in QSGHiQSubPixelDistanceFieldTextMaterial, and QSGLoQSubPixelDistanceFieldTextMaterial.
Definition at line 173 of file qsgdistancefieldglyphnode_p.cpp.
References m_color.
Referenced by QSGDistanceFieldGlyphNode::setColor().
Definition at line 46 of file qsgdistancefieldglyphnode_p_p.h.
|
inline |
Definition at line 40 of file qsgdistancefieldglyphnode_p_p.h.
|
inline |
Definition at line 43 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldGlyphNode::updateGeometry().
|
inline |
Definition at line 44 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateUniformData().
|
inline |
Definition at line 49 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateUniformData(), and DistanceFieldShiftedStyleTextMaterialRhiShader::updateUniformData().
|
overridevirtual |
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader().
For many materials, the typical approach will be to return a pointer to a static, and so globally available, QSGMaterialType instance. The QSGMaterialType is an opaque object. Its purpose is only to serve as a type-safe, simple way to generate unique material identifiers.
Implements QSGMaterial.
Reimplemented in QSGHiQSubPixelDistanceFieldTextMaterial, and QSGLoQSubPixelDistanceFieldTextMaterial.
Definition at line 167 of file qsgdistancefieldglyphnode_p.cpp.
References type().
Referenced by compare(), and type().
bool QSGDistanceFieldTextMaterial::updateTextureSize | ( | ) |
Definition at line 188 of file qsgdistancefieldglyphnode_p.cpp.
References QSGDistanceFieldGlyphCache::glyphTexture(), m_glyph_cache, m_size, m_texture, and QSGDistanceFieldGlyphCache::Texture::size.
Referenced by updateTextureSizeAndWrapper().
bool QSGDistanceFieldTextMaterial::updateTextureSizeAndWrapper | ( | ) |
Definition at line 204 of file qsgdistancefieldglyphnode_p.cpp.
References m_sgTexture, m_size, m_texture, QSGPlainTexture::setOwnsTexture(), QSGPlainTexture::setTexture(), QSGPlainTexture::setTextureSize(), QSGDistanceFieldGlyphCache::Texture::texture, and updateTextureSize().
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateUniformData().
|
inline |
Definition at line 53 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by QSGDistanceFieldTextMaterialRhiShader::updateSampledImage(), and QSGDistanceFieldTextMaterialRhiShader::updateUniformData().
|
protected |
Definition at line 57 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by compare(), and setColor().
|
protected |
Definition at line 60 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by compare().
|
protected |
Definition at line 58 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by compare(), createShader(), QSGDistanceFieldOutlineTextMaterial::createShader(), QSGDistanceFieldShiftedStyleTextMaterial::createShader(), QSGHiQSubPixelDistanceFieldTextMaterial::createShader(), QSGLoQSubPixelDistanceFieldTextMaterial::createShader(), and updateTextureSize().
|
protected |
Definition at line 61 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by ~QSGDistanceFieldTextMaterial(), and updateTextureSizeAndWrapper().
|
protected |
Definition at line 56 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by updateTextureSize(), and updateTextureSizeAndWrapper().
|
protected |
Definition at line 59 of file qsgdistancefieldglyphnode_p_p.h.
Referenced by compare(), updateTextureSize(), and updateTextureSizeAndWrapper().