Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
64QT_END_NAMESPACE
65
66#endif // QSGOPENVGINTERNALRECTANGLENODE_H
QSurfaceFormat defaultSurfaceFormat() const override
QSGNinePatchNode * createNinePatchNode() override
QSGRenderContext * createRenderContext() override
QSGImageNode * createImageNode() override
QSGInternalRectangleNode * createInternalRectangleNode() override
QSGRectangleNode * createRectangleNode() override
QSGPainterNode * createPainterNode(QQuickPaintedItem *item) override
QSGOpenVGFontGlyphCache * cache(const QRawFont &font)
void insertCache(const QRawFont &font, QSGOpenVGFontGlyphCache *cache)
const QSGOpenVGFontGlyphCacheManager * manager() const
void populate(const QVector< quint32 > &glyphs)
void release(const QVector< quint32 > &glyphs)
QSGOpenVGFontGlyphCache(QSGOpenVGFontGlyphCacheManager *manager, const QRawFont &font)
const QRawFont & referenceFont() const
void setColor(const QColor &color) override
void setStyle(QQuickText::TextStyle style) override
QSGOpenVGGlyphNode(QSGRenderContext *rc)
void setStyleColor(const QColor &color) override
void setPreferredAntialiasingMode(AntialiasingMode) override
QPointF baseLine() const override
void setOpacity(float opacity) override
void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override
void setOwnsTexture(bool owns) override
Sets whether the node takes ownership of the texture to owns.
void setTexture(QSGTexture *texture) override
Sets the texture of this image node to texture.
QSGTexture::AnisotropyLevel anisotropyLevel() const override
Returns this image node's anistropy level.
bool ownsTexture() const override
void setAnisotropyLevel(QSGTexture::AnisotropyLevel level) override
Sets this image node's anistropy level to level.
void setFiltering(QSGTexture::Filtering filtering) override
Sets the filtering to be used for this image node to filtering.
void setRect(const QRectF &rect) override
Sets the target rect of this image node to rect.
TextureCoordinatesTransformMode textureCoordinatesTransform() const override
Returns the mode used to generate texture coordinates for this node.
void setMipmapFiltering(QSGTexture::Filtering) override
Sets the mipmap filtering to be used for this image node to filtering.
QSGTexture::Filtering mipmapFiltering() const override
Returns the mipmap filtering for this image node.
QSGTexture::Filtering filtering() const override
Returns the filtering for this image node.
QRectF rect() const override
Returns the target rect of this image node.
QSGTexture * texture() const override
Returns the texture for this image node.
void setSourceRect(const QRectF &r) override
Sets the source rect of this image node to rect.
QRectF sourceRect() const override
Returns the source rect of this image node.
void setTextureCoordinatesTransform(TextureCoordinatesTransformMode transformNode) override
Sets the method used to generate texture coordinates to mode.
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
void setDevicePixelRatio(qreal ratio) override
void setLive(bool live) override
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
QImage toImage() const override
void setMirrorVertical(bool mirror) override
bool updateTexture() override
Call this function to explicitly update the dynamic texture.
void invalidated() override
void setRecursive(bool recursive) override
void setFormat(uint format) override
void setRect(const QRectF &rect) override
QSize textureSize() const override
Returns the size of the texture in pixels.
void scheduleUpdate() override
void setMirrorHorizontal(bool mirror) override
void setItem(QSGNode *item) override
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
void setHasMipmaps(bool mipmap) override
qint64 comparisonKey() const override
Returns a key suitable for comparing textures.
void setSize(const QSize &size) override
void setSamples(int) override
void setTexture(QSGTexture *texture) override
void setBounds(const QRectF &bounds) override
void setDevicePixelRatio(qreal ratio) override
void setPadding(qreal left, qreal top, qreal right, qreal bottom) override
void setTextureSize(const QSize &size) override
QSGTexture * texture() const override
void setFillColor(const QColor &c) override
void setOpaquePainting(bool opaque) override
void setDirty(const QRect &dirtyRect) override
void setMipmapping(bool mipmapping) override
void setSmoothPainting(bool s) override
void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) override
void setLinearFiltering(bool linearFiltering) override
void setContentsScale(qreal s) override
QImage toImage() const override
void setSize(const QSize &size) override
QSGOpenVGPainterNode(QQuickPaintedItem *item)
void setFastFBOResizing(bool dynamic) override
QRectF rect() const override
Returns the rectangle that this rect node covers.
QColor color() const override
Returns the color of this rectangle.
void setRect(const QRectF &rect) override
Sets the rectangle of this rect node to rect.
void setTransform(const QOpenVGMatrix &transform) override
void setColor(const QColor &color) override
Sets the color of this rectangle to color.
ShaderSourceTypes shaderSourceType() const override
void renderNextFrame(QSGRenderer *renderer) override
int maxTextureSize() const override
static const int INIT_PARAMS_MAGIC
ShaderType shaderType() const override
GraphicsApi graphicsApi() const override
Returns the graphics API that is in use by the Qt Quick scenegraph.
void initialize(const QSGRenderContext::InitParams *params) override
ShaderCompilationTypes shaderCompilationType() const override
QSGRenderer * createRenderer(QSGRendererInterface::RenderMode renderMode=QSGRendererInterface::RenderMode2D) override
QSGTexture * createTexture(const QImage &image, uint flags) const override
QSGOpenVGFontGlyphCache * glyphCache(const QRawFont &rawFont)
const QOpenVGMatrix & transform() const
virtual void render()=0
virtual void setTransform(const QOpenVGMatrix &transform)
virtual void setOpacity(float opacity)
void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override
QSGOpenVGRenderer(QSGRenderContext *context)
QSize textureSize() const override
Returns the size of the texture in pixels.
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
QSGOpenVGTexture(const QImage &image, uint flags)
qint64 comparisonKey() const override
Returns a key suitable for comparing textures.
Combined button and popup list for selecting options.
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")