5#include <private/qsgmaterialshader_p.h>
37 if (
state.isMatrixDirty()) {
39 memcpy(
buf->data(),
m.constData(), 64);
44 if (!oldMat ||
c != oldMat->
color() ||
state.isOpacityDirty()) {
46 c.getRgbF(&
r, &
g, &
b, &
a);
47 const float opacity =
state.opacity() *
a;
50 memcpy(
buf->data() + 64, &
v, 16);
FlatColorMaterialRhiShader()
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...
static QSGMaterialType type
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgba() const noexcept
Returns the RGB value of the color, including its alpha.
int alpha() const noexcept
Returns the alpha color component of this color.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
The QSGFlatColorMaterial class provides a convenient way of rendering solid colored geometry in the s...
QSGMaterialType * type() const override
void setColor(const QColor &color)
Sets this flat color material's color to color.
QSGFlatColorMaterial()
Constructs a new flat color material.
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
int compare(const QSGMaterial *other) const override
const QColor & color() const
Returns this flat color material's color.
Encapsulates the current rendering state during a call to QSGMaterialShader::updateUniformData() and ...
The QSGMaterialShader class represents a graphics API independent shader program.
void setShaderFileName(Stage stage, const QString &filename)
Sets the filename for the shader for the specified stage.
The QSGMaterial class encapsulates rendering state for a shader program.
virtual QSGMaterialType * type() const =0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
void setFlag(Flags flags, bool on=true)
Sets the flags flags on this material if on is true; otherwise clears the attribute.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
The QVector4D class represents a vector or vertex in 4D space.
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei const GLchar * buf
#define QStringLiteral(str)
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.