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
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 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 406 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::get(), 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 550 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 451 of file qsgadaptationlayer_p.h.

References QT_DISTANCEFIELD_RADIUS(), and QT_DISTANCEFIELD_SCALE().

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

+ 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 456 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 447 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 455 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 emptyData(), m_doubleGlyphResolution, m_referenceFont, QTransform::mapRect(), 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 fontScale(), glyphData(), and QSGDistanceFieldGlyphCache::Metrics::width.

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 533 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 538 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 270 of file qsgadaptationlayer.cpp.

References QDataBuffer< Type >::add(), and i.

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 QSet< T >::contains(), glyphCount(), glyphData(), i, QSet< T >::insert(), qWarning, referenceGlyphs(), and requestGlyphs().

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 236 of file qsgadaptationlayer.cpp.

◆ referenceFont()

const QRawFont & QSGDistanceFieldGlyphCache::referenceFont ( ) const
inline

Definition at line 445 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 468 of file qsgadaptationlayer_p.h.

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 glyphData(), i, and releaseGlyphs().

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 543 of file qsgadaptationlayer_p.h.

References glyphData().

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 457 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()

void QSGDistanceFieldGlyphCache::setGlyphsPosition ( const QList< GlyphPosition > & glyphs)
protected

Definition at line 209 of file qsgadaptationlayer.cpp.

References QIntrusiveList< N, member >::begin(), QIntrusiveList< N, member >::end(), QSGDistanceFieldGlyphCache::GlyphPosition::glyph, glyphData(), i, iter, m_doubleGlyphResolution, QSGDistanceFieldGlyphCache::GlyphPosition::position, QT_DISTANCEFIELD_RADIUS(), QT_DISTANCEFIELD_SCALE(), QPointF::x(), and QPointF::y().

Referenced by QSGRhiDistanceFieldGlyphCache::requestGlyphs().

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

◆ setGlyphsTexture()

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

Definition at line 241 of file qsgadaptationlayer.cpp.

References QIntrusiveList< N, member >::begin(), QIntrusiveList< N, member >::end(), glyphData(), i, iter, j, and QSGDistanceFieldGlyphCache::Texture::size.

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 469 of file qsgadaptationlayer_p.h.

Referenced by QSGDistanceFieldGlyphNode::~QSGDistanceFieldGlyphNode().

+ Here is the caller graph for this function:

◆ update()

void QSGDistanceFieldGlyphCache::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 516 of file qsgadaptationlayer_p.h.

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

◆ m_referenceFont

QRawFont QSGDistanceFieldGlyphCache::m_referenceFont
protected

Definition at line 520 of file qsgadaptationlayer_p.h.

Referenced by glyphData(), and update().

◆ m_renderTypeQuality

int QSGDistanceFieldGlyphCache::m_renderTypeQuality
protected

Definition at line 517 of file qsgadaptationlayer_p.h.

Referenced by baseFontSize().


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