24 a.tupleSize = tupleSize;
25 a.type = primitiveType;
27 a.attributeType = attributeType;
389 , m_index_data_offset(-1)
437 delete m_server_data;
477 return m_index_data_offset < 0
479 : ((
char *) m_data + m_index_data_offset);
489 return m_index_data_offset < 0
491 : ((
char *) m_data + m_index_data_offset);
540 m_drawing_mode =
mode;
582 m_line_width =
width;
618 bool canUsePrealloc = m_index_count <= 0;
619 int vertexByteSize = m_attributes.
stride * m_vertex_count;
624 if (canUsePrealloc && vertexByteSize <= (
int)
sizeof(m_prealloc)) {
625 m_data = (
void *) &m_prealloc[0];
626 m_index_data_offset = -1;
631 m_data = (
void *) malloc(vertexByteSize + indexByteSize);
633 m_index_data_offset = vertexByteSize;
660 v[1].x =
rect.left();
661 v[1].y =
rect.bottom();
663 v[2].x =
rect.right();
666 v[3].x =
rect.right();
667 v[3].y =
rect.bottom();
684 v[0].tx = textureRect.
left();
685 v[0].ty = textureRect.
top();
687 v[1].x =
rect.left();
688 v[1].y =
rect.bottom();
689 v[1].tx = textureRect.
left();
690 v[1].ty = textureRect.
bottom();
692 v[2].x =
rect.right();
694 v[2].tx = textureRect.
right();
695 v[2].ty = textureRect.
top();
697 v[3].x =
rect.right();
698 v[3].y =
rect.bottom();
699 v[3].tx = textureRect.
right();
700 v[3].ty = textureRect.
bottom();
715 v[1].x =
rect.left();
716 v[1].y =
rect.bottom();
718 v[2].x =
rect.right();
721 v[3].x =
rect.right();
722 v[3].y =
rect.bottom();
784 m_index_usage_pattern =
p;
808 m_vertex_usage_pattern =
p;
824 m_dirty_index_data =
true;
839 m_dirty_vertex_data =
true;
\inmodule QtCore\reentrant
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom 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.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
virtual ~QSGGeometry()
Destroys the geometry object and the vertex and index data it has allocated.
DataPattern
The DataPattern enum is used to specify the use pattern for the vertex and index data in a geometry o...
static const AttributeSet & defaultAttributes_Point2D()
Convenience function which returns attributes to be used for 2D solid color drawing.
static const AttributeSet & defaultAttributes_ColoredPoint2D()
Convenience function which returns attributes to be used for per vertex colored 2D drawing.
void setDrawingMode(unsigned int mode)
Sets the mode to be used for drawing this geometry.
static const AttributeSet & defaultAttributes_TexturedPoint2D()
Convenience function which returns attributes to be used for textured 2D drawing.
static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect)
Updates the geometry g with the coordinates in rect and texture coordinates from textureRect.
static void updateRectGeometry(QSGGeometry *g, const QRectF &rect)
Updates the geometry g with the coordinates in rect.
AttributeType
This enum identifies several attribute types.
void markVertexDataDirty()
Mark that the vertices in this geometry has changed and must be uploaded again.
const Attribute * attributes() const
Returns an array with the attributes of this geometry.
void * indexData()
Returns a pointer to the raw index data of this geometry object.
int indexType() const
Returns the primitive type used for indices in this geometry object.
void allocate(int vertexCount, int indexCount=0)
Resizes the vertex and index data of this geometry object to fit vertexCount vertices and indexCount ...
void setVertexDataPattern(DataPattern p)
Sets the usage pattern for vertices to p.
void setIndexDataPattern(DataPattern p)
Sets the usage pattern for indices to p.
int indexCount() const
Returns the number of indices in this geometry object.
void setLineWidth(float w)
Sets the line or point width to be used for this geometry to width.
void markIndexDataDirty()
Mark that the vertices in this geometry has changed and must be uploaded again.
QSGGeometry(const QSGGeometry::AttributeSet &attribs, int vertexCount, int indexCount=0, int indexType=UnsignedShortType)
Constructs a geometry object based on attributes.
static void updateColoredRectGeometry(QSGGeometry *g, const QRectF &rect)
Updates the geometry g with the coordinates in rect.
float lineWidth() const
Gets the current line or point width or to be used for this geometry.
int vertexCount() const
Returns the number of vertices in this geometry object.
Combined button and popup list for selecting options.
static struct AttrInfo attrs[]
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Q_CHECK_PTR(a=new int[80])
The QSGGeometry::AttributeSet describes how the vertices in a QSGGeometry are built up.
The QSGGeometry::Attribute describes a single vertex attribute in a QSGGeometry.
static Attribute create(int pos, int tupleSize, int primitiveType, bool isPosition=false)
Creates a new QSGGeometry::Attribute for attribute register pos with tupleSize.
static Attribute createWithAttributeType(int pos, int tupleSize, int primitiveType, AttributeType attributeType)
Creates a new QSGGeometry::Attribute for attribute register pos with tupleSize.
The QSGGeometry::ColoredPoint2D struct is a convenience struct for accessing 2D Points with a color.
The QSGGeometry::Point2D struct is a convenience struct for accessing 2D Points.
The QSGGeometry::TexturedPoint2D struct is a convenience struct for accessing 2D Points with texture ...