68 const int matrixCount =
qMin(
state.projectionMatrixCount(), newEffect->viewCount());
71 float matrixScale = 0.0f;
72 if (
state.isMatrixDirty()) {
73 for (
int viewIndex = 0; viewIndex < matrixCount; ++viewIndex) {
75 memcpy(
buf->data() +
offset + viewIndex * 64,
m.constData(), 64);
79 memcpy(
buf->data() +
offset + matrixCount * 64, &matrixScale, 4);
83 offset += matrixCount * 64 + 4;
85 if (
state.isOpacityDirty()) {
86 const float opacity =
state.opacity();
87 memcpy(
buf->data() +
offset, &opacity, 4);
95 QSGCurveFillNode *newNode = newMaterial !=
nullptr ? newMaterial->node() :
nullptr;
96 QSGCurveFillNode *oldNode = oldMaterial !=
nullptr ? oldMaterial->node() :
nullptr;
98 if (newNode ==
nullptr)
101 if (oldNode ==
nullptr || oldNode->debug() != newNode->
debug()) {
117 oldNode->color().greenF(),
118 oldNode->color().blueF(),
119 oldNode->color().alphaF())
122 if (oldNode ==
nullptr || oldColor != newColor) {
123 memcpy(
buf->data() +
offset, &newColor, 16);
131 if (!oldNode || *oldNode->fillTransform() != *newNode->
fillTransform()) {
143 QVector2D oldGradientStart = oldNode !=
nullptr
147 if (newGradientStart != oldGradientStart || oldEffect ==
nullptr) {
148 memcpy(
buf->data() +
offset, &newGradientStart, 8);
154 QVector2D oldGradientEnd = oldNode!=
nullptr
158 if (newGradientEnd != oldGradientEnd || oldEffect ==
nullptr) {
159 memcpy(
buf->data() +
offset, &newGradientEnd, 8);
168 QVector2D oldFocalPoint = oldNode !=
nullptr
171 if (oldNode ==
nullptr || newFocalPoint != oldFocalPoint) {
172 memcpy(
buf->data() +
offset, &newFocalPoint, 8);
178 QVector2D oldCenterPoint = oldNode !=
nullptr
182 QVector2D newCenterToFocal = newCenterPoint - newFocalPoint;
183 QVector2D oldCenterToFocal = oldCenterPoint - oldFocalPoint;
184 if (oldNode ==
nullptr || newCenterToFocal != oldCenterToFocal) {
185 memcpy(
buf->data() +
offset, &newCenterToFocal, 8);
191 float oldCenterRadius = oldNode !=
nullptr
192 ? oldNode->fillGradient()->v0
194 if (oldNode ==
nullptr || !
qFuzzyCompare(newCenterRadius, oldCenterRadius)) {
195 memcpy(
buf->data() +
offset, &newCenterRadius, 4);
201 float oldFocalRadius = oldNode !=
nullptr
202 ? oldNode->fillGradient()->v1
204 if (oldNode ==
nullptr || !
qFuzzyCompare(newFocalRadius, oldFocalRadius)) {
205 memcpy(
buf->data() +
offset, &newFocalRadius, 4);
214 QVector2D oldFocalPoint = oldNode !=
nullptr
217 if (oldNode ==
nullptr || newFocalPoint != oldFocalPoint) {
218 memcpy(
buf->data() +
offset, &newFocalPoint, 8);
224 float oldAngle = oldNode !=
nullptr
225 ? oldNode->fillGradient()->v0
227 if (oldNode ==
nullptr || !
qFuzzyCompare(newAngle, oldAngle)) {
229 memcpy(
buf->data() +
offset, &newAngle, 4);