5#include <QtQuick/qsggeometry.h>
9#include <QtQuick/private/qsgbasicinternalimagenode_p.h>
57 const int attrCount = attributes.
size();
66 if (positionIndex != 0) {
73 if (positionIndex == -1 || texCoordIndex == -1) {
75 if (positionIndex == -1) {
79 if (texCoordIndex == -1) {
87 m_log =
QLatin1String(
"Error: Too many attributes specified.");
92 *posIndex = positionIndex;
100 int vmesh = m_resolution.
height();
101 int hmesh = m_resolution.
width();
104 Q_ASSERT(attrCount == 1 || attrCount == 2);
108 (vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2),
112 geometry->
allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2));
117 for (
int iy = 0; iy <= vmesh; ++iy) {
118 float fy = iy / float(vmesh);
119 float y = float(dstRect.
top()) + fy * float(dstRect.
height());
120 float ty = float(srcRect.
top()) + fy * float(srcRect.
height());
121 for (
int ix = 0; ix <= hmesh; ++ix) {
122 float fx = ix / float(hmesh);
123 for (
int ia = 0; ia < attrCount; ++ia) {
124 if (ia == posIndex) {
125 vdata->
x = float(dstRect.
left()) + fx * float(dstRect.
width());
129 vdata->
x = float(srcRect.
left()) + fx * float(srcRect.
width());
139 for (
int iy = 0; iy < vmesh; ++iy) {
141 for (
int ix = 0; ix <= hmesh; ++ix, ++
i) {
207 if (
res == m_resolution)
209 if (
res.width() < 1 ||
res.height() < 1) {
306 1, &targetRect, &innerTargetRect, &innerSourceRect, &subSourceRect);
308 QRectF sourceRect = srcRect;
309 QRectF modifiedInnerSourceRect(sourceRect.
x() + innerSourceRect.
x() * sourceRect.
width(),
310 sourceRect.
y() + innerSourceRect.
y() * sourceRect.
height(),
315 modifiedInnerSourceRect, subSourceRect, geometry);
388 return m_horizontalTileMode;
393 if (
t == m_horizontalTileMode)
395 m_horizontalTileMode =
t;
402 return m_verticalTileMode;
407 if (
t == m_verticalTileMode)
410 m_verticalTileMode =
t;
417#include "moc_qquickshadereffectmesh_p.cpp"
qsizetype size() const noexcept
TileMode horizontalTileMode
void setSize(const QSize &size)
void setVerticalTileMode(TileMode)
bool validateAttributes(const QVector< QByteArray > &attributes, int *posIndex) override
TileMode verticalTileMode
void verticalTileModeChanged()
void horizontalTileModeChanged()
QQuickBorderImageMesh(QObject *parent=nullptr)
\qmltype BorderImageMesh \instantiates QQuickBorderImageMesh \inqmlmodule QtQuick
QSGGeometry * updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, const QRectF &srcRect, const QRectF &rect) override
void setHorizontalTileMode(TileMode)
static void calculateRects(const QQuickScaleGrid *border, const QSize &sourceSize, const QSizeF &targetSize, int horizontalTileMode, int verticalTileMode, qreal devicePixelRatio, QRectF *targetRect, QRectF *innerTargetRect, QRectF *innerSourceRect, QRectF *subSourceRect)
QSGGeometry * updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, const QRectF &srcRect, const QRectF &rect) override
void setResolution(const QSize &res)
\qmlproperty size QtQuick::GridMesh::resolution
QQuickGridMesh(QObject *parent=nullptr)
\qmltype GridMesh \instantiates QQuickGridMesh \inqmlmodule QtQuick
bool validateAttributes(const QVector< QByteArray > &attributes, int *posIndex) override
The QQuickScaleGrid class allows you to specify a 3x3 grid to use in scaling an image.
QQuickShaderEffectMesh(QObject *parent=nullptr)
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
static const AttributeSet & defaultAttributes_Point2D()
Convenience function which returns attributes to be used for 2D solid color drawing.
static const AttributeSet & defaultAttributes_TexturedPoint2D()
Convenience function which returns attributes to be used for textured 2D drawing.
void allocate(int vertexCount, int indexCount=0)
Resizes the vertex and index data of this geometry object to fit vertexCount vertices and indexCount ...
void * vertexData()
Returns a pointer to the raw vertex data of this geometry object.
quint16 * indexDataAsUShort()
Convenience function to access the index data as a mutable array of 16-bit unsigned integers.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
void clear()
Clears the contents of the string and makes it null.
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum const void * indices
static QT_BEGIN_NAMESPACE const char qt_position_attribute_name[]
const char * qtTexCoordAttributeName()
static const char qt_texcoord_attribute_name[]
const char * qtPositionAttributeName()
Q_QUICK_PRIVATE_EXPORT const char * qtTexCoordAttributeName()
QT_BEGIN_NAMESPACE Q_QUICK_PRIVATE_EXPORT const char * qtPositionAttributeName()
QLatin1StringView QLatin1String
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
The QSGGeometry::Point2D struct is a convenience struct for accessing 2D Points.
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent