17 if (
state.isMatrixDirty()) {
19 memcpy(
buf->data(),
m.constData(), 64);
22 memcpy(
buf->data()+64, &matrixScale, 4);
26 if (
state.isOpacityDirty()) {
27 const float opacity =
state.opacity();
28 memcpy(
buf->data() + 64 + 4, &opacity, 4);
37 auto *newNode = newMaterial !=
nullptr ? newMaterial->
node() :
nullptr;
38 auto *oldNode = oldMaterial !=
nullptr ? oldMaterial->node() :
nullptr;
40 if (newNode ==
nullptr)
43 QVector4D newStrokeColor(newNode->color().redF(),
44 newNode->color().greenF(),
45 newNode->color().blueF(),
46 newNode->color().alphaF());
47 QVector4D oldStrokeColor = oldNode !=
nullptr
49 oldNode->color().greenF(),
50 oldNode->color().blueF(),
51 oldNode->color().alphaF())
54 if (oldNode ==
nullptr || oldStrokeColor != newStrokeColor) {
55 memcpy(
buf->data() +
offset, &newStrokeColor, 16);
60 if (oldNode ==
nullptr || newNode->strokeWidth() != oldNode->strokeWidth()) {
61 float w = newNode->strokeWidth();
75 if (
node()->
color() != othernode->color())
76 return node()->
color().
rgb() < othernode->color().rgb() ? -1 : 1;
QRgb rgb() const noexcept
Returns the RGB value of the color.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
bool updateUniformData(RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
int compare(const QSGMaterial *other) const override
Compares this material to other and returns 0 if they are equal; -1 if this material should sort befo...
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
QQuickShapeStrokeNode * node() const
float strokeWidth() const
Encapsulates the current rendering state during a call to QSGMaterialShader::updateUniformData() and ...
The QSGMaterial class encapsulates rendering state for a shader program.
The QVector4D class represents a vector or vertex in 4D space.
Combined button and popup list for selecting options.
qfloat16 qSqrt(qfloat16 f)
constexpr T qAbs(const T &t)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLintptr offset