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.h128
1 files changed, 64 insertions, 64 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 30b5a36cb5..8ba4e56515 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQUICKWINDOW_P_H
#define QQUICKWINDOW_P_H
@@ -84,7 +48,6 @@ class QPointingDevice;
class QQuickRenderControl;
class QQuickWindowIncubationController;
class QQuickWindowPrivate;
-class QQuickWindowRenderLoop;
class QSGRenderLoop;
class QTouchEvent;
class QRhi;
@@ -93,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
@@ -107,18 +72,39 @@ public Q_SLOTS:
void setHeight(int h) {QQuickItem::setHeight(qreal(h));}
};
-class QQuickWindowRenderTarget
+struct QQuickWindowRenderTarget
{
-public:
- void reset(QRhi *rhi, QSGRenderer *renderer);
- QRhiRenderTarget *renderTarget = nullptr;
- QRhiRenderPassDescriptor *rpDesc = nullptr;
- QRhiTexture *texture = nullptr;
- QRhiRenderBuffer *depthStencil = 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>
{
@@ -136,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);
@@ -148,13 +136,7 @@ public:
// but any subscene root can have a QQuickItemPrivate::ExtraData::subsceneDeliveryAgent
QQuickDeliveryAgent *deliveryAgent = nullptr;
QQuickDeliveryAgentPrivate *deliveryAgentPrivate() const
- { return static_cast<QQuickDeliveryAgentPrivate *>(QQuickDeliveryAgentPrivate::get(deliveryAgent)); }
-
- // TODO remove these: they were moved to QQuickDeliveryAgentPrivate
- static bool isMouseEvent(const QPointerEvent *ev) { return QQuickDeliveryAgentPrivate::isMouseEvent(ev); }
- static bool isTouchEvent(const QPointerEvent *ev) { return QQuickDeliveryAgentPrivate::isTouchEvent(ev); }
- static bool isTabletEvent(const QPointerEvent *ev) { return QQuickDeliveryAgentPrivate::isTabletEvent(ev); }
- void flushFrameSynchronousEvents();
+ { return deliveryAgent ? static_cast<QQuickDeliveryAgentPrivate *>(QQuickDeliveryAgentPrivate::get(deliveryAgent)) : nullptr; }
#if QT_CONFIG(cursor)
QQuickItem *cursorItem = nullptr;
@@ -163,6 +145,9 @@ public:
QPair<QQuickItem*, QQuickPointerHandler*> findCursorItemAndHandler(QQuickItem *item, const QPointF &scenePos) const;
#endif
+ void clearFocusObject() override;
+ void setFocusToTarget(FocusTarget, Qt::FocusReason) override;
+
void dirtyItem(QQuickItem *);
void cleanup(QSGNode *);
@@ -171,8 +156,9 @@ public:
void polishItems();
void forcePolish();
+ void invalidateFontData(QQuickItem *item);
void syncSceneGraph();
- void renderSceneGraph(const QSize &size, const QSize &surfaceSize = QSize());
+ void renderSceneGraph();
bool isRenderable() const;
@@ -184,10 +170,18 @@ 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 nativeLayoutOrState,
+ const QSize &size,
+ QQuickWindow::CreateTextureOptions options,
+ TextureFromNativeTextureFlags flags = {}) const {
+ return createTextureFromNativeTexture(nativeObjectHandle, nativeLayoutOrState, 0, size, options, flags);
+ }
QQuickItem::UpdatePaintNodeData updatePaintNodeData;
@@ -196,7 +190,7 @@ public:
QVector<QQuickItem *> itemsToPolish;
- qreal devicePixelRatio;
+ qreal lastReportedItemDevicePixelRatio;
QMetaObject::Connection physicalDpiChangedConnection;
void updateDirtyNodes();
@@ -209,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.
@@ -221,7 +222,6 @@ public:
uint persistentGraphics : 1;
uint persistentSceneGraph : 1;
- uint componentCompleted : 1;
uint inDestructor : 1;
// Storage for setRenderTarget(QQuickRenderTarget).
@@ -250,10 +250,6 @@ public:
{ return QQuickDeliveryAgentPrivate::dragOverThreshold(d, axis, event, startDragThreshold); }
void clearFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason)
{ deliveryAgentPrivate()->clearFocusInScope(scope, item, reason); }
- void handleTouchEvent(QTouchEvent *e)
- { deliveryAgentPrivate()->handleTouchEvent(e); }
- void handleMouseEvent(QMouseEvent *e)
- { deliveryAgentPrivate()->handleMouseEvent(e); }
// ^^^ currently in use in Controls 2; TODO remove
// data property
@@ -289,6 +285,10 @@ public:
uint hasActiveSwapchain : 1;
uint hasRenderableSwapchain : 1;
uint swapchainJustBecameRenderable : 1;
+ uint updatesEnabled : 1;
+ bool pendingFontUpdate = false;
+ bool windowEventDispatch = false;
+ QPointer<QQuickPalette> windowPaletteRef;
private:
static void cleanupNodesOnShutdown(QQuickItem *);