summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/ozone/gl_context_qt.cpp19
-rw-r--r--src/core/ozone/gl_context_qt.h1
-rw-r--r--src/core/ozone/gl_surface_qt.cpp10
-rw-r--r--src/core/web_engine_context.cpp3
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp3
5 files changed, 21 insertions, 15 deletions
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 9813a325..e9337874 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -81,6 +81,15 @@ void GLContextHelper::initialize()
{
if (!contextHelper)
contextHelper = new GLContextHelper;
+#if QT_CONFIG(opengl)
+ if (QGuiApplication::platformName() == QLatin1String("offscreen")){
+ contextHelper->m_robustness = false;
+ return;
+ }
+
+ if (QOpenGLContext *context = qt_gl_global_share_context())
+ contextHelper->m_robustness = context->format().testOption(QSurfaceFormat::ResetNotification);
+#endif
}
void GLContextHelper::destroy()
@@ -165,15 +174,9 @@ QFunctionPointer GLContextHelper::getEglGetProcAddress()
bool GLContextHelper::isCreateContextRobustnessSupported()
{
-#if QT_CONFIG(opengl)
- if (QGuiApplication::platformName() == QLatin1String("offscreen"))
- return false;
-
- if (QOpenGLContext *context = qt_gl_global_share_context())
- return context->format().testOption(QSurfaceFormat::ResetNotification);
-#endif
- return false;
+ return contextHelper->m_robustness;
}
+
QT_END_NAMESPACE
#if defined(OS_WIN)
diff --git a/src/core/ozone/gl_context_qt.h b/src/core/ozone/gl_context_qt.h
index 8559af31..cc4f6b0d 100644
--- a/src/core/ozone/gl_context_qt.h
+++ b/src/core/ozone/gl_context_qt.h
@@ -70,6 +70,7 @@ private:
Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs);
static GLContextHelper* contextHelper;
+ bool m_robustness = false;
};
QT_END_NAMESPACE
diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp
index c54a8f12..4be17f12 100644
--- a/src/core/ozone/gl_surface_qt.cpp
+++ b/src/core/ozone/gl_surface_qt.cpp
@@ -76,9 +76,9 @@ namespace {
bool g_initializedEGL = false;
}
-void* GLSurfaceQt::g_display = NULL;
-void* GLSurfaceQt::g_config = NULL;
-const char* GLSurfaceQt::g_extensions = NULL;
+void* GLSurfaceQt::g_display = nullptr;
+void* GLSurfaceQt::g_config = nullptr;
+const char* GLSurfaceQt::g_extensions = nullptr;
GLSurfaceQt::~GLSurfaceQt()
{
@@ -196,14 +196,14 @@ CreateOffscreenGLSurfaceWithFormat(const gfx::Size& size, GLSurfaceFormat format
}
LOG(ERROR) << "Requested OpenGL implementation is not supported. Implementation: " << GetGLImplementation();
Q_UNREACHABLE();
- return NULL;
+ return nullptr;
}
scoped_refptr<GLSurface>
CreateViewGLSurface(gfx::AcceleratedWidget window)
{
QT_NOT_USED
- return NULL;
+ return nullptr;
}
} // namespace init
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 5937d3b2..1fa12885 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -344,12 +344,13 @@ void WebEngineContext::destroy()
// This should deliver all nessesery calls of DeleteSoon from PostTask
while (delegate->DoWork()) { }
- GLContextHelper::destroy();
m_devtoolsServer.reset();
m_runLoop->AfterRun();
// Destroy the main runner, this stops main message loop
m_browserRunner.reset();
+ // gpu thread is no longer around, so no more cotnext is used, remove the helper
+ GLContextHelper::destroy();
// These would normally be in the content-runner, but we allocated them separately:
m_startupData.reset();
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 80c6740b..6b32bb82 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -945,7 +945,8 @@ void tst_QWebEngineProfile::changeUseForGlobalCertificateVerification()
profile.setUseForGlobalCertificateVerification(true);
page.reset(new QWebEnginePage(&profile));
QVERIFY(loadSync(page.get(), server.url("/hedgehog.html")));
- QVERIFY(server.stop());
+ // Don't check for error: there can be disconnects during GET hedgehog.png.
+ server.stop();
}
void tst_QWebEngineProfile::changePersistentCookiesPolicy()