From 96425960f9d57387c33e3ba50785aaa81255bc98 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 28 Mar 2014 17:14:30 +0100 Subject: 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 --- src/core/delegated_frame_node.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/core/delegated_frame_node.cpp') 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 #include #include -#include #include #include #include @@ -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 rpTexture = findRenderPassTexture(pass->id, oldRenderPassTextures); - if (!rpTexture) { - QSGRenderContext *sgrc = QQuickWindowPrivate::get(m_window)->context; - rpTexture = QSharedPointer(new RenderPassTexture(pass->id, sgrc)); - } + if (!rpTexture) + rpTexture = QSharedPointer(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 -- cgit v1.2.3