Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickshapesoftwarerenderer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKSHAPESOFTWARERENDERER_P_H
5#define QQUICKSHAPESOFTWARERENDERER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of a number of Qt sources files. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickShapes/private/qquickshapesglobal_p.h>
19#include <QtQuickShapes/private/qquickshape_p_p.h>
20#include <qsgrendernode.h>
21#include <QPen>
22#include <QBrush>
23
25
27
29{
30public:
31 enum Dirty {
32 DirtyPath = 0x01,
33 DirtyPen = 0x02,
35 DirtyBrush = 0x08,
36 DirtyList = 0x10
37 };
38
39 void beginSync(int totalCount, bool *countChanged) override;
40 void setPath(int index, const QQuickPath *path) override;
41 void setStrokeColor(int index, const QColor &color) override;
42 void setStrokeWidth(int index, qreal w) override;
43 void setFillColor(int index, const QColor &color) override;
44 void setFillRule(int index, QQuickShapePath::FillRule fillRule) override;
45 void setJoinStyle(int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit) override;
46 void setCapStyle(int index, QQuickShapePath::CapStyle capStyle) override;
48 qreal dashOffset, const QVector<qreal> &dashPattern) override;
49 void setFillGradient(int index, QQuickShapeGradient *gradient) override;
50 void setFillTransform(int index, const QSGTransform &transform) override;
51 void endSync(bool async) override;
52
53 void updateNode() override;
54
56
57private:
58 QQuickShapeSoftwareRenderNode *m_node = nullptr;
59 int m_accDirty = 0;
60 struct ShapePathGuiData {
61 int dirty = 0;
63 QPen pen;
64 float strokeWidth;
65 QColor fillColor;
67 Qt::FillRule fillRule;
68 };
69 QVector<ShapePathGuiData> m_sp;
70};
71
73{
74public:
77
78 void render(const RenderState *state) override;
79 void releaseResources() override;
80 StateFlags changedStates() const override;
81 RenderingFlags flags() const override;
82 QRectF rect() const override;
83
84private:
85 QQuickShape *m_item;
86
87 struct ShapePathRenderData {
89 QPen pen;
90 float strokeWidth;
92 };
93 QVector<ShapePathRenderData> m_sp;
94 QRectF m_boundingRect;
95
97};
98
100
101#endif // QQUICKSHAPESOFTWARERENDERER_P_H
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtGui
\inmodule QtGui
Definition qpen.h:28
RenderingFlags flags() const override
void releaseResources() override
This function is called when all custom graphics resources allocated by this node have to be freed im...
void render(const RenderState *state) override
This function is called by the renderer and should paint this node with directly invoking commands in...
StateFlags changedStates() const override
When the underlying rendering API is OpenGL, this function should return a mask where each bit repres...
void setStrokeColor(int index, const QColor &color) override
void setJoinStyle(int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit) override
void setFillColor(int index, const QColor &color) override
void setNode(QQuickShapeSoftwareRenderNode *node)
void setStrokeStyle(int index, QQuickShapePath::StrokeStyle strokeStyle, qreal dashOffset, const QVector< qreal > &dashPattern) override
void beginSync(int totalCount, bool *countChanged) override
void setCapStyle(int index, QQuickShapePath::CapStyle capStyle) override
void setPath(int index, const QQuickPath *path) override
void setFillGradient(int index, QQuickShapeGradient *gradient) override
void setFillRule(int index, QQuickShapePath::FillRule fillRule) override
void setStrokeWidth(int index, qreal w) override
void setFillTransform(int index, const QSGTransform &transform) override
\inmodule QtCore\reentrant
Definition qrect.h:484
The QSGRenderNode class represents a set of custom rendering commands targeting the graphics API that...
else opt state
[0]
Combined button and popup list for selecting options.
Definition brush.cpp:5
GLfloat GLfloat GLfloat w
[0]
GLuint index
[2]
GLuint color
[2]
GLuint GLenum GLenum transform
GLsizei const GLchar *const * path
double qreal
Definition qtypes.h:187
QGraphicsItem * item