Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgdefaultninepatchnode.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#include "
qsgdefaultninepatchnode_p.h
"
5
6
QT_BEGIN_NAMESPACE
7
8
QSGDefaultNinePatchNode::QSGDefaultNinePatchNode
()
9
: m_geometry(
QSGGeometry
::defaultAttributes_TexturedPoint2D(), 4)
10
{
11
m_geometry.
setDrawingMode
(
QSGGeometry::DrawTriangleStrip
);
12
setGeometry
(&m_geometry);
13
setMaterial
(&m_material);
14
}
15
16
QSGDefaultNinePatchNode::~QSGDefaultNinePatchNode
()
17
{
18
delete
m_material.
texture
();
19
}
20
21
void
QSGDefaultNinePatchNode::setTexture
(
QSGTexture
*
texture
)
22
{
23
delete
m_material.
texture
();
24
m_material.
setTexture
(
texture
);
25
}
26
27
void
QSGDefaultNinePatchNode::setBounds
(
const
QRectF
&bounds)
28
{
29
m_bounds = bounds;
30
}
31
32
void
QSGDefaultNinePatchNode::setDevicePixelRatio
(
qreal
ratio)
33
{
34
m_devicePixelRatio = ratio;
35
}
36
37
void
QSGDefaultNinePatchNode::setPadding
(
qreal
left
,
qreal
top
,
qreal
right
,
qreal
bottom
)
38
{
39
m_padding =
QVector4D
(
left
,
top
,
right
,
bottom
);
40
}
41
42
void
QSGDefaultNinePatchNode::update
()
43
{
44
rebuildGeometry
(m_material.
texture
(), &m_geometry, m_padding, m_bounds, m_devicePixelRatio);
45
markDirty
(
QSGNode::DirtyGeometry
|
QSGNode::DirtyMaterial
);
46
}
47
48
QT_END_NAMESPACE
QRectF
\inmodule QtCore\reentrant
Definition
qrect.h:484
QSGBasicGeometryNode::setGeometry
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
Definition
qsgnode.cpp:764
QSGDefaultNinePatchNode::setTexture
void setTexture(QSGTexture *texture) override
Definition
qsgdefaultninepatchnode.cpp:21
QSGDefaultNinePatchNode::update
void update() override
Definition
qsgdefaultninepatchnode.cpp:42
QSGDefaultNinePatchNode::setBounds
void setBounds(const QRectF &bounds) override
Definition
qsgdefaultninepatchnode.cpp:27
QSGDefaultNinePatchNode::~QSGDefaultNinePatchNode
~QSGDefaultNinePatchNode()
Definition
qsgdefaultninepatchnode.cpp:16
QSGDefaultNinePatchNode::setDevicePixelRatio
void setDevicePixelRatio(qreal ratio) override
Definition
qsgdefaultninepatchnode.cpp:32
QSGDefaultNinePatchNode::setPadding
void setPadding(qreal left, qreal top, qreal right, qreal bottom) override
Definition
qsgdefaultninepatchnode.cpp:37
QSGDefaultNinePatchNode::QSGDefaultNinePatchNode
QSGDefaultNinePatchNode()
Definition
qsgdefaultninepatchnode.cpp:8
QSGGeometryNode::setMaterial
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
Definition
qsgnode.cpp:927
QSGGeometry
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
Definition
qsggeometry.h:15
QSGGeometry::setDrawingMode
void setDrawingMode(unsigned int mode)
Sets the mode to be used for drawing this geometry.
Definition
qsggeometry.cpp:538
QSGGeometry::DrawTriangleStrip
@ DrawTriangleStrip
Definition
qsggeometry.h:39
QSGNinePatchNode::rebuildGeometry
static void rebuildGeometry(QSGTexture *texture, QSGGeometry *geometry, const QVector4D &padding, const QRectF &bounds, qreal dpr)
Definition
qsgninepatchnode.cpp:41
QSGNode::DirtyMaterial
@ DirtyMaterial
Definition
qsgnode.h:75
QSGNode::DirtyGeometry
@ DirtyGeometry
Definition
qsgnode.h:74
QSGNode::markDirty
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
Definition
qsgnode.cpp:624
QSGOpaqueTextureMaterial::setTexture
void setTexture(QSGTexture *texture)
Sets the texture of this material to texture.
Definition
qsgtexturematerial.cpp:166
QSGOpaqueTextureMaterial::texture
QSGTexture * texture() const
Returns this texture material's texture.
Definition
qsgtexturematerial.h:22
QSGTexture
\inmodule QtQuick
Definition
qsgtexture.h:20
QVector4D
The QVector4D class represents a vector or vertex in 4D space.
Definition
qvectornd.h:330
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
top
GLdouble GLdouble GLdouble GLdouble top
Definition
qopengles2ext.h:3218
right
GLdouble GLdouble right
Definition
qopengles2ext.h:3218
left
GLint left
Definition
qopengles2ext.h:792
bottom
GLint GLint bottom
Definition
qopengles2ext.h:792
texture
GLenum GLuint texture
Definition
qopengles2ext.h:416
qsgdefaultninepatchnode_p.h
qreal
double qreal
Definition
qtypes.h:187
qtdeclarative
src
quick
scenegraph
util
qsgdefaultninepatchnode.cpp
Generated by
1.10.0