File indexing completed on 2024-05-05 16:07:15

0001 /*
0002     SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef MANAGEDTEXTURENODE_H
0008 #define MANAGEDTEXTURENODE_H
0009 
0010 #include "quickaddons_export.h"
0011 #include <QSGSimpleTextureNode>
0012 #include <QSGTexture>
0013 #include <QSharedPointer>
0014 #include <qglobal.h>
0015 
0016 #include "kdeclarative/kdeclarative_export.h"
0017 
0018 #if KDECLARATIVE_BUILD_DEPRECATED_SINCE(5, 101)
0019 
0020 /**
0021  * @class ManagedTextureNode managedtexturenode.h KQuickAddons/ManagedTextureNode
0022  *
0023  * @short Node that contains a reference counted texture
0024  *
0025  * Usually when assigning textures within a node, we'll want to delete the
0026  * texture with the node. This class will take a shared texture and display it
0027  * within the node.
0028  *
0029  * It's especially interesting to use this class together with the ImageTexturesCache
0030  * that will offer us shareable textures and cache them transparently, when asking
0031  * it to create the texture.
0032  *
0033  * @see ImageTexturesCache
0034  */
0035 
0036 class QUICKADDONS_EXPORT ManagedTextureNode : public QSGSimpleTextureNode
0037 {
0038     Q_DISABLE_COPY(ManagedTextureNode)
0039 public:
0040     ManagedTextureNode();
0041 
0042     void setTexture(QSharedPointer<QSGTexture> texture);
0043 
0044 private:
0045     QSharedPointer<QSGTexture> m_texture;
0046 };
0047 
0048 #endif
0049 #endif