From 5821cd3b98e2e830bdf107cecc7138854822764b Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 8 Jul 2020 18:10:48 +0200 Subject: Remove setting surface format for qquickwidget QQuickWidget uses QSGDefaultContext::defaultSurfaceFormat() in initialization, which is based on QSurfaceFormat::defaultFormat() Removed code was overriding format based on shared context format for some cases. However defaultFormat is always a requested format and not actual supported one by hardware. Since we always create share context simplify the logic and try to catch all the surface format related issues in QWebEngineCore::initialize() and abort. Change-Id: I940601b5cd873ab5273baa863aa4e7277be448a6 Reviewed-by: Allan Sandfeld Jensen --- .../render_widget_host_view_qt_delegate_widget.cpp | 32 ---------------------- 1 file changed, 32 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 49cc08da5..af30c54b8 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -169,38 +169,6 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende , m_isPopup(false) { setFocusPolicy(Qt::StrongFocus); - - QSurfaceFormat format; - format.setDepthBufferSize(24); - format.setStencilBufferSize(8); - -#if QT_CONFIG(opengl) - QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext(); - if (globalSharedContext) { - QSurfaceFormat sharedFormat = globalSharedContext->format(); - int major; - int minor; - QSurfaceFormat::OpenGLContextProfile profile; - major = sharedFormat.majorVersion(); - minor = sharedFormat.minorVersion(); - profile = sharedFormat.profile(); - // Make sure the OpenGL profile of the QQuickWidget matches the shared context profile. - // It covers the following cases: - // 1) Desktop OpenGL Core Profile. - // 2) Windows ANGLE OpenGL ES profile. - if (sharedFormat.profile() == QSurfaceFormat::CoreProfile -#ifdef Q_OS_WIN - || globalSharedContext->isOpenGLES() -#endif - ) { - format.setMajorVersion(major); - format.setMinorVersion(minor); - format.setProfile(profile); - } - } - - setFormat(format); -#endif setMouseTracking(true); setAttribute(Qt::WA_AcceptTouchEvents); setAttribute(Qt::WA_OpaquePaintEvent); -- cgit v1.2.3