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
qwaylandquickitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDQUICKITEM_P_H
5#define QWAYLANDQUICKITEM_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 purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick/private/qquickitem_p.h>
19#include <QtQuick/QSGMaterialShader>
20#include <QtQuick/QSGMaterial>
21
22#include <QtWaylandCompositor/QWaylandQuickItem>
23#include <QtWaylandCompositor/QWaylandOutput>
24
25#include <QtCore/qpointer.h>
26
28
30class QMutex;
31class QOpenGLTexture;
32
33#if QT_CONFIG(opengl)
34class QWaylandBufferMaterialShader : public QSGMaterialShader
35{
36public:
37 QWaylandBufferMaterialShader(QWaylandBufferRef::BufferFormatEgl format);
38
39 bool updateUniformData(RenderState &state,
40 QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
41 void updateSampledImage(RenderState &state, int binding, QSGTexture **texture,
42 QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
43 void setupExternalOESShader(const QString &shaderFilename);
44};
45
46class QWaylandBufferMaterial : public QSGMaterial
47{
48public:
49 QWaylandBufferMaterial(QWaylandBufferRef::BufferFormatEgl format);
50 ~QWaylandBufferMaterial() override;
51
52 void setTextureForPlane(int plane, QOpenGLTexture *texture, QSGTexture *scenegraphTexture);
53 void setBufferRef(QWaylandQuickItem *surfaceItem, const QWaylandBufferRef &ref);
54
55 void bind();
56 void updateScenegraphTextures(QRhi *rhi);
57
58 QSGMaterialType *type() const override;
59 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override;
60
61private:
62 friend QWaylandBufferMaterialShader;
63
64 void setTextureParameters(GLenum target);
65 void ensureTextures(int count);
66
68 QVarLengthArray<QOpenGLTexture*, 3> m_textures;
69 QVarLengthArray<QSGTexture*, 3> m_scenegraphTextures;
70 QWaylandBufferRef m_bufferRef;
71};
72#endif // QT_CONFIG(opengl)
73
75{
76 Q_DECLARE_PUBLIC(QWaylandQuickItem)
77public:
79
105
106 static const QWaylandQuickItemPrivate* get(const QWaylandQuickItem *item) { return item->d_func(); }
107
120
122 qreal scaleFactor() const;
123
127 void placeAboveParent();
128 void placeBelowParent();
129
130 virtual void raise();
131 virtual void lower();
132
133 static QMutex *mutex;
134
135 QScopedPointer<QWaylandView> view;
136 QPointer<QWaylandSurface> oldSurface;
139 bool paintEnabled = true;
142 bool isDragging = false;
143 bool newTexture = false;
144 bool focusOnClick = true;
145 bool belowParent = false;
146#if QT_CONFIG(opengl)
147 bool paintByProvider = false;
148#endif
151
155 QPointer<QObject> subsurfaceHandler;
156 QList<QWaylandSeat *> touchingSeats;
157};
158
160
161#endif /*QWAYLANDQUICKITEM_P_H*/
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
\inmodule QtCore
Definition qmutex.h:281
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
\inmodule QtGui
\inmodule QtCore\reentrant
Definition qpoint.h:217
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
\inmodule QtQuick
Definition qsgtexture.h:20
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtWaylandCompositor
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
QWaylandQuickItem * findSibling(QWaylandSurface *surface) const
void setInputEventsEnabled(bool enable)
QWaylandSurface::Origin origin
QScopedPointer< QWaylandView > view
QPointer< QObject > subsurfaceHandler
QMetaObject::Connection texProviderConnection
void placeBelowSibling(QWaylandQuickItem *sibling)
void placeAboveSibling(QWaylandQuickItem *sibling)
QWaylandSurfaceTextureProvider * provider
QList< QWaylandSeat * > touchingSeats
QWaylandQuickItemPrivate()=default
static const QWaylandQuickItemPrivate * get(const QWaylandQuickItem *item)
QPointer< QWaylandSurface > oldSurface
\qmltype WaylandQuickItem \instantiates QWaylandQuickItem \inqmlmodule QtWayland.Compositor
bool allowDiscardFrontBuffer
By default, the item locks the current buffer until a new buffer is available and updatePaintNode() i...
void surfaceDestroyed()
\qmlsignal void QtWayland.Compositor::WaylandQuickItem::surfaceDestroyed()
void bufferLockedChanged()
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
void surfaceDestroyed()
void allowDiscardFrontBufferChanged()
QWaylandSurface * surface
\qmlproperty WaylandSurface QtWayland.Compositor::WaylandView::surface
void bufferLockedChanged()
void outputChanged()
void surfaceChanged()
else opt state
[0]
Combined button and popup list for selecting options.
void updateUniformData(QByteArray *dst, const QVideoFrameFormat &format, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity, float maxNits)
@ ExtraButton9
Definition qnamespace.h:74
@ LeftButton
Definition qnamespace.h:58
@ ExtraButton5
Definition qnamespace.h:70
@ ExtraButton6
Definition qnamespace.h:71
@ RightButton
Definition qnamespace.h:59
@ ExtraButton12
Definition qnamespace.h:77
@ ExtraButton10
Definition qnamespace.h:75
@ MiddleButton
Definition qnamespace.h:60
@ ExtraButton2
Definition qnamespace.h:66
@ ExtraButton1
Definition qnamespace.h:63
@ ExtraButton11
Definition qnamespace.h:76
@ ExtraButton13
Definition qnamespace.h:78
@ NoButton
Definition qnamespace.h:57
@ ExtraButton8
Definition qnamespace.h:73
@ ExtraButton3
Definition qnamespace.h:68
@ ExtraButton7
Definition qnamespace.h:72
@ ExtraButton4
Definition qnamespace.h:69
GLenum GLenum GLsizei count
GLenum type
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLenum target
GLboolean enable
GLenum GLuint texture
GLint ref
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
double qreal
Definition qtypes.h:187
QGraphicsItem * item
socketLayer bind(QHostAddress::Any, 4000)
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.