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 QSGBASICINTERNALIMAGENODE_P_H
5#define QSGBASICINTERNALIMAGENODE_P_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
20QT_BEGIN_NAMESPACE
21
22class Q_QUICK_PRIVATE_EXPORT QSGBasicInternalImageNode : public QSGInternalImageNode
23{
24public:
25 QSGBasicInternalImageNode();
26
27 void setTargetRect(const QRectF &rect) override;
28 void setInnerTargetRect(const QRectF &rect) override;
29 void setInnerSourceRect(const QRectF &rect) override;
30 void setSubSourceRect(const QRectF &rect) override;
31 void setTexture(QSGTexture *texture) override;
32 void setAntialiasing(bool antialiasing) override;
33 void setMirror(bool mirrorHorizontally, bool mirrorVertically) override;
34 void update() override;
35 void preprocess() override;
36
37 static QSGGeometry *updateGeometry(const QRectF &targetRect,
38 const QRectF &innerTargetRect,
39 const QRectF &sourceRect,
40 const QRectF &innerSourceRect,
41 const QRectF &subSourceRect,
42 QSGGeometry *geometry,
43 bool mirrorHorizontally = false,
44 bool mirrorVertically = false,
45 bool antialiasing = false);
46
47protected:
48 virtual void updateMaterialAntialiasing() = 0;
49 virtual void setMaterialTexture(QSGTexture *texture) = 0;
50 virtual QSGTexture *materialTexture() const = 0;
51 virtual bool updateMaterialBlending() = 0;
52 virtual bool supportsWrap(const QSize &size) const = 0;
53
54 void updateGeometry();
55
56 QRectF m_targetRect;
57 QRectF m_innerTargetRect;
58 QRectF m_innerSourceRect;
59 QRectF m_subSourceRect;
60
61 uint m_antialiasing : 1;
62 uint m_mirrorHorizontally : 1;
63 uint m_mirrorVertically : 1;
64 uint m_dirtyGeometry : 1;
65
66 QSGGeometry m_geometry;
67
68 QSGDynamicTexture *m_dynamicTexture;
69 QSize m_dynamicTextureSize;
70 QRectF m_dynamicTextureSubRect;
71};
72
73QT_END_NAMESPACE
74
75#endif
76

source code of qtdeclarative/src/quick/scenegraph/qsgbasicinternalimagenode_p.h