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
qsgsoftwareinternalimagenode_p.h
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#ifndef QSGSOFTWAREINTERNALIMAGENODE_H
5#define QSGSOFTWAREINTERNALIMAGENODE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qsgadaptationlayer_p.h>
19#include <private/qsgtexturematerial_p.h>
20
21#include <QtCore/QPointer>
22
24
25namespace QSGSoftwareHelpers {
26
27typedef QVarLengthArray<QPainter::PixmapFragment, 16> QPixmapFragmentsArray;
28
30{
31 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
32 : horizontal(horizontalRule), vertical(verticalRule) {}
37};
38
39#ifndef Q_QDOC
40// For internal use only.
62#endif
63
64void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins,
65 const QPixmap &pixmap, const QRect &sourceRect,const QMargins &sourceMargins,
66 const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints);
67
68} // QSGSoftwareHelpers namespace
69
71{
72public:
74
75 void setTargetRect(const QRectF &rect) override;
76 void setInnerTargetRect(const QRectF &rect) override;
77 void setInnerSourceRect(const QRectF &rect) override;
78 void setSubSourceRect(const QRectF &rect) override;
79 void setTexture(QSGTexture *texture) override;
80 void setMirror(bool mirrorHorizontally, bool mirrorVertically) override;
81 void setMipmapFiltering(QSGTexture::Filtering filtering) override;
82 void setFiltering(QSGTexture::Filtering filtering) override;
83 void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) override;
84 void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) override;
85 void update() override;
86
87 void preprocess() override;
88
89 void paint(QPainter *painter);
90
91 QRectF rect() const;
92
93 const QPixmap &pixmap() const;
94private:
95
96 QRectF m_targetRect;
97 QRectF m_innerTargetRect;
98 QRectF m_innerSourceRect;
99 QRectF m_subSourceRect;
100
101 QPointer<QSGTexture> m_texture;
102 QPixmap m_cachedMirroredPixmap;
103
104 bool m_mirrorHorizontally;
105 bool m_mirrorVertically;
106 bool m_textureIsLayer;
107 bool m_smooth;
108 bool m_tileHorizontal;
109 bool m_tileVertical;
110 bool m_cachedMirroredPixmapIsDirty;
111};
112
114
115#endif // QSGSOFTWAREINTERNALIMAGENODE_H
\inmodule QtCore
Definition qmargins.h:24
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
void setInnerSourceRect(const QRectF &rect) override
void setTexture(QSGTexture *texture) override
void setSubSourceRect(const QRectF &rect) override
void preprocess() override
Override this function to do processing on the node before it is rendered.
void setTargetRect(const QRectF &rect) override
void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) override
void setInnerTargetRect(const QRectF &rect) override
void setMirror(bool mirrorHorizontally, bool mirrorVertically) override
void setMipmapFiltering(QSGTexture::Filtering filtering) override
void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) override
void setFiltering(QSGTexture::Filtering filtering) override
\inmodule QtQuick
Definition qsgtexture.h:20
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
Definition qsgtexture.h:34
WrapMode
Specifies how the sampler should treat texture coordinates.
Definition qsgtexture.h:28
QPainter paint
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)
QVarLengthArray< QPainter::PixmapFragment, 16 > QPixmapFragmentsArray
Combined button and popup list for selecting options.
TileRule
Definition qnamespace.h:133
@ StretchTile
Definition qnamespace.h:134
DBusConnection const char * rule
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
GLenum GLuint texture
widget render & pixmap
QPainter painter(this)
[7]
QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
QTileRules(Qt::TileRule rule=Qt::StretchTile)
The QTileRules class provides the rules used to draw a pixmap or image split into nine segments.
Definition qdrawutil.h:88