diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2016-12-04 19:13:33 +0900 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-12-08 05:12:37 +0000 |
commit | 0299ccd3b9cf50817cce430ec3419c9f204b47e2 (patch) | |
tree | d8ab3f4c4f5299557101d6b8f9b34b5f567faf61 | |
parent | 8272b5d1082124858b9e16b9df00c9f1dd5d1efa (diff) |
Use surfaceless context if necessary
The support for surfaceless context was disabled in commit
9cc97f0c63049a8076476acc89c875c9e240abfb, which says:
> Using surfaceless EGL surface on imx6 embedded device crashes webengine
> with backtrace in gpu driver.
It was added in commit bfcbdc3ab42880dc37ffa7174af96928ccf25f03, which
says:
> This patch is a port of commit 4b0cac9dfeebb73f21a11e10e6a2bc7bddbe889b
> in Chromium for Qt WebEngine.
> The based commit says:
> (snip)
> > the creation of a dummy offscreen surface. This would also enable
> > support for offscreen rendering on platforms (i.e Ozone-Wayland) which
> > donot support pbuffer surfaces.
>
> Some platforms supported by QPA, such as Mesa 3D DRI2 with drm and
> wayland backend also don't support pbuffer surfaces.
Considering those cases, this change enables surfaceless context only if
pseudo surfaceless context made of surface context is not available.
Change-Id: I015421ebbbc357d48313e09d4f7a0369bb956521
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | src/core/gl_surface_qt.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index 4385b38cb..e8f77e9ed 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -367,8 +367,7 @@ bool GLSurfaceQtEGL::InitializeOneOff() LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString(); return false; } -#if 0 -// QTBUG-57290 + g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions, "EGL_KHR_surfaceless_context"); if (g_egl_surfaceless_context_supported) { scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(gfx::Size(1, 1)); @@ -385,7 +384,7 @@ bool GLSurfaceQtEGL::InitializeOneOff() context->ReleaseCurrent(surface.get()); } } -#endif + initialized = true; return true; } @@ -615,13 +614,19 @@ CreateOffscreenGLSurface(const gfx::Size& size) #endif } case kGLImplementationEGLGLES2: { - if (g_egl_surfaceless_context_supported) - surface = new GLSurfacelessQtEGL(size); - else - surface = new GLSurfaceQtEGL(size); - + surface = new GLSurfaceQtEGL(size); if (surface->Initialize()) return surface; + + // Surfaceless context will be used ONLY if pseudo surfaceless context + // is not available since some implementations of surfaceless context + // have problems. (e.g. QTBUG-57290) + if (g_egl_surfaceless_context_supported) { + surface = new GLSurfacelessQtEGL(size); + if (surface->Initialize()) + return surface; + } + break; } default: |