qskinny/playground/parrots/SceneTexture.h

44 lines
1.1 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#pragma once
#include <qsgtexture.h>
class SceneTexturePrivate;
class QSGRenderContext;
class QSGRootNode;
class QSGTransformNode;
class SceneTexture : public QSGTexture
{
using Inherited = QSGTexture;
public:
SceneTexture( QSGRenderContext* );
~SceneTexture();
void setDevicePixelRatio( qreal );
void render( QSGRootNode*, QSGTransformNode*, const QRectF& );
QSize textureSize() const override;
qint64 comparisonKey() const override;
QRhiTexture* rhiTexture() const override;
QRectF normalizedTextureSubRect() const override;
bool isRendering() const;
private:
// satisfy the QSGTexture API
bool hasAlphaChannel() const override { return false; }
bool hasMipmaps() const override { return false; }
void commitTextureOperations( QRhi*, QRhiResourceUpdateBatch* ) override {}
Q_DECLARE_PRIVATE( SceneTexture )
};