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
QSG24BitTextMaskRhiShader Class Reference
+ Inheritance diagram for QSG24BitTextMaskRhiShader:
+ Collaboration diagram for QSG24BitTextMaskRhiShader:

Public Member Functions

 QSG24BitTextMaskRhiShader (QFontEngine::GlyphFormat glyphFormat, 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 updated.
 
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 state.
 
- Public Member Functions inherited from QSGTextMaskRhiShader
 QSGTextMaskRhiShader (QFontEngine::GlyphFormat glyphFormat, 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 updated.
 
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, typically in the form of combined image samplers.
 
- Public Member Functions inherited from QSGMaterialShader
 QSGMaterialShader ()
 Constructs a new QSGMaterialShader.
 
virtual ~QSGMaterialShader ()
 
Flags flags () const
 
void setFlag (Flags flags, bool on=true)
 Sets the flags on this material shader if on is true; otherwise clears the specified flags.
 
void setFlags (Flags flags)
 Sets the flags for this material shader.
 
int combinedImageSamplerCount (int binding) const
 Returns the number of elements in the combined image sampler variable at binding.
 

Additional Inherited Members

- Public Types inherited from QSGMaterialShader
enum  Flag { UpdatesGraphicsPipelineState = 0x0001 }
 Flag values to indicate special material properties. More...
 
enum  Stage { VertexStage , FragmentStage }
 
- Protected Member Functions inherited from QSGMaterialShader
 QSGMaterialShader (QSGMaterialShaderPrivate &dd)
 
void setShaderFileName (Stage stage, const QString &filename)
 Sets the filename for the shader for the specified stage.
 
void setShaderFileName (Stage stage, const QString &filename, int viewCount)
 Sets the filename for the shader for the specified stage.
 
void setShader (Stage stage, const QShader &shader)
 Sets the shader for the specified stage.
 
- Protected Attributes inherited from QSGTextMaskRhiShader
QFontEngine::GlyphFormat m_glyphFormat
 
quint32 m_currentUbufOffset
 

Detailed Description

Definition at line 164 of file qsgdefaultglyphnode_p.cpp.

Constructor & Destructor Documentation

◆ QSG24BitTextMaskRhiShader()

QSG24BitTextMaskRhiShader::QSG24BitTextMaskRhiShader ( QFontEngine::GlyphFormat glyphFormat,
int viewCount )
inline

Definition at line 167 of file qsgdefaultglyphnode_p.cpp.

References QSGMaterialShader::FragmentStage, QStringLiteral, QSGMaterialShader::setFlag(), QSGMaterialShader::setShaderFileName(), and QSGMaterialShader::UpdatesGraphicsPipelineState.

+ Here is the call graph for this function:

Member Function Documentation

◆ updateGraphicsPipelineState()

bool QSG24BitTextMaskRhiShader::updateGraphicsPipelineState ( RenderState & state,
GraphicsPipelineState * ps,
QSGMaterial * newMaterial,
QSGMaterial * oldMaterial )
overridevirtual

This function is called by the scene graph to enable the material to provide a custom set of graphics state.

The set of states that are customizable by material is limited to blending and related settings.

Note
This function is only called when the UpdatesGraphicsPipelineState flag was enabled via setFlags(). By default it is not set, and so this function is never called.

The return value must be true whenever a change was made to any of the members in ps.

Note
The contents of ps is not persistent between invocations of this function.

The current rendering state is passed from the scene graph.

The subclass specific state can be extracted from newMaterial. When oldMaterial is null, this shader was just activated.

Reimplemented from QSGMaterialShader.

Definition at line 200 of file qsgdefaultglyphnode_p.cpp.

References QSGMaterialShader::GraphicsPipelineState::blendConstant, QSGMaterialShader::GraphicsPipelineState::blendEnable, QSGMaterialShader::GraphicsPipelineState::dstColor, QColor::fromRgbF(), Q_UNUSED, QSGMaterialShader::GraphicsPipelineState::srcColor, and state.

+ Here is the call graph for this function:

◆ updateUniformData()

bool QSG24BitTextMaskRhiShader::updateUniformData ( RenderState & state,
QSGMaterial * newMaterial,
QSGMaterial * oldMaterial )
overridevirtual

This function is called by the scene graph to get the contents of the shader program's uniform buffer updated.

The implementation is not expected to perform any real graphics operations, it is merely responsible for copying data to the QByteArray returned from RenderState::uniformData(). The scene graph takes care of making that buffer visible in the shaders.

The current rendering state is passed from the scene graph. If the state indicates that any relevant state is dirty, the implementation must update the appropriate region in the buffer data that is accessible via RenderState::uniformData(). When a state, such as, matrix or opacity, is not dirty, there is no need to touch the corresponding region since the data is persistent.

The return value must be true whenever any change was made to the uniform data.

The subclass specific state, such as the color of a flat color material, should be extracted from newMaterial to update the relevant regions in the buffer accordingly.

oldMaterial can be used to minimize buffer changes (which are typically memcpy calls) when updating material states. When oldMaterial is null, this shader was just activated.

Reimplemented from QSGMaterialShader.

Definition at line 179 of file qsgdefaultglyphnode_p.cpp.

References QSGTextMaskRhiShader::m_currentUbufOffset, qsg_premultiply(), state, and QSGTextMaskRhiShader::updateUniformData().

+ Here is the call graph for this function:

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