Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSGDistanceFieldGlyphCache Class Referenceabstract

#include <qsgadaptationlayer_p.h>

+ Inheritance diagram for QSGDistanceFieldGlyphCache:
+ Collaboration diagram for QSGDistanceFieldGlyphCache:

Classes

struct  GlyphData
 
struct  GlyphPosition
 
struct  Metrics
 
struct  TexCoord
 
struct  Texture
 

Public Member Functions

 QSGDistanceFieldGlyphCache (const QRawFont &font, int renderTypeQuality)
 
virtual ~QSGDistanceFieldGlyphCache ()
 
const QRawFontreferenceFont () const
 
qreal fontScale (qreal pixelSize) const
 
qreal distanceFieldRadius () const
 
int glyphCount () const
 
bool doubleGlyphResolution () const
 
int renderTypeQuality () const
 
Metrics glyphMetrics (glyph_t glyph, qreal pixelSize)
 
TexCoord glyphTexCoord (glyph_t glyph)
 
const TextureglyphTexture (glyph_t glyph)
 
void populate (const QVector< glyph_t > &glyphs)
 
void release (const QVector< glyph_t > &glyphs)
 
void update ()
 
void registerGlyphNode (QSGDistanceFieldGlyphConsumer *node)
 
void unregisterGlyphNode (QSGDistanceFieldGlyphConsumer *node)
 
virtual void registerOwnerElement (QQuickItem *ownerElement)
 
virtual void unregisterOwnerElement (QQuickItem *ownerElement)
 
virtual void processPendingGlyphs ()
 
virtual bool eightBitFormatIsAlphaSwizzled () const =0
 
virtual bool screenSpaceDerivativesSupported () const =0
 
virtual bool isActive () const
 

Protected Member Functions

virtual void requestGlyphs (const QSet< glyph_t > &glyphs)=0
 
virtual void storeGlyphs (const QList< QDistanceField > &glyphs)=0
 
virtual void referenceGlyphs (const QSet< glyph_t > &glyphs)=0
 
virtual void releaseGlyphs (const QSet< glyph_t > &glyphs)=0
 
void setGlyphsPosition (const QList< GlyphPosition > &glyphs)
 
void setGlyphsTexture (const QVector< glyph_t > &glyphs, const Texture &tex)
 
void markGlyphsToRender (const QVector< glyph_t > &glyphs)
 
void removeGlyph (glyph_t glyph)
 
void updateRhiTexture (QRhiTexture *oldTex, QRhiTexture *newTex, const QSize &newTexSize)
 
bool containsGlyph (glyph_t glyph)
 
GlyphDataglyphData (glyph_t glyph)
 
GlyphDataemptyData (glyph_t glyph)
 
int baseFontSize () const
 

Protected Attributes

bool m_doubleGlyphResolution
 
int m_renderTypeQuality
 
QRawFont m_referenceFont
 

Detailed Description

Definition at line 410 of file qsgadaptationlayer_p.h.

Constructor & Destructor Documentation

◆ QSGDistanceFieldGlyphCache()

QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache ( const QRawFont font,
int  renderTypeQuality 
)

Definition at line 32 of file qsgadaptationlayer.cpp.

References font, QRawFontPrivate::fontEngine, QRawFontPrivate::get(), QFontEngine::glyphCount(), Q_ASSERT, QT_DISTANCEFIELD_HIGHGLYPHCOUNT(), QT_DISTANCEFIELD_SCALE(), qt_fontHasNarrowOutlines(), and QFont::setPixelSize().

+ Here is the call graph for this function:

◆ ~QSGDistanceFieldGlyphCache()

QSGDistanceFieldGlyphCache::~QSGDistanceFieldGlyphCache ( )
virtual

Definition at line 50 of file qsgadaptationlayer.cpp.

Member Function Documentation

◆ baseFontSize()

int QSGDistanceFieldGlyphCache::baseFontSize ( ) const
protected

Definition at line 54 of file qsgadaptationlayer.cpp.

References m_doubleGlyphResolution, m_renderTypeQuality, and QT_DISTANCEFIELD_BASEFONTSIZE().

+ Here is the call graph for this function:

◆ containsGlyph()

bool QSGDistanceFieldGlyphCache::containsGlyph ( glyph_t  glyph)
inlineprotected

Definition at line 556 of file qsgadaptationlayer_p.h.

References glyphData(), QSGDistanceFieldGlyphCache::TexCoord::isValid(), and QSGDistanceFieldGlyphCache::GlyphData::texCoord.

+ Here is the call graph for this function:

◆ distanceFieldRadius()

qreal QSGDistanceFieldGlyphCache::distanceFieldRadius ( ) const
inline

Definition at line 455 of file qsgadaptationlayer_p.h.

References QT_DISTANCEFIELD_RADIUS(), and QT_DISTANCEFIELD_SCALE().

Referenced by QSGRhiDistanceFieldGlyphCache::requestGlyphs(), QSGDistanceFieldGlyphNode::updateGeometry(), and DistanceFieldOutlineTextMaterialRhiShader::updateUniformData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doubleGlyphResolution()

bool QSGDistanceFieldGlyphCache::doubleGlyphResolution ( ) const
inline

Definition at line 460 of file qsgadaptationlayer_p.h.

◆ eightBitFormatIsAlphaSwizzled()

virtual bool QSGDistanceFieldGlyphCache::eightBitFormatIsAlphaSwizzled ( ) const
pure virtual

◆ emptyData()

QSGDistanceFieldGlyphCache::GlyphData & QSGDistanceFieldGlyphCache::emptyData ( glyph_t  glyph)
protected

Definition at line 59 of file qsgadaptationlayer.cpp.

References it, and QSGDistanceFieldGlyphCache::GlyphData::texture.

Referenced by glyphData().

+ Here is the caller graph for this function:

◆ fontScale()

qreal QSGDistanceFieldGlyphCache::fontScale ( qreal  pixelSize) const
inline

Definition at line 451 of file qsgadaptationlayer_p.h.

Referenced by glyphMetrics(), and QSGDistanceFieldGlyphNode::updateGeometry().

+ Here is the caller graph for this function:

◆ glyphCount()

int QSGDistanceFieldGlyphCache::glyphCount ( ) const
inline

Definition at line 459 of file qsgadaptationlayer_p.h.

Referenced by QSGRhiDistanceFieldGlyphCache::createFullSizeTextures(), and populate().

+ Here is the caller graph for this function:

◆ glyphData()

QSGDistanceFieldGlyphCache::GlyphData & QSGDistanceFieldGlyphCache::glyphData ( glyph_t  glyph)
protected

Definition at line 67 of file qsgadaptationlayer.cpp.

References QPainterPath::boundingRect(), QSGDistanceFieldGlyphCache::GlyphData::boundingRect, emptyData(), m_doubleGlyphResolution, m_referenceFont, QTransform::mapRect(), QSGDistanceFieldGlyphCache::GlyphData::path, QRawFont::pathForGlyph(), QT_DISTANCEFIELD_SCALE(), and QTransform::scale().

Referenced by containsGlyph(), glyphMetrics(), glyphTexCoord(), glyphTexture(), populate(), release(), removeGlyph(), QSGRhiDistanceFieldGlyphCache::requestGlyphs(), setGlyphsPosition(), setGlyphsTexture(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ glyphMetrics()

QSGDistanceFieldGlyphCache::Metrics QSGDistanceFieldGlyphCache::glyphMetrics ( glyph_t  glyph,
qreal  pixelSize 
)

Definition at line 83 of file qsgadaptationlayer.cpp.

References QSGDistanceFieldGlyphCache::GlyphData::boundingRect, fontScale(), glyphData(), QRectF::height(), QRectF::width(), QRectF::x(), and QRectF::y().

Referenced by QSGDistanceFieldGlyphNode::updateGeometry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ glyphTexCoord()

QSGDistanceFieldGlyphCache::TexCoord QSGDistanceFieldGlyphCache::glyphTexCoord ( glyph_t  glyph)
inline

Definition at line 539 of file qsgadaptationlayer_p.h.

References glyphData(), and QSGDistanceFieldGlyphCache::GlyphData::texCoord.

Referenced by QSGRhiDistanceFieldGlyphCache::requestGlyphs(), QSGRhiDistanceFieldGlyphCache::storeGlyphs(), and QSGDistanceFieldGlyphNode::updateGeometry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ glyphTexture()

const QSGDistanceFieldGlyphCache::Texture * QSGDistanceFieldGlyphCache::glyphTexture ( glyph_t  glyph)
inline

Definition at line 544 of file qsgadaptationlayer_p.h.

References glyphData(), and QSGDistanceFieldGlyphCache::GlyphData::texture.

Referenced by QSGDistanceFieldGlyphNode::updateGeometry(), and QSGDistanceFieldTextMaterial::updateTextureSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

bool QSGDistanceFieldGlyphCache::isActive ( ) const
virtual

Reimplemented in QSGRhiDistanceFieldGlyphCache.

Definition at line 144 of file qsgadaptationlayer.cpp.

◆ markGlyphsToRender()

void QSGDistanceFieldGlyphCache::markGlyphsToRender ( const QVector< glyph_t > &  glyphs)
protected

Definition at line 280 of file qsgadaptationlayer.cpp.

References QDataBuffer< Type >::add(), QList< T >::at(), i, and QList< T >::size().

Referenced by QSGRhiDistanceFieldGlyphCache::requestGlyphs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populate()

void QSGDistanceFieldGlyphCache::populate ( const QVector< glyph_t > &  glyphs)

Definition at line 97 of file qsgadaptationlayer.cpp.

References QList< T >::at(), QSGDistanceFieldGlyphCache::GlyphData::boundingRect, QSet< T >::contains(), glyphCount(), glyphData(), QSGDistanceFieldGlyphCache::TexCoord::height, i, QSet< T >::insert(), QSet< T >::isEmpty(), QRectF::isEmpty(), QSGDistanceFieldGlyphCache::TexCoord::isValid(), qWarning, QSGDistanceFieldGlyphCache::GlyphData::ref, referenceGlyphs(), requestGlyphs(), QList< T >::size(), QSGDistanceFieldGlyphCache::GlyphData::texCoord, and QSGDistanceFieldGlyphCache::TexCoord::width.

Referenced by QSGDistanceFieldGlyphNode::setGlyphs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processPendingGlyphs()

void QSGDistanceFieldGlyphCache::processPendingGlyphs ( )
virtual

Definition at line 246 of file qsgadaptationlayer.cpp.

◆ referenceFont()

const QRawFont & QSGDistanceFieldGlyphCache::referenceFont ( ) const
inline

Definition at line 449 of file qsgadaptationlayer_p.h.

◆ referenceGlyphs()

virtual void QSGDistanceFieldGlyphCache::referenceGlyphs ( const QSet< glyph_t > &  glyphs)
protectedpure virtual

Implemented in QSGRhiDistanceFieldGlyphCache.

Referenced by populate().

+ Here is the caller graph for this function:

◆ registerGlyphNode()

void QSGDistanceFieldGlyphCache::registerGlyphNode ( QSGDistanceFieldGlyphConsumer node)
inline

Definition at line 472 of file qsgadaptationlayer_p.h.

Referenced by QSGDistanceFieldGlyphNode::setGlyphs().

+ Here is the caller graph for this function:

◆ registerOwnerElement()

void QSGDistanceFieldGlyphCache::registerOwnerElement ( QQuickItem ownerElement)
virtual

Definition at line 236 of file qsgadaptationlayer.cpp.

References Q_UNUSED.

Referenced by QSGDistanceFieldGlyphNode::setGlyphs().

+ Here is the caller graph for this function:

◆ release()

void QSGDistanceFieldGlyphCache::release ( const QVector< glyph_t > &  glyphs)

Definition at line 131 of file qsgadaptationlayer.cpp.

References QList< T >::at(), glyphData(), i, QSet< T >::insert(), QSGDistanceFieldGlyphCache::TexCoord::isNull(), QSGDistanceFieldGlyphCache::GlyphData::ref, releaseGlyphs(), QList< T >::size(), and QSGDistanceFieldGlyphCache::GlyphData::texCoord.

Referenced by QSGDistanceFieldGlyphNode::~QSGDistanceFieldGlyphNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ releaseGlyphs()

virtual void QSGDistanceFieldGlyphCache::releaseGlyphs ( const QSet< glyph_t > &  glyphs)
protectedpure virtual

Implemented in QSGRhiDistanceFieldGlyphCache.

Referenced by release().

+ Here is the caller graph for this function:

◆ removeGlyph()

void QSGDistanceFieldGlyphCache::removeGlyph ( glyph_t  glyph)
inlineprotected

Definition at line 549 of file qsgadaptationlayer_p.h.

References glyphData(), QSGDistanceFieldGlyphCache::GlyphData::texCoord, and QSGDistanceFieldGlyphCache::GlyphData::texture.

Referenced by QSGRhiDistanceFieldGlyphCache::requestGlyphs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderTypeQuality()

int QSGDistanceFieldGlyphCache::renderTypeQuality ( ) const
inline

Definition at line 461 of file qsgadaptationlayer_p.h.

◆ requestGlyphs()

virtual void QSGDistanceFieldGlyphCache::requestGlyphs ( const QSet< glyph_t > &  glyphs)
protectedpure virtual

Implemented in QSGRhiDistanceFieldGlyphCache.

Referenced by populate().

+ Here is the caller graph for this function:

◆ screenSpaceDerivativesSupported()

virtual bool QSGDistanceFieldGlyphCache::screenSpaceDerivativesSupported ( ) const
pure virtual

◆ setGlyphsPosition()

◆ setGlyphsTexture()

void QSGDistanceFieldGlyphCache::setGlyphsTexture ( const QVector< glyph_t > &  glyphs,
const Texture tex 
)
protected

Definition at line 251 of file qsgadaptationlayer.cpp.

References QList< T >::append(), QList< T >::at(), QIntrusiveList< N, member >::begin(), QIntrusiveList< N, member >::end(), glyphData(), i, QList< T >::isEmpty(), iter, j, QList< T >::size(), QSGDistanceFieldGlyphCache::Texture::size, and QSGDistanceFieldGlyphCache::GlyphData::texture.

Referenced by QSGRhiDistanceFieldGlyphCache::storeGlyphs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeGlyphs()

virtual void QSGDistanceFieldGlyphCache::storeGlyphs ( const QList< QDistanceField > &  glyphs)
protectedpure virtual

Implemented in QSGRhiDistanceFieldGlyphCache.

Referenced by update().

+ Here is the caller graph for this function:

◆ unregisterGlyphNode()

void QSGDistanceFieldGlyphCache::unregisterGlyphNode ( QSGDistanceFieldGlyphConsumer node)
inline

Definition at line 473 of file qsgadaptationlayer_p.h.

Referenced by QSGDistanceFieldGlyphNode::~QSGDistanceFieldGlyphNode(), and QSGDistanceFieldGlyphNode::setGlyphs().

+ Here is the caller graph for this function:

◆ unregisterOwnerElement()

void QSGDistanceFieldGlyphCache::unregisterOwnerElement ( QQuickItem ownerElement)
virtual

Definition at line 241 of file qsgadaptationlayer.cpp.

References Q_UNUSED.

Referenced by QSGDistanceFieldGlyphNode::~QSGDistanceFieldGlyphNode(), and QSGDistanceFieldGlyphNode::setGlyphs().

+ Here is the caller graph for this function:

◆ update()

◆ updateRhiTexture()

void QSGDistanceFieldGlyphCache::updateRhiTexture ( QRhiTexture oldTex,
QRhiTexture newTex,
const QSize newTexSize 
)
protected

Member Data Documentation

◆ m_doubleGlyphResolution

bool QSGDistanceFieldGlyphCache::m_doubleGlyphResolution
protected

Definition at line 522 of file qsgadaptationlayer_p.h.

Referenced by baseFontSize(), glyphData(), setGlyphsPosition(), and update().

◆ m_referenceFont

QRawFont QSGDistanceFieldGlyphCache::m_referenceFont
protected

Definition at line 526 of file qsgadaptationlayer_p.h.

Referenced by glyphData(), and update().

◆ m_renderTypeQuality

int QSGDistanceFieldGlyphCache::m_renderTypeQuality
protected

Definition at line 523 of file qsgadaptationlayer_p.h.

Referenced by baseFontSize().


The documentation for this class was generated from the following files: