aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickwindow_p.h')
-rw-r--r--src/quick/items/qquickwindow_p.h63
1 files changed, 47 insertions, 16 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 57020eaa3e..8ba4e56515 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -56,8 +56,10 @@ class QRhiRenderBuffer;
class QRhiRenderPassDescriptor;
class QRhiTexture;
+Q_DECLARE_LOGGING_CATEGORY(lcQuickWindow)
+
//Make it easy to identify and customize the root item if needed
-class Q_QUICK_PRIVATE_EXPORT QQuickRootItem : public QQuickItem
+class Q_QUICK_EXPORT QQuickRootItem : public QQuickItem
{
Q_OBJECT
QML_ANONYMOUS
@@ -70,20 +72,39 @@ public Q_SLOTS:
void setHeight(int h) {QQuickItem::setHeight(qreal(h));}
};
-class QQuickWindowRenderTarget
+struct QQuickWindowRenderTarget
{
-public:
- void reset(QRhi *rhi);
- QRhiRenderTarget *renderTarget = nullptr;
- QRhiRenderPassDescriptor *rpDesc = nullptr;
- QRhiTexture *texture = nullptr;
- QRhiRenderBuffer *renderBuffer = nullptr;
- QRhiRenderBuffer *depthStencil = nullptr;
- QPaintDevice *paintDevice = nullptr;
- bool owns = false;
+ enum class ResetFlag {
+ KeepImplicitBuffers = 0x01
+ };
+ Q_DECLARE_FLAGS(ResetFlags, ResetFlag)
+ void reset(QRhi *rhi, ResetFlags flags = {});
+
+ struct {
+ QRhiRenderTarget *renderTarget = nullptr;
+ bool owns = false;
+ int multiViewCount = 1;
+ } rt;
+ struct {
+ QRhiTexture *texture = nullptr;
+ QRhiRenderBuffer *renderBuffer = nullptr;
+ QRhiRenderPassDescriptor *rpDesc = nullptr;
+ } res;
+ struct ImplicitBuffers {
+ QRhiRenderBuffer *depthStencil = nullptr;
+ QRhiTexture *depthStencilTexture = nullptr;
+ QRhiTexture *multisampleTexture = nullptr;
+ void reset(QRhi *rhi);
+ } implicitBuffers;
+ struct {
+ QPaintDevice *paintDevice = nullptr;
+ bool owns = false;
+ } sw;
};
-class Q_QUICK_PRIVATE_EXPORT QQuickWindowPrivate
+Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickWindowRenderTarget::ResetFlags)
+
+class Q_QUICK_EXPORT QQuickWindowPrivate
: public QWindowPrivate
, public QQuickPaletteProviderPrivateBase<QQuickWindow, QQuickWindowPrivate>
{
@@ -101,6 +122,8 @@ public:
QQuickWindowPrivate();
~QQuickWindowPrivate() override;
+ void setPalette(QQuickPalette *p) override;
+ void updateWindowPalette();
void updateChildrenPalettes(const QPalette &parentPalette) override;
void init(QQuickWindow *, QQuickRenderControl *control = nullptr);
@@ -123,6 +146,7 @@ public:
#endif
void clearFocusObject() override;
+ void setFocusToTarget(FocusTarget, Qt::FocusReason) override;
void dirtyItem(QQuickItem *);
void cleanup(QSGNode *);
@@ -146,17 +170,17 @@ public:
Q_DECLARE_FLAGS(TextureFromNativeTextureFlags, TextureFromNativeTextureFlag)
QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
- int nativeLayout,
+ int nativeLayoutOrState,
uint nativeFormat,
const QSize &size,
QQuickWindow::CreateTextureOptions options,
TextureFromNativeTextureFlags flags = {}) const;
QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
- int nativeLayout,
+ int nativeLayoutOrState,
const QSize &size,
QQuickWindow::CreateTextureOptions options,
TextureFromNativeTextureFlags flags = {}) const {
- return createTextureFromNativeTexture(nativeObjectHandle, nativeLayout, 0, size, options, flags);
+ return createTextureFromNativeTexture(nativeObjectHandle, nativeLayoutOrState, 0, size, options, flags);
}
QQuickItem::UpdatePaintNodeData updatePaintNodeData;
@@ -179,6 +203,13 @@ public:
void fireFrameSwapped() { Q_EMIT q_func()->frameSwapped(); }
void fireAboutToStop() { Q_EMIT q_func()->sceneGraphAboutToStop(); }
+ void clearGrabbers(QPointerEvent *event);
+
+ void updateChildWindowStackingOrder(QQuickItem *item = nullptr);
+
+ int multiViewCount();
+ QRhiRenderTarget *activeCustomRhiRenderTarget();
+
QSGRenderContext *context;
QSGRenderer *renderer;
QByteArray visualizationMode; // Default renderer supports "clip", "overdraw", "changes", "batches" and blank.
@@ -191,7 +222,6 @@ public:
uint persistentGraphics : 1;
uint persistentSceneGraph : 1;
- uint componentCompleted : 1;
uint inDestructor : 1;
// Storage for setRenderTarget(QQuickRenderTarget).
@@ -258,6 +288,7 @@ public:
uint updatesEnabled : 1;
bool pendingFontUpdate = false;
bool windowEventDispatch = false;
+ QPointer<QQuickPalette> windowPaletteRef;
private:
static void cleanupNodesOnShutdown(QQuickItem *);