From a4b0e2183c23c0173167833c75f0e2970f3ab524 Mon Sep 17 00:00:00 2001 From: Arvid Nilsson Date: Fri, 13 Dec 2013 15:57:26 +0100 Subject: Quick: Support reparenting To support reparenting, we make the compositing surface independent of the window by using gfx::TEXTURE_TRANSPORT. We also need to be able to keep frame data across window changes so we can reconstruct the QSGNode tree in a new context, so extract that data into DelegatedFrameNodeData class. Any context-specific data is still stored in DelegatedFrameNode. Also hook up window changes to WebContents::WasShown/Hidden for Quick. Remove checking of Qt isVisible state, this mechanism is used to sync Chromium with Qt, not the other way around. WasShown/Hidden is orthogonal to Show/Hide, and can use different triggers. However for Widgets it probably makes sense to hook both up to widget visibility. Change-Id: I1ef4b50cd61b8e54b791e03f0b41929c42fec8bf Reviewed-by: Jocelyn Turcotte --- src/core/delegated_frame_node.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/core/delegated_frame_node.h') diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index b73370874..2a4ae53d0 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -42,9 +42,11 @@ #ifndef DELEGATED_FRAME_NODE_H #define DELEGATED_FRAME_NODE_H +#include "base/memory/scoped_ptr.h" #include "cc/resources/transferable_resource.h" #include #include +#include #include #include @@ -61,17 +63,25 @@ class DelegatedFrameData; class MailboxTexture; class RenderPassTexture; +// Separating this data allows another DelegatedFrameNode to reconstruct the QSGNode tree from the mailbox textures +// and render pass information. +class DelegatedFrameNodeData : public QSharedData { +public: + QHash > mailboxTextures; + scoped_ptr frameData; +}; + class DelegatedFrameNode : public QSGNode { public: DelegatedFrameNode(QQuickWindow *window); ~DelegatedFrameNode(); void preprocess(); - void commit(cc::DelegatedFrameData *frameData, cc::TransferableResourceArray *resourcesToRelease); + void commit(DelegatedFrameNodeData* data, cc::ReturnedResourceArray *resourcesToRelease); private: + QExplicitlySharedDataPointer m_data; QQuickWindow *m_window; QList > m_renderPassTextures; - QMap > m_mailboxTextures; int m_numPendingSyncPoints; QWaitCondition m_mailboxesFetchedWaitCond; QMutex m_mutex; -- cgit v1.2.3