109 :
public QWindowPrivate
110 ,
public QQuickPaletteProviderPrivateBase<QQuickWindow, QQuickWindowPrivate>
113 Q_DECLARE_PUBLIC(QQuickWindow)
116 FullUpdateRequest = QEvent::User + 1,
117 TriggerContextCreationFailure = QEvent::User + 2
120 static inline QQuickWindowPrivate *get(QQuickWindow *c) {
return c->d_func(); }
121 static inline const QQuickWindowPrivate *get(
const QQuickWindow *c) {
return c->d_func(); }
123 QQuickWindowPrivate();
124 ~QQuickWindowPrivate() override;
126 void setPalette(QQuickPalette *p) override;
127 void updateWindowPalette();
128 void updateChildrenPalettes(
const QPalette &parentPalette) override;
130 void init(QQuickWindow *, QQuickRenderControl *control =
nullptr);
132 QQuickRootItem *contentItem;
133 QSet<QQuickItem *> parentlessItems;
134 QQmlListProperty<QObject> data();
138 QQuickDeliveryAgent *deliveryAgent =
nullptr;
139 QQuickDeliveryAgentPrivate *deliveryAgentPrivate()
const
140 {
return deliveryAgent ?
static_cast<QQuickDeliveryAgentPrivate *>(QQuickDeliveryAgentPrivate::get(deliveryAgent)) :
nullptr; }
143 QQuickItem *cursorItem =
nullptr;
144 QQuickPointerHandler *cursorHandler =
nullptr;
145 void updateCursor(
const QPointF &scenePos, QQuickItem *rootItem =
nullptr);
146 std::pair<QQuickItem*, QQuickPointerHandler*> findCursorItemAndHandler(QQuickItem *item,
const QPointF &scenePos)
const;
149 void clearFocusObject() override;
150 void setFocusToTarget(FocusTarget, Qt::FocusReason) override;
152 void maybeSynthesizeContextMenuEvent(QMouseEvent *event) override;
154 void dirtyItem(QQuickItem *);
155 void cleanup(QSGNode *);
157 void ensureCustomRenderTarget();
158 void setCustomCommandBuffer(QRhiCommandBuffer *cb);
162 void invalidateFontData(QQuickItem *item);
163 void syncSceneGraph();
164 void renderSceneGraph();
166 bool isRenderable()
const;
168 bool emitError(QQuickWindow::SceneGraphError error,
const QString &msg);
170 enum TextureFromNativeTextureFlag {
171 NativeTextureIsExternalOES = 0x01
173 Q_DECLARE_FLAGS(TextureFromNativeTextureFlags, TextureFromNativeTextureFlag)
175 QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
176 int nativeLayoutOrState,
179 QQuickWindow::CreateTextureOptions options,
180 TextureFromNativeTextureFlags flags = {})
const;
181 QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
182 int nativeLayoutOrState,
184 QQuickWindow::CreateTextureOptions options,
185 TextureFromNativeTextureFlags flags = {})
const {
186 return createTextureFromNativeTexture(nativeObjectHandle, nativeLayoutOrState, 0, size, options, flags);
189 QQuickItem::UpdatePaintNodeData updatePaintNodeData;
191 QQuickItem *dirtyItemList;
192 QList<QSGNode *> cleanupNodeList;
194 QVector<QQuickItem *> itemsToPolish;
196 qreal lastReportedItemDevicePixelRatio;
197 QMetaObject::Connection physicalDpiChangedConnection;
198 std::array<QMetaObject::Connection, 7> connections;
200 void updateDirtyNodes();
202 void cleanupNodesOnShutdown();
203 bool updateEffectiveOpacity(QQuickItem *);
204 void updateEffectiveOpacityRoot(QQuickItem *, qreal);
205 void updateDirtyNode(QQuickItem *);
207 void fireFrameSwapped() { Q_EMIT q_func()->frameSwapped(); }
208 void fireAboutToStop() { Q_EMIT q_func()->sceneGraphAboutToStop(); }
210 bool needsChildWindowStackingOrderUpdate =
false;
211 void updateChildWindowStackingOrder(QQuickItem *item =
nullptr);
213 int multiViewCount();
214 QRhiRenderTarget *activeCustomRhiRenderTarget();
216 QSGRenderContext *context;
217 QSGRenderer *renderer;
218 QByteArray visualizationMode;
220 QSGRenderLoop *windowManager;
221 QQuickRenderControl *renderControl;
222 QScopedPointer<QQuickAnimatorController> animationController;
226 uint persistentGraphics : 1;
227 uint persistentSceneGraph : 1;
228 uint inDestructor : 1;
232 QQuickRenderTarget customRenderTarget;
235 QRhiCommandBuffer *commandBuffer =
nullptr;
236 QQuickWindowRenderTarget rt;
237 bool renderTargetDirty =
false;
240 QQuickGraphicsDevice customDeviceObjects;
242 QQuickGraphicsConfiguration graphicsConfig;
244 mutable QQuickWindowIncubationController *incubationController;
246 static bool defaultAlphaBuffer;
247 static QQuickWindow::TextRenderType textRenderType;
250 static void data_append(QQmlListProperty<QObject> *, QObject *);
251 static qsizetype data_count(QQmlListProperty<QObject> *);
252 static QObject *data_at(QQmlListProperty<QObject> *, qsizetype);
253 static void data_clear(QQmlListProperty<QObject> *);
254 static void data_removeLast(QQmlListProperty<QObject> *);
256 static void rhiCreationFailureMessage(
const QString &backendName,
257 QString *translatedMessage,
258 QString *untranslatedMessage);
260 static void emitBeforeRenderPassRecording(
void *ud);
261 static void emitAfterRenderPassRecording(
void *ud);
263 QMutex renderJobMutex;
264 QList<QRunnable *> beforeSynchronizingJobs;
265 QList<QRunnable *> afterSynchronizingJobs;
266 QList<QRunnable *> beforeRenderingJobs;
267 QList<QRunnable *> afterRenderingJobs;
268 QList<QRunnable *> afterSwapJobs;
270 void runAndClearJobs(QList<QRunnable *> *jobs);
271 QOpenGLContext *openglContext();
273 QQuickWindow::GraphicsStateInfo rhiStateInfo;
275 QRhiSwapChain *swapchain =
nullptr;
276 QRhiRenderBuffer *depthStencilForSwapchain =
nullptr;
277 QRhiRenderPassDescriptor *rpDescForSwapchain =
nullptr;
278 uint hasActiveSwapchain : 1;
279 uint hasRenderableSwapchain : 1;
280 uint swapchainJustBecameRenderable : 1;
281 uint updatesEnabled : 1;
282 bool pendingFontUpdate =
false;
283 bool windowEventDispatch =
false;
284 bool rmbContextMenuEventEnabled =
false;
285 QPointer<QQuickPalette> windowPaletteRef;
288 static void cleanupNodesOnShutdown(QQuickItem *);