![]() |
Qt 6.x
The Qt SDK
|
#include <qsgdefaultglyphnode_p_p.h>
Public Member Functions | |
QSGTextMaskMaterial (QSGRenderContext *rc, const QVector4D &color, const QRawFont &font, QFontEngine::GlyphFormat glyphFormat=QFontEngine::Format_None) | |
virtual | ~QSGTextMaskMaterial () |
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. | |
void | setColor (const QColor &c) |
void | setColor (const QVector4D &color) |
const QVector4D & | color () const |
QSGTexture * | texture () const |
bool | ensureUpToDate () |
QTextureGlyphCache * | glyphCache () const |
QSGRhiTextureGlyphCache * | rhiGlyphCache () const |
void | populate (const QPointF &position, const QVector< quint32 > &glyphIndexes, const QVector< QPointF > &glyphPositions, QSGGeometry *geometry, QRectF *boundingRect, QPointF *baseLine, const QMargins &margins=QMargins(0, 0, 0, 0)) |
![]() | |
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. | |
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 35 of file qsgdefaultglyphnode_p_p.h.
QSGTextMaskMaterial::QSGTextMaskMaterial | ( | QSGRenderContext * | rc, |
const QVector4D & | color, | ||
const QRawFont & | font, | ||
QFontEngine::GlyphFormat | glyphFormat = QFontEngine::Format_None |
||
) |
Definition at line 313 of file qsgdefaultglyphnode_p.cpp.
|
virtual |
Definition at line 323 of file qsgdefaultglyphnode_p.cpp.
References QSGRenderContext::unregisterFontengineForCleanup().
|
inline |
Definition at line 50 of file qsgdefaultglyphnode_p_p.h.
Referenced by setColor(), QSGStyledTextMaterial::setStyleColor(), QSG24BitTextMaskRhiShader::updateGraphicsPipelineState(), QSG8BitTextMaskRhiShader::updateUniformData(), QSG24BitTextMaskRhiShader::updateUniformData(), and QSG32BitColorTextRhiShader::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 552 of file qsgdefaultglyphnode_p.cpp.
References QExplicitlySharedDataPointer< T >::data(), o, other(), Q_ASSERT, qsg_colorDiff(), and type().
Referenced by QSGStyledTextMaterial::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.
Definition at line 523 of file qsgdefaultglyphnode_p.cpp.
References QSGRhiTextureGlyphCache::eightBitFormatIsAlphaSwizzled(), QFontEngine::Format_A32, QFontEngine::Format_A8, QFontEngine::Format_ARGB, QFontEngineGlyphCache::glyphFormat(), Q_UNUSED, and rhiGlyphCache().
bool QSGTextMaskMaterial::ensureUpToDate | ( | ) |
Definition at line 561 of file qsgdefaultglyphnode_p.cpp.
References QSGRhiTextureGlyphCache::height(), rhiGlyphCache(), QSGPlainTexture::setOwnsTexture(), QSGPlainTexture::setTexture(), QSGPlainTexture::setTextureSize(), QSGRhiTextureGlyphCache::texture(), and QSGRhiTextureGlyphCache::width().
Referenced by QSGTextMaskRhiShader::updateUniformData().
QTextureGlyphCache * QSGTextMaskMaterial::glyphCache | ( | ) | const |
Definition at line 513 of file qsgdefaultglyphnode_p.cpp.
References QExplicitlySharedDataPointer< T >::data().
Referenced by populate(), rhiGlyphCache(), and type().
void QSGTextMaskMaterial::populate | ( | const QPointF & | position, |
const QVector< quint32 > & | glyphIndexes, | ||
const QVector< QPointF > & | glyphPositions, | ||
QSGGeometry * | geometry, | ||
QRectF * | boundingRect, | ||
QPointF * | baseLine, | ||
const QMargins & | margins = QMargins(0, 0, 0, 0) |
||
) |
Definition at line 401 of file qsgdefaultglyphnode_p.cpp.
References QSGGeometry::allocate(), QList< T >::append(), QRawFont::ascent(), QList< T >::at(), QMargins::bottom(), boundingRect(), cache, QList< T >::constData(), QList< T >::data(), QRawFontPrivate::fontEngine, QFixedPoint::fromPointF(), QFixed::fromReal(), QRawFontPrivate::get(), glyphCache(), QFontEngine::glyphMargin(), i, QSGGeometry::indexDataAsUShort(), QSGGeometry::indexType(), QPointF::isNull(), QRawFont::isValid(), QMargins::left(), o, position(), Q_ASSERT, qFloor(), qRound(), QList< T >::reserve(), QMargins::right(), QList< T >::size(), QSGGeometry::sizeOfVertex(), QFontEngine::subPixelPositionForX(), QFontEngine::supportsHorizontalSubPixelPositions(), QMargins::top(), QFixed::toReal(), QSGGeometry::UnsignedShortType, QSGGeometry::vertexDataAsTexturedPoint2D(), QPointF::x(), QFixedPoint::x, and QPointF::y().
Referenced by QSGDefaultGlyphNode::update().
QSGRhiTextureGlyphCache * QSGTextMaskMaterial::rhiGlyphCache | ( | ) | const |
Definition at line 518 of file qsgdefaultglyphnode_p.cpp.
References glyphCache().
Referenced by createShader(), QSGStyledTextMaterial::createShader(), QSGOutlinedTextMaterial::createShader(), ensureUpToDate(), and QSGTextMaskRhiShader::updateUniformData().
Definition at line 45 of file qsgdefaultglyphnode_p_p.h.
References setColor().
Referenced by setColor(), and QSGDefaultGlyphNode::update().
Definition at line 330 of file qsgdefaultglyphnode_p.cpp.
References color(), QFontEngine::Format_ARGB, and QFontEngineGlyphCache::glyphFormat().
|
inline |
Definition at line 52 of file qsgdefaultglyphnode_p_p.h.
Referenced by QSGTextMaskRhiShader::updateSampledImage(), and QSGTextMaskRhiShader::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.
Definition at line 499 of file qsgdefaultglyphnode_p.cpp.
References QFontEngine::Format_A32, QFontEngine::Format_A8, QFontEngine::Format_ARGB, glyphCache(), and rgb.
Referenced by compare().