diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-10-15 13:59:17 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-11-25 16:27:18 +0100 |
commit | 3a7674a1b6901826a70b54eab5c9312ecd0d6052 (patch) | |
tree | 599e000eed26b3708d54dc26dc5255e6e8f849a7 /src/core/delegated_frame_node.h | |
parent | 3f08d8a506241bf9b9cdfb2be37f8a3868869adf (diff) |
Avoid relying on QOpenGL classes to handle RenderPasses
Use QSGLayer and get rid of RenderPassTexture so that we can render
intermediate layers with the QtQuick 2D Renderer.
This reintroduces the private dependency on QtQuick since the
QSGLayer factory methods aren't available publically, and also that
we need to use QSGImageNode instead of QSGSimpleTextureNode to use
them.
Since we can't subclass QSGLayer to hold a reference to SG objects
directly in the nodes that use them, store them all in the wrapping
DelegatedFrameNode in a SGObjects structs. This works assuming that
the DelegatedFrameNode will always be at the root of our nodes,
layers and textures; if the scene graph destroys the
DelegatedFrameNode all child nodes will be destroyed with it.
Change-Id: Iedeceb8f98eb54fd8228a677c366d6df9a270e11
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, 11 insertions, 3 deletions
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index 0a042ba32..41e89f75f 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -38,6 +38,7 @@ #define DELEGATED_FRAME_NODE_H #include "base/memory/scoped_ptr.h" +#include "cc/quads/render_pass.h" #include "cc/resources/transferable_resource.h" #include <QMutex> #include <QSGNode> @@ -46,13 +47,17 @@ #include <QWaitCondition> #include "chromium_gpu_helper.h" +#include "render_widget_host_view_qt_delegate.h" + +QT_BEGIN_NAMESPACE +class QSGLayer; +QT_END_NAMESPACE namespace cc { 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. @@ -69,11 +74,14 @@ public: DelegatedFrameNode(); ~DelegatedFrameNode(); void preprocess(); - void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease); + void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease, RenderWidgetHostViewQtDelegate *apiDelegate); private: QExplicitlySharedDataPointer<ChromiumCompositorData> m_chromiumCompositorData; - QList<QSharedPointer<RenderPassTexture> > m_renderPassTextures; + struct SGObjects { + QList<QPair<cc::RenderPass::Id, QSharedPointer<QSGLayer> > > renderPassLayers; + QList<QSharedPointer<QSGRootNode> > renderPassRootNodes; + } m_sgObjects; int m_numPendingSyncPoints; QMap<uint32, gfx::TransferableFence> m_mailboxGLFences; QWaitCondition m_mailboxesFetchedWaitCond; |