30 QSGRhiDistanceFieldGlyphCache(QSGDefaultRenderContext *rc,
const QRawFont &font,
int renderTypeQuality);
31 virtual ~QSGRhiDistanceFieldGlyphCache();
33 void requestGlyphs(
const QSet<glyph_t> &glyphs) override;
34 void storeGlyphs(
const QList<QDistanceField> &glyphs) override;
35 void referenceGlyphs(
const QSet<glyph_t> &glyphs) override;
36 void releaseGlyphs(
const QSet<glyph_t> &glyphs) override;
38 bool useTextureResizeWorkaround()
const;
39 bool createFullSizeTextures()
const;
40 bool isActive()
const override;
41 int maxTextureSize()
const;
43 void setMaxTextureCount(
int max) { m_maxTextureCount = max; }
44 int maxTextureCount()
const {
return m_maxTextureCount; }
46 void commitResourceUpdates(QRhiResourceUpdateBatch *mergeInto);
48 bool eightBitFormatIsAlphaSwizzled()
const override;
49 bool screenSpaceDerivativesSupported()
const override;
51#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
52 void saveTexture(QRhiTexture *texture,
const QString &nameBase)
const override;
56 bool loadPregeneratedCache(
const QRawFont &font);
64 QVarLengthArray<QRhiTextureUploadEntry, 16> uploads;
66 TextureInfo(
const QRect &preallocRect = QRect()) : texture(
nullptr), allocatedArea(preallocRect) { }
69 void createTexture(TextureInfo *texInfo,
int width,
int height,
const void *pixels);
70 void createTexture(TextureInfo *texInfo,
int width,
int height);
71 void resizeTexture(TextureInfo *texInfo,
int width,
int height);
73 TextureInfo *textureInfo(
int index)
75 for (
int i = m_textures.size(); i <= index; ++i) {
76 if (createFullSizeTextures())
77 m_textures.append(QRect(0, 0, maxTextureSize(), maxTextureSize()));
79 m_textures.append(TextureInfo());
82 return &m_textures[index];
85 QSGDefaultRenderContext *m_rc;
87 mutable int m_maxTextureSize = 0;
88 int m_maxTextureCount = 3;
89 QSGAreaAllocator *m_areaAllocator =
nullptr;
90 QList<TextureInfo> m_textures;
91 QHash<glyph_t, TextureInfo *> m_glyphsTexture;
92 QSet<glyph_t> m_unusedGlyphs;
93 QSet<glyph_t> m_referencedGlyphs;
94 QSet<QRhiTexture *> m_pendingDispose;
DistanceFieldAnisotropicOutlineTextMaterialRhiShader(bool alphaTexture, int viewCount)
DistanceFieldAnisotropicShiftedTextMaterialRhiShader(bool alphaTexture, int viewCount)
DistanceFieldAnisotropicTextMaterialRhiShader(bool alphaTexture, int viewCount)
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
DistanceFieldOutlineTextMaterialRhiShader(bool alphaTexture, int viewCount)
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
DistanceFieldShiftedStyleTextMaterialRhiShader(bool alphaTexture, int viewCount)
DistanceFieldStyledTextMaterialRhiShader(bool alphaTexture, int viewCount)
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
void updateSampledImage(RenderState &state, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
QSGDistanceFieldTextMaterialRhiShader(bool alphaTexture, int viewCount)
QSGHiQSubPixelDistanceFieldTextMaterialRhiShader(bool alphaTexture, int viewCount)
bool updateGraphicsPipelineState(RenderState &state, GraphicsPipelineState *ps, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to enable the material to provide a custom set of graphics...
bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
QSGLoQSubPixelDistanceFieldTextMaterialRhiShader(bool alphaTexture, int viewCount)