8#include <private/qsgplaintexture_p.h>
13 : m_color(
QColor(255, 255, 255))
28 m_transformMode(NoTransform),
29 m_cachedMirroredPixmapIsDirty(
false)
47 m_cachedMirroredPixmapIsDirty =
true;
52 if (m_transformMode == transformNode)
55 m_transformMode = transformNode;
56 m_cachedMirroredPixmapIsDirty =
true;
63 if (m_cachedMirroredPixmapIsDirty)
64 updateCachedMirroredPixmap();
70 if (!m_cachedPixmap.
isNull()) {
73 const QPixmap &pm = pt->pixmap();
75 }
else if (
QSGSoftwareLayer *pt = qobject_cast<QSGSoftwareLayer *>(m_texture)) {
76 const QPixmap &pm = pt->pixmap();
78 }
else if (
QSGPlainTexture *pt = qobject_cast<QSGPlainTexture *>(m_texture)) {
79 const QImage &im = pt->image();
84void QSGSoftwareImageNode::updateCachedMirroredPixmap()
92 mirrorTransform = mirrorTransform.
scale(1, -1);
94 mirrorTransform = mirrorTransform.
scale(-1, 1);
95 m_cachedPixmap = pt->pixmap().
transformed(mirrorTransform);
96 }
else if (
QSGSoftwareLayer *pt = qobject_cast<QSGSoftwareLayer *>(m_texture)) {
99 mirrorTransform = mirrorTransform.
scale(1, -1);
101 mirrorTransform = mirrorTransform.
scale(-1, 1);
102 m_cachedPixmap = pt->pixmap().
transformed(mirrorTransform);
103 }
else if (
QSGPlainTexture *pt = qobject_cast<QSGPlainTexture *>(m_texture)) {
110 m_cachedMirroredPixmapIsDirty =
false;
123 qWarning() <<
"Image used with invalid texture format.";
142 if (m_pixelRatio == ratio)
145 m_pixelRatio = ratio;
152 if (m_margins == margins)
172 m_margins,
Qt::StretchTile, QSGSoftwareHelpers::QDrawBorderPixmap::DrawingHints{});
The QColor class provides colors based on RGB, HSV or CMYK values.
constexpr bool isNull() const noexcept
Returns true if all margins are is 0; otherwise returns false.
The QPainter class performs low-level painting on widgets and other paint devices.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
int height() const
Returns the height of the pixmap.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
int width() const
Returns the width of the pixmap.
QPixmap transformed(const QTransform &, Qt::TransformationMode mode=Qt::FastTransformation) const
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
\inmodule QtCore\reentrant
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
\inmodule QtCore\reentrant
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 paint(QPainter *painter)
void setTexture(QSGTexture *texture) override
Sets the texture of this image node to texture.
QSGTexture * texture() const override
Returns the texture for this image node.
void setTextureCoordinatesTransform(TextureCoordinatesTransformMode transformNode) override
Sets the method used to generate texture coordinates to mode.
void setDevicePixelRatio(qreal ratio) override
void paint(QPainter *painter)
void setTexture(QSGTexture *texture) override
QSGSoftwareNinePatchNode()
void setPadding(qreal left, qreal top, qreal right, qreal bottom) override
void setBounds(const QRectF &bounds) override
const QPixmap & pixmap() const
void paint(QPainter *painter)
QSGSoftwareRectangleNode()
void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMarginsIn, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMarginsIn, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
Combined button and popup list for selecting options.
int qRound(qfloat16 d) noexcept
GLdouble GLdouble GLdouble GLdouble top