20 if (m_subSourceRectImage != 0)
21 vgDestroyImage(m_subSourceRectImage);
34 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
36 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
40 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
46 if (
image == VG_INVALID_HANDLE || !textureSize.
isValid())
52 vgTranslate(m_targetRect.
width(), 0.0f);
57 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER);
59 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_NONANTIALIASED);
62 if (m_innerTargetRect != m_targetRect) {
65 }
else if (m_tileHorizontal || m_tileVertical) {
68 float sx = m_targetRect.
width() / (m_subSourceRect.
width() * textureSize.
width());
80 if (m_subSourceRectImageDirty) {
81 if (m_subSourceRectImage != 0)
82 vgDestroyImage(m_subSourceRectImage);
84 m_subSourceRectImageDirty =
false;
88 if (sr == m_targetRect) {
92 float scaleX = m_targetRect.
width() / sr.
width();
94 vgTranslate(m_targetRect.
x(), m_targetRect.
y());
95 vgScale(scaleX, scaleY);
96 vgDrawImage(m_subSourceRectImage);
103 if (
rect == m_targetRect)
111 if (
rect == m_innerTargetRect)
113 m_innerTargetRect =
rect;
119 if (
rect == m_innerSourceRect)
121 m_innerSourceRect =
rect;
127 if (
rect == m_subSourceRect)
129 m_subSourceRect =
rect;
130 m_subSourceRectImageDirty =
true;
137 m_subSourceRectImageDirty =
true;
143 if (m_mirror != mirror) {
156 if (smooth == m_smooth)
166 if (tileHorizontal == m_tileHorizontal)
169 m_tileHorizontal = tileHorizontal;
176 if (tileVertical == m_tileVertical)
189 bool doDirty =
false;
190 QSGLayer *
t = qobject_cast<QSGLayer *>(m_texture);
192 doDirty =
t->updateTexture();
\inmodule QtCore\reentrant
\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.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
The QSGMaterial class encapsulates rendering state for a shader program.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setInnerTargetRect(const QRectF &rect) override
void setMirror(bool mirror) override
void setSubSourceRect(const QRectF &rect) override
void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) override
void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) override
void setTexture(QSGTexture *texture) override
void setMipmapFiltering(QSGTexture::Filtering filtering) override
void setFiltering(QSGTexture::Filtering filtering) override
~QSGOpenVGInternalImageNode()
QSGOpenVGInternalImageNode()
void setTargetRect(const QRectF &rect) override
void setInnerSourceRect(const QRectF &rect) override
void preprocess() override
Override this function to do processing on the node before it is rendered.
VGPaint opacityPaint() const
const QOpenVGMatrix & transform() const
virtual QSize textureSize() const =0
Returns the size of the texture in pixels.
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
WrapMode
Specifies how the sampler should treat texture coordinates.
virtual qint64 comparisonKey() const =0
Returns a key suitable for comparing textures.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
void qDrawBorderImage(VGImage image, const QSizeF &textureSize, const QRectF &targetRect, const QRectF &innerTargetRect, const QRectF &subSourceRect)
void qDrawTiled(VGImage image, const QSize imageSize, const QRectF &targetRect, const QPointF offset, float scaleX, float scaleY)
Combined button and popup list for selecting options.
GLenum GLuint GLintptr offset