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,
147 const QPointF &localPos,
const QPointF &scenePos)
const;
150 void clearFocusObject() override;
151 void setFocusToTarget(FocusTarget, Qt::FocusReason) override;
153 void maybeSynthesizeContextMenuEvent(QMouseEvent *event) override;
155 void dirtyItem(QQuickItem *);
156 void cleanup(QSGNode *);
158 void ensureCustomRenderTarget();
159 void setCustomCommandBuffer(QRhiCommandBuffer *cb);
163 void invalidateFontData(QQuickItem *item);
164 void syncSceneGraph();
165 void renderSceneGraph();
167 bool isRenderable()
const;
169 bool emitError(QQuickWindow::SceneGraphError error,
const QString &msg);
171 enum TextureFromNativeTextureFlag {
172 NativeTextureIsExternalOES = 0x01
174 Q_DECLARE_FLAGS(TextureFromNativeTextureFlags, TextureFromNativeTextureFlag)
176 QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
177 int nativeLayoutOrState,
180 QQuickWindow::CreateTextureOptions options,
181 TextureFromNativeTextureFlags flags = {})
const;
182 QSGTexture *createTextureFromNativeTexture(quint64 nativeObjectHandle,
183 int nativeLayoutOrState,
185 QQuickWindow::CreateTextureOptions options,
186 TextureFromNativeTextureFlags flags = {})
const {
187 return createTextureFromNativeTexture(nativeObjectHandle, nativeLayoutOrState, 0, size, options, flags);
190 QQuickItem::UpdatePaintNodeData updatePaintNodeData;
192 QQuickItem *dirtyItemList;
193 QList<QSGNode *> cleanupNodeList;
195 QList<QQuickItem *> itemsToPolish;
197 qreal lastReportedItemDevicePixelRatio;
198 QMetaObject::Connection physicalDpiChangedConnection;
199 std::array<QMetaObject::Connection, 7> connections;
201 void updateDirtyNodes();
203 void cleanupNodesOnShutdown();
204 bool updateEffectiveOpacity(QQuickItem *);
205 void updateEffectiveOpacityRoot(QQuickItem *, qreal);
206 void updateDirtyNode(QQuickItem *);
208 void fireFrameSwapped() { Q_EMIT q_func()->frameSwapped(); }
209 void fireAboutToStop() { Q_EMIT q_func()->sceneGraphAboutToStop(); }
211 bool needsChildWindowStackingOrderUpdate =
false;
212 void updateChildWindowStackingOrder(QQuickItem *item =
nullptr);
214 int multiViewCount();
215 QRhiRenderTarget *activeCustomRhiRenderTarget();
217 QSGRenderContext *context;
218 QSGRenderer *renderer;
219 QByteArray visualizationMode;
221 QSGRenderLoop *windowManager;
222 QQuickRenderControl *renderControl;
223 QScopedPointer<QQuickAnimatorController> animationController;
227 uint persistentGraphics : 1;
228 uint persistentSceneGraph : 1;
229 uint inDestructor : 1;
233 QQuickRenderTarget customRenderTarget;
236 QRhiCommandBuffer *commandBuffer =
nullptr;
237 QQuickWindowRenderTarget rt;
238 bool renderTargetDirty =
false;
241 QQuickGraphicsDevice customDeviceObjects;
243 QQuickGraphicsConfiguration graphicsConfig;
245 mutable QQuickWindowIncubationController *incubationController;
247 static bool defaultAlphaBuffer;
248 static QQuickWindow::TextRenderType textRenderType;
251 static void data_append(QQmlListProperty<QObject> *, QObject *);
252 static qsizetype data_count(QQmlListProperty<QObject> *);
253 static QObject *data_at(QQmlListProperty<QObject> *, qsizetype);
254 static void data_clear(QQmlListProperty<QObject> *);
255 static void data_removeLast(QQmlListProperty<QObject> *);
257 static void rhiCreationFailureMessage(
const QString &backendName,
258 QString *translatedMessage,
259 QString *untranslatedMessage);
261 static void emitBeforeRenderPassRecording(
void *ud);
262 static void emitAfterRenderPassRecording(
void *ud);
264 QMutex renderJobMutex;
265 QList<QRunnable *> beforeSynchronizingJobs;
266 QList<QRunnable *> afterSynchronizingJobs;
267 QList<QRunnable *> beforeRenderingJobs;
268 QList<QRunnable *> afterRenderingJobs;
269 QList<QRunnable *> afterSwapJobs;
271 void runAndClearJobs(QList<QRunnable *> *jobs);
272 QOpenGLContext *openglContext();
274 QQuickWindow::GraphicsStateInfo rhiStateInfo;
276 QRhiSwapChain *swapchain =
nullptr;
277 QRhiRenderBuffer *depthStencilForSwapchain =
nullptr;
278 QRhiRenderPassDescriptor *rpDescForSwapchain =
nullptr;
279 uint hasActiveSwapchain : 1;
280 uint hasRenderableSwapchain : 1;
281 uint swapchainJustBecameRenderable : 1;
282 uint updatesEnabled : 1;
283 bool pendingFontUpdate =
false;
284 bool windowEventDispatch =
false;
285 bool rmbContextMenuEventEnabled =
false;
286 QPointer<QQuickPalette> windowPaletteRef;
289 static void cleanupNodesOnShutdown(QQuickItem *);