2018-10-04 16:15:42 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_PAINTED_NODE_H
|
|
|
|
#define QSK_PAINTED_NODE_H
|
|
|
|
|
|
|
|
#include "QskTextureRenderer.h"
|
2022-05-31 17:56:49 +02:00
|
|
|
#include <qsgnode.h>
|
2018-10-04 16:15:42 +02:00
|
|
|
|
2022-05-31 17:56:49 +02:00
|
|
|
class QSK_EXPORT QskPaintedNode : public QSGNode
|
2018-10-04 16:15:42 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
QskPaintedNode();
|
|
|
|
~QskPaintedNode() override;
|
|
|
|
|
2020-11-01 15:44:15 +01:00
|
|
|
void update( QQuickWindow*,
|
2022-05-31 17:56:49 +02:00
|
|
|
QskTextureRenderer::RenderMode, const QRectF& );
|
2018-10-04 16:15:42 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paint( QPainter*, const QSizeF& ) = 0;
|
|
|
|
|
|
|
|
// a hash value of '0' always results in repainting
|
2022-03-25 10:28:06 +01:00
|
|
|
virtual QskHashValue hash() const = 0;
|
2018-10-04 16:15:42 +02:00
|
|
|
|
|
|
|
private:
|
2022-05-31 17:56:49 +02:00
|
|
|
void updateImageNode( QQuickWindow*, const QRectF& );
|
|
|
|
void updateImageNodeGL( QQuickWindow*, const QRectF& );
|
2018-10-04 16:15:42 +02:00
|
|
|
|
2022-05-31 17:56:49 +02:00
|
|
|
uint32_t createTexture( QQuickWindow*, const QSize& );
|
2018-10-04 16:15:42 +02:00
|
|
|
|
2022-03-25 10:28:06 +01:00
|
|
|
QskHashValue m_hash;
|
2018-10-04 16:15:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|