summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-28 17:14:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 14:00:10 +0200
commit96425960f9d57387c33e3ba50785aaa81255bc98 (patch)
tree01799f1235c85ffef420c06c5598ebd4e028339e /src/core/delegated_frame_node.cpp
parent84f31c11b77a62212451cb77adae63219e06de96 (diff)
Render the widgets view using the scene graph into a QOpenGLWidget
This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 2cfcd4afe..1f7084d18 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -70,7 +70,6 @@
#include <QSGSimpleTextureNode>
#include <QSGTexture>
#include <QtQuick/private/qquickclipnode_p.h>
-#include <QtQuick/private/qquickwindow_p.h>
#include <QtQuick/private/qsgadaptationlayer_p.h>
#include <QtQuick/private/qsgcontext_p.h>
#include <QtQuick/private/qsgrenderer_p.h>
@@ -286,8 +285,8 @@ void MailboxTexture::fetchTexture(gpu::gles2::MailboxManager *mailboxManager)
m_textureId = service_id(tex);
}
-DelegatedFrameNode::DelegatedFrameNode(QQuickWindow *window)
- : m_window(window)
+DelegatedFrameNode::DelegatedFrameNode(QSGRenderContext *sgRenderContext)
+ : m_sgRenderContext(sgRenderContext)
, m_numPendingSyncPoints(0)
{
setFlag(UsePreprocess);
@@ -370,10 +369,8 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
QSGNode *renderPassParent = 0;
if (pass != rootRenderPass) {
QSharedPointer<RenderPassTexture> rpTexture = findRenderPassTexture(pass->id, oldRenderPassTextures);
- if (!rpTexture) {
- QSGRenderContext *sgrc = QQuickWindowPrivate::get(m_window)->context;
- rpTexture = QSharedPointer<RenderPassTexture>(new RenderPassTexture(pass->id, sgrc));
- }
+ if (!rpTexture)
+ rpTexture = QSharedPointer<RenderPassTexture>(new RenderPassTexture(pass->id, m_sgRenderContext));
m_renderPassTextures.append(rpTexture);
rpTexture->setDevicePixelRatio(m_data->frameDevicePixelRatio);
rpTexture->setRect(toQt(pass->output_rect));
@@ -404,8 +401,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
switch (quad->material) {
case cc::DrawQuad::CHECKERBOARD: {
const cc::CheckerboardDrawQuad *cbquad = cc::CheckerboardDrawQuad::MaterialCast(quad);
- QSGRenderContext *sgrc = QQuickWindowPrivate::get(m_window)->context;
- QSGRectangleNode *rectangleNode = sgrc->sceneGraphContext()->createRectangleNode();
+ QSGRectangleNode *rectangleNode = m_sgRenderContext->sceneGraphContext()->createRectangleNode();
rectangleNode->setRect(toQt(quad->rect));
rectangleNode->setColor(toQt(cbquad->color));
@@ -450,8 +446,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
break;
} case cc::DrawQuad::SOLID_COLOR: {
const cc::SolidColorDrawQuad *scquad = cc::SolidColorDrawQuad::MaterialCast(quad);
- QSGRenderContext *sgrc = QQuickWindowPrivate::get(m_window)->context;
- QSGRectangleNode *rectangleNode = sgrc->sceneGraphContext()->createRectangleNode();
+ QSGRectangleNode *rectangleNode = m_sgRenderContext->sceneGraphContext()->createRectangleNode();
// Qt only supports MSAA and this flag shouldn't be needed.
// If we ever want to use QSGRectangleNode::setAntialiasing for this we should