diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-09-30 16:41:02 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-11-25 16:27:23 +0100 |
commit | e47a1ff932bfc0cc2a8886ae24d5b6805dd4f055 (patch) | |
tree | 674514b2e164bb81ffad0cacbf2fcc2f3a795b34 /src/core/delegated_frame_node.h | |
parent | 3a7674a1b6901826a70b54eab5c9312ecd0d6052 (diff) |
Extract the resource logic out of MailboxTexture
As a first step to allow using plain textures for software resources,
split the Chromium resource handling responsibility into a
ResourceHolder class.
This also moves the static findMailboxTexture into a member
DelegatedFrameNode::findAndHoldResource in preparation for how
texture refcounting will work in the following patch.
Change-Id: Iaa64273c187af022045bbcaa956fcaa1f3defabc
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'src/core/delegated_frame_node.h')
-rw-r--r-- | src/core/delegated_frame_node.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index 41e89f75f..8fad76cb3 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -58,13 +58,14 @@ class DelegatedFrameData; } class MailboxTexture; +class ResourceHolder; // Separating this data allows another DelegatedFrameNode to reconstruct the QSGNode tree from the mailbox textures // and render pass information. class ChromiumCompositorData : public QSharedData { public: ChromiumCompositorData() : frameDevicePixelRatio(1) { } - QHash<unsigned, QSharedPointer<MailboxTexture> > mailboxTextures; + QHash<unsigned, QSharedPointer<ResourceHolder> > resourceHolders; scoped_ptr<cc::DelegatedFrameData> frameData; qreal frameDevicePixelRatio; }; @@ -77,6 +78,12 @@ public: void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease, RenderWidgetHostViewQtDelegate *apiDelegate); private: + // Making those callbacks static bypasses base::Bind's ref-counting requirement + // of the this pointer when the callback is a method. + static void fetchTexturesAndUnlockQt(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch); + static void syncPointRetired(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch); + + ResourceHolder *findAndHoldResource(unsigned resourceId, QHash<unsigned, QSharedPointer<ResourceHolder> > &candidates); QExplicitlySharedDataPointer<ChromiumCompositorData> m_chromiumCompositorData; struct SGObjects { QList<QPair<cc::RenderPass::Id, QSharedPointer<QSGLayer> > > renderPassLayers; @@ -86,11 +93,6 @@ private: QMap<uint32, gfx::TransferableFence> m_mailboxGLFences; QWaitCondition m_mailboxesFetchedWaitCond; QMutex m_mutex; - - // Making those callbacks static bypasses base::Bind's ref-counting requirement - // of the this pointer when the callback is a method. - static void fetchTexturesAndUnlockQt(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch); - static void syncPointRetired(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch); }; #endif // DELEGATED_FRAME_NODE_H |