2022-09-23 15:49:49 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
2023-04-06 07:23:37 +00:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2022-09-23 15:49:49 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_STROKE_NODE_H
|
|
|
|
#define QSK_STROKE_NODE_H
|
|
|
|
|
|
|
|
#include "QskGlobal.h"
|
|
|
|
#include <qsgnode.h>
|
|
|
|
|
|
|
|
class QPen;
|
|
|
|
class QPainterPath;
|
2023-05-02 16:04:23 +00:00
|
|
|
class QPolygonF;
|
2022-09-23 15:49:49 +00:00
|
|
|
|
|
|
|
class QskStrokeNodePrivate;
|
|
|
|
|
|
|
|
class QSK_EXPORT QskStrokeNode : public QSGGeometryNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QskStrokeNode();
|
|
|
|
|
2023-05-02 16:04:23 +00:00
|
|
|
/*
|
|
|
|
We only support monochrome pens ( QPen::color() ) and using a
|
|
|
|
QSGFlatColorMaterial is good enough. However QSGVertexColorMaterial
|
|
|
|
usually allows better batching. So Flat vs. Colored is a tradeoff
|
|
|
|
between memory and performance.
|
|
|
|
*/
|
|
|
|
enum RenderHint
|
|
|
|
{
|
|
|
|
Flat,
|
|
|
|
Colored
|
|
|
|
};
|
|
|
|
|
|
|
|
void setRenderHint( RenderHint );
|
|
|
|
RenderHint renderHint() const;
|
|
|
|
|
2022-09-29 15:26:15 +00:00
|
|
|
void updateNode( const QPainterPath&, const QTransform&, const QPen& );
|
2022-09-23 15:49:49 +00:00
|
|
|
|
2023-05-02 16:04:23 +00:00
|
|
|
void updateNode( const QPolygonF&, const QTransform&,
|
|
|
|
qreal lineWidth, const QColor& );
|
|
|
|
|
2022-09-23 15:49:49 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE( QskStrokeNode )
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|