29 QSGRhiDistanceFieldGlyphCache(QSGDefaultRenderContext *rc,
const QRawFont &font,
int renderTypeQuality);
30 virtual ~QSGRhiDistanceFieldGlyphCache();
32 void requestGlyphs(
const QSet<glyph_t> &glyphs) override;
33 void storeGlyphs(
const QList<QDistanceField> &glyphs) override;
34 void referenceGlyphs(
const QSet<glyph_t> &glyphs) override;
35 void releaseGlyphs(
const QSet<glyph_t> &glyphs) override;
37 bool useTextureResizeWorkaround()
const;
38 bool createFullSizeTextures()
const;
39 bool isActive()
const override;
40 int maxTextureSize()
const;
42 void setMaxTextureCount(
int max) { m_maxTextureCount = max; }
43 int maxTextureCount()
const {
return m_maxTextureCount; }
45 void commitResourceUpdates(QRhiResourceUpdateBatch *mergeInto);
47 bool eightBitFormatIsAlphaSwizzled()
const override;
48 bool screenSpaceDerivativesSupported()
const override;
50#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
51 void saveTexture(QRhiTexture *texture,
const QString &nameBase)
const override;
55 bool loadPregeneratedCache(
const QRawFont &font);
63 QVarLengthArray<QRhiTextureUploadEntry, 16> uploads;
65 TextureInfo(
const QRect &preallocRect = QRect()) : texture(
nullptr), allocatedArea(preallocRect) { }
68 void createTexture(TextureInfo *texInfo,
int width,
int height,
const void *pixels);
69 void createTexture(TextureInfo *texInfo,
int width,
int height);
70 void resizeTexture(TextureInfo *texInfo,
int width,
int height);
72 TextureInfo *textureInfo(
int index)
74 for (
int i = m_textures.size(); i <= index; ++i) {
75 if (createFullSizeTextures())
76 m_textures.append(QRect(0, 0, maxTextureSize(), maxTextureSize()));
78 m_textures.append(TextureInfo());
81 return &m_textures[index];
84 QSGDefaultRenderContext *m_rc;
86 mutable int m_maxTextureSize = 0;
87 int m_maxTextureCount = 3;
88 QSGAreaAllocator *m_areaAllocator =
nullptr;
89 QList<TextureInfo> m_textures;
90 QHash<glyph_t, TextureInfo *> m_glyphsTexture;
91 QSet<glyph_t> m_unusedGlyphs;
92 QSet<glyph_t> m_referencedGlyphs;
93 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)