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 QSGDEFAULTSPRITENODE_H |
5 | #define QSGDEFAULTSPRITENODE_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/qtquickglobal_p.h> |
19 | |
20 | QT_REQUIRE_CONFIG(quick_sprite); |
21 | |
22 | #include <private/qsgadaptationlayer_p.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | class QQuickSpriteMaterial; |
26 | class QSGDefaultSpriteNode : public QSGSpriteNode |
27 | { |
28 | public: |
29 | QSGDefaultSpriteNode(); |
30 | |
31 | void setTexture(QSGTexture *texture) override; |
32 | void setTime(float time) override; |
33 | void setSourceA(const QPoint &source) override; |
34 | void setSourceB(const QPoint &source) override; |
35 | void setSpriteSize(const QSize &size) override; |
36 | void setSheetSize(const QSize &size) override; |
37 | void setSize(const QSizeF &size) override; |
38 | void setFiltering(QSGTexture::Filtering filtering) override; |
39 | void update() override; |
40 | private: |
41 | void updateGeometry(); |
42 | |
43 | QQuickSpriteMaterial *m_material; |
44 | QSGGeometry *m_geometry; |
45 | bool m_geometryDirty; |
46 | QPoint m_sourceA; |
47 | QPoint m_sourceB; |
48 | QSize m_spriteSize; |
49 | QSize m_sheetSize; |
50 | QSizeF m_size; |
51 | }; |
52 | |
53 | QT_END_NAMESPACE |
54 | |
55 | #endif // QSGDEFAULTSPRITENODE_H |
56 |