2023-12-17 16:32:07 +00:00
|
|
|
/******************************************************************************
|
2024-01-17 13:31:45 +00:00
|
|
|
* QSkinny - Copyright (C) The authors
|
2023-12-17 16:32:07 +00:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_SCENE_TEXTURE_H
|
|
|
|
#define QSK_SCENE_TEXTURE_H
|
|
|
|
|
|
|
|
#include "QskGlobal.h"
|
|
|
|
#include <qsgtexture.h>
|
|
|
|
|
|
|
|
class QskSceneTexturePrivate;
|
|
|
|
|
|
|
|
class QSGRootNode;
|
|
|
|
class QSGTransformNode;
|
|
|
|
class QQuickWindow;
|
|
|
|
|
|
|
|
class QSK_EXPORT QskSceneTexture : public QSGTexture
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
using Inherited = QSGTexture;
|
|
|
|
|
|
|
|
public:
|
|
|
|
QskSceneTexture( const QQuickWindow* );
|
|
|
|
~QskSceneTexture();
|
|
|
|
|
|
|
|
void render( const QSGRootNode*, const QSGTransformNode*, const QRectF& );
|
|
|
|
|
|
|
|
QSize textureSize() const override;
|
|
|
|
|
2023-12-22 12:52:01 +00:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
|
|
|
void bind() override;
|
|
|
|
int textureId() const override;
|
|
|
|
#else
|
2023-12-17 16:32:07 +00:00
|
|
|
qint64 comparisonKey() const override;
|
|
|
|
QRhiTexture* rhiTexture() const override;
|
2023-12-22 12:52:01 +00:00
|
|
|
#endif
|
2023-12-17 16:32:07 +00:00
|
|
|
|
|
|
|
QRectF normalizedTextureSubRect() const override;
|
|
|
|
|
|
|
|
// satisfy the QSGTexture API
|
|
|
|
bool hasAlphaChannel() const override;
|
|
|
|
bool hasMipmaps() const override;
|
2023-12-22 12:52:01 +00:00
|
|
|
|
|
|
|
bool isDirty() const;
|
2023-12-17 16:32:07 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void updateRequested();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE( QskSceneTexture )
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|