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
qquickshadereffect_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKSHADEREFFECT_P_H
6#define QQUICKSHADEREFFECT_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qtquickglobal_p.h>
20
22
23#include <QtQuick/qquickitem.h>
24#include <private/qtquickglobal_p.h>
25#include <private/qsgadaptationlayer_p.h>
26
27QT_BEGIN_NAMESPACE
28
29class QQuickShaderEffectPrivate;
30
31class Q_QUICK_EXPORT QQuickShaderEffect : public QQuickItem
32{
33 Q_OBJECT
34 Q_PROPERTY(QUrl fragmentShader READ fragmentShader WRITE setFragmentShader NOTIFY fragmentShaderChanged)
35 Q_PROPERTY(QUrl vertexShader READ vertexShader WRITE setVertexShader NOTIFY vertexShaderChanged)
36 Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY blendingChanged)
37 Q_PROPERTY(QVariant mesh READ mesh WRITE setMesh NOTIFY meshChanged)
38 Q_PROPERTY(CullMode cullMode READ cullMode WRITE setCullMode NOTIFY cullModeChanged)
39 Q_PROPERTY(QString log READ log NOTIFY logChanged)
40 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
41 Q_PROPERTY(bool supportsAtlasTextures READ supportsAtlasTextures WRITE setSupportsAtlasTextures NOTIFY supportsAtlasTexturesChanged REVISION(2, 4))
42 QML_NAMED_ELEMENT(ShaderEffect)
43 QML_ADDED_IN_VERSION(2, 0)
44
45public:
46 enum CullMode {
47 NoCulling,
48 BackFaceCulling,
49 FrontFaceCulling
50 };
51 Q_ENUM(CullMode)
52
53 enum Status {
54 Compiled,
55 Uncompiled,
56 Error
57 };
58 Q_ENUM(Status)
59
60 QQuickShaderEffect(QQuickItem *parent = nullptr);
61 ~QQuickShaderEffect() override;
62
63 QUrl fragmentShader() const;
64 void setFragmentShader(const QUrl &fileUrl);
65
66 QUrl vertexShader() const;
67 void setVertexShader(const QUrl &fileUrl);
68
69 bool blending() const;
70 void setBlending(bool enable);
71
72 QVariant mesh() const;
73 void setMesh(const QVariant &mesh);
74
75 CullMode cullMode() const;
76 void setCullMode(CullMode face);
77
78 bool supportsAtlasTextures() const;
79 void setSupportsAtlasTextures(bool supports);
80
81 QString log() const;
82 Status status() const;
83
84 bool isComponentComplete() const;
85
86 bool updateUniformValue(const QByteArray &name, const QVariant &value);
87
88Q_SIGNALS:
89 void fragmentShaderChanged();
90 void vertexShaderChanged();
91 void blendingChanged();
92 void meshChanged();
93 void cullModeChanged();
94 void logChanged();
95 void statusChanged();
96 void supportsAtlasTexturesChanged();
97
98protected:
99 bool event(QEvent *e) override;
100 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
101 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override;
102 void componentComplete() override;
103 void itemChange(ItemChange change, const ItemChangeData &value) override;
104
105private:
106 Q_DECLARE_PRIVATE(QQuickShaderEffect)
107};
108
109QT_END_NAMESPACE
110
111#endif // QQUICKSHADEREFFECT_P_H
void setSize(const QSize &size)
QQuickScaleGrid * border() const
bool validateAttributes(const QVector< QByteArray > &attributes, int *posIndex) override
void horizontalTileModeChanged()
TileMode horizontalTileMode() const
\qmlproperty enumeration QtQuick::BorderImageMesh::horizontalTileMode \qmlproperty enumeration QtQuic...
QSGGeometry * updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, const QRectF &srcRect, const QRectF &rect) override
QT_REQUIRE_CONFIG(animation)
static const char qt_texcoord_attribute_name[]
const char * qtTexCoordAttributeName()
static QT_BEGIN_NAMESPACE const char qt_position_attribute_name[]
const char * qtPositionAttributeName()
QT_REQUIRE_CONFIG(quick_shadereffect)
QColor qt_premultiply_color(const QColor &c)