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
qsgopenvginternalrectanglenode.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 QSGOPENVGINTERNALRECTANGLENODE_H
5#define QSGOPENVGINTERNALRECTANGLENODE_H
6
7#include <private/qsgadaptationlayer_p.h>
10
11#include <VG/openvg.h>
12
14
16{
17public:
20
21 void setRect(const QRectF &rect) override;
22 void setColor(const QColor &color) override;
23 void setPenColor(const QColor &color) override;
24 void setPenWidth(qreal width) override;
25 void setGradientStops(const QGradientStops &stops) override;
26 void setGradientVertical(bool vertical) override;
27 void setRadius(qreal radius) override;
28 void setAligned(bool aligned) override;
29 void update() override;
30
31 void render() override;
32 void setOpacity(float opacity) override;
33 void setTransform(const QOpenVGMatrix &transform) override;
34
35private:
36 void createVGResources();
37 void destroyVGResources();
38
39 void generateRectanglePath(const QRectF &rect, float radius, VGPath path) const;
40 void generateRectangleAndBorderPaths(const QRectF &rect, float penWidth, float radius, VGPath inside, VGPath outside) const;
41 void generateBorderPath(const QRectF &rect, float borderWidth, float borderHeight, float radius, VGPath path) const;
42
43 bool m_pathDirty = true;
44 bool m_fillDirty = true;
45 bool m_strokeDirty = true;
46
47 QRectF m_rect;
48 QColor m_fillColor;
49 QColor m_strokeColor;
50 qreal m_penWidth = 0.0;
51 qreal m_radius = 0.0;
52 bool m_aligned = false;
53 bool m_vertical = true;
54 QGradientStops m_gradientStops;
55
56 VGPath m_rectanglePath;
57 VGPath m_borderPath;
58 VGPaint m_rectanglePaint;
59 VGPaint m_borderPaint;
60
61 QOpenVGOffscreenSurface *m_offscreenSurface = nullptr;
62};
63
65
66#endif // QSGOPENVGINTERNALRECTANGLENODE_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore\reentrant
Definition qrect.h:484
void setTransform(const QOpenVGMatrix &transform) override
void setGradientStops(const QGradientStops &stops) override
void setRect(const QRectF &rect) override
void setPenColor(const QColor &color) override
void setColor(const QColor &color) override
rect
[4]
Combined button and popup list for selecting options.
GLint GLsizei width
GLuint color
[2]
GLuint GLenum GLenum transform
GLsizei const GLchar *const * path
Int aligned(Int v, Int byteAlign)
double qreal
Definition qtypes.h:187