summaryrefslogtreecommitdiffstats
path: root/src/core/gl_surface_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move last surface and context classes to ozoneMichal Klocek2018-08-021-233/+0
| | | | | | | | Moves last two remaining classes to ozone. Now all the context and surface handling is in ozone subdir. Change-Id: I87d4570f866b905e8f79a73d70f04bd8b21f6e1b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Use ozone for x11Michal Klocek2018-08-021-111/+9
| | | | | | | | | | | | | | | | | | | | | Switch to use ozone also for x11/glx. This way we have a more elegant approach to hook in our gl surface classes and we use ozone for all linux qpa backends. Moreover, we have now also more fine grain control to reimplement gl surface handling logic. This also aims to fix currently broken wayland backend, but instead of patching the broken x11 calls, we simply reuse ozone which does not use x11 for ozone egl. Add webengine-x11 check to handle ozone glx plugin compilation. For ozone egl backend reimplement missing functions. Task-number: QTBUG-65682 Task-number: QTBUG-51631 Change-Id: I8b45c6f4d09a1c703efb12b6452d78ab385371ab Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add fallback lookup for eglGetProcAddressSamuli Piippo2018-06-131-0/+4
| | | | | | | | Use the GLContext to find address for eglGetProcAddress symbol, if it's not found with dlopen. Change-Id: I3f5330c21ecc9b66e5e376d50d3fc6965b227f85 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix compilation with opengl es2Michal Klocek2018-06-051-15/+2
| | | | | | | | | | | | | | Do not include <QOpenGLContext> with gl_bindings.h since this will eventually include gl and gles heders into same compilation unit. Confilicting headers: third_party/khronos/GLES3/gl32.h third_party/mesa/src/include/GL/gl.h Change-Id: I0450a4084011ead4bfa80d68aeea3f5859df4c94 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add fallback to qpa when query for glXGetProcAddressMichal Klocek2018-05-011-3/+21
| | | | | | | | Seems that with pyqt we have to fallback to qpa. Task-number: QTBUG-67898 Change-Id: I70889b4f5858f675e4692858de3dcb111c64c147 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do no log pbuffer creation failure as errorMichal Klocek2018-04-171-0/+1
| | | | | | | | | The pbuffer creation with egl can fail, however this is expexted if surfaceless egl is used. Task-number: QTBUG-65682 Change-Id: I0aefda0bec3d3b4943df20697b495dba83e012a7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add initialization of static bindings for egl and glxMichal Klocek2018-04-121-1/+78
| | | | | | | | | Use lazy binding for static bindings initialization, the same way we do in ozone. Task-number: QTBUG-65682 Change-Id: I51ecdfa3b7daca8b1345cf2c0c89a4ac6e25a7c9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix Windows ANGLE buildsAllan Sandfeld Jensen2018-04-071-1/+9
| | | | | | | | Move implementation of DirectCompositionSurfaceWin::IsHDRSupported() so OpenGL definitions doesn't conflict. Change-Id: Ib5d61b647b9a6ca00e8f9dae2dffb8cb72fa09c0 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Split GLSurfaceWGLQtMichal Klocek2018-04-041-71/+3
| | | | | | | | | | Refactor GLSurfaceWGLQt to speparte file. This class is not used by ozone, however is keept in ozone subdirecotry with other surface classes. Change-Id: I161582546b597912bc4c1c75ebbc0c1763aebed5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Split GLSurfaceQtMichal Klocek2018-04-041-506/+16
| | | | | | | | | Move GLSurfaceGLXQt and GLSurfaceEGLQt to own implementation files,so they can be reused easly by ozone backends. Change-Id: Ie403a941424343e13775866772bed709d7cbff6a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-151-0/+9
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-4/+4
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-02-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp src/core/download_manager_delegate_qt.h src/core/render_widget_host_view_qt.cpp src/core/web_contents_adapter.cpp src/webengine/api/qquickwebengineview.cpp tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp Change-Id: I2308414ce257ae5bb0fc9f6493aa111a267ff39b
| * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-241-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp Change-Id: Ica57e582a323c6bd014a64bb615dd9454e656548
| | * Fix incorrect GLX pbuffer attributes terminatorFrank Richter2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The glXCreatePbuffer() documentation states that the attributes list must be terminated with "None or NULL". However, GLX_NONE does not have a null value. Mesa is sensitive to this. Change-Id: I9606d95a6a0dadec446496abb8e0213950e3d700 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | | Adaptations for Chromium 62Allan Sandfeld Jensen2018-01-251-32/+82
|/ / | | | | | | | | Change-Id: I49cd3c419d4dd1180144c3c07bdd9a628ab73caa Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2017-09-291-1/+1
|\| | | | | | | Change-Id: I7094e85a7770303a2ae30baccbc484c04f33600e
| * Add LICENSE.ChromiumKai Koehne2017-09-201-1/+1
| | | | | | | | | | | | | | | | | | The mentioned LICENSE file is not available; add it under the name LICENSE.Chromium. Task-number: QTBUG-60006 Change-Id: Ib2b3cb64467046c7ba1f53b0bbe14c3ec5a5291d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2017-09-141-0/+6
|\| | | | | | | Change-Id: I0860a46b981c1f711bec45d7a495bcec2a80ee1f
| * Allow WebGL to work with a software OpenGL implementation on WindowsAlexandru Croitor2017-09-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A user can explicitly request software OpenGL rendering via opengl32sw.dll instead of Skia rendering, by passing the --enable-webgl-software-rendering command line argument. This will make sure not to disable GPU processing if and only if software OpenGL rendering is used on Windows (via QT_OPENGL=software environment variable, or the Qt::AA_UseSoftwareOpenGL attribute), so that WebGL is not disabled. Software OpenGL rendering will still use Skia on platforms other than Windows. Change-Id: I8b3601b144e09e3a732abfb74dbbf6f924889b5a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 60Alexandru Croitor2017-09-111-0/+5
| | | | | | | | | | | | Change-Id: I536258e22c2ec143f2fd3f1cbda229e0611b6af4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Adaptations for Chromium 59Allan Sandfeld Jensen2017-09-111-0/+10
| | | | | | | | | | Change-Id: I472053e316bfa782d0a6fb8903f4901be12247ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Graphics adaptations for Chromium 58Allan Sandfeld Jensen2017-06-141-1/+5
| | | | | | | | | | Change-Id: I66262ce7943bd5ba98defff5e4a33063b2ed0353 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Simple adaptations for Chromium 58Allan Sandfeld Jensen2017-06-141-1/+11
| | | | | | | | | | Change-Id: I7c2c85973b03fdbd2eafb5339f33a3758d53e924 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 57Allan Sandfeld Jensen2017-06-141-16/+21
|/ | | | | Change-Id: Ia2756c1e9b13839c2330bd98cf953d47cbdac0dd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Standardize override declarationAllan Sandfeld Jensen2017-04-211-18/+18
| | | | | | | | Update our overrides to Qt coding standard getting rid of Q_DECL_OVERRIDE and redundant virtual declarations. Change-Id: Id8b0750eb05c51fc8f50cac4000a811eebcbf918 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Adaptations for Chromium 56Allan Sandfeld Jensen2017-03-271-2/+13
| | | | | Change-Id: I78240d7956de4716757761fc6517f031b4adb822 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Fix OpenGL for embedded buildsAllan Sandfeld Jensen2017-03-201-2/+2
| | | | | | | | Sets the external ozone platform and make sure we don't set bad QT_LIBDIR defines for libEGL and libGLESv2 when not doing cross builds. Change-Id: I60eada3c93224a3aa3a105b007d669932516d331 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Simple adaptations to Chromium 55Allan Sandfeld Jensen2017-03-011-5/+20
| | | | | | | The simplest adaptations to API and build changes in Chromium 55 Change-Id: I923fa188690a04902492317807f72f006bcab9c6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Use surfaceless context if necessaryAkihiko Odaki2016-12-081-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.7.1' into 5.8.0Liang Qi2016-12-071-2/+3
|\ | | | | | | Change-Id: I4f73844c730d52b00194ab6ff4abe35c59f7ef68
| * Disable surfaceless context supportv5.7.1Michal Klocek2016-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | Using surfaceless EGL surface on imx6 embedded device crashes webengine with backtrace in gpu driver. Since this feature requires a bit more testing on embedded platforms disable support for the 5.7.1 release. Task-number: QTBUG-57290 Change-Id: I3ed5b6fc173d184486316a2c3d899a88d4b1de76 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-111-23/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/content_browser_client_qt.cpp src/core/content_browser_client_qt.h src/core/gl_surface_qt.cpp src/core/print_view_manager_qt.cpp src/core/web_contents_delegate_qt.cpp src/core/web_engine_context.cpp src/webengine/doc/src/qtwebengine-overview.qdoc src/webengine/doc/src/qtwebengine-platform-notes.qdoc src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp src/webenginewidgets/webenginewidgets.pro sync.profile Change-Id: I44495f4d899580c882d6b86d68d7f6b77c8e91f6
| * Make Linux QPA combinations more robustAllan Sandfeld Jensen2016-11-091-23/+32
| | | | | | | | | | | | | | | | | | | | | | Use resourceForIntegration to get egldisplay since not all QPA return a egldisplay for context (in particular xcb_egl). Implement EGL fallback for linux desktop builds, to make Wayland work without an X11 server present. Change-Id: Idcead42250fa00a36e50c082711f5618fd213556 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Adaptations to Chromium 53Allan Sandfeld Jensen2016-09-141-31/+41
| | | | | | | | | | Change-Id: I15053486edfd42ee607250b4f14fb6eaa325c959 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Adaptations to Chromium 52Allan Sandfeld Jensen2016-09-141-1/+0
| | | | | | | | | | Change-Id: Idf8a511ba26d263fd9d014d87d5e1101d706da71 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge branch '5.7' into devAllan Sandfeld Jensen2016-06-141-2/+80
|\| | | | | | | Change-Id: I1ecb615b8df1303c27b6609970502920123b3610
| * Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-06-111-2/+80
| |\ | | | | | | | | | Change-Id: Ib010ede9756fb02992a3276ae7ec90ef1ab56a00
| | * Add support for Khr_surfaceless_contextAkihiko Odaki2016-06-031-1/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a port of commit 4b0cac9dfeebb73f21a11e10e6a2bc7bddbe889b in Chromium for Qt WebEngine. The based commit says: > http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_surfaceless_context.txt > > This patch adds support in GLSurfaceEGL to be able to use > surfaceless context when supported by the drivers. This avoids > 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. Change-Id: I8378957931d79b691392b6fbe13082b8610b8fe6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix logging code in GLSurfaceQtEGL::Initialize()Akihiko Odaki2016-06-011-1/+1
| | | | | | | | | | | | | | | Change-Id: I98cb984548d833121d7e3102b9d89ccc7c8a11b6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix crashes due to qputenv being called after Chromium initialization.Alexandru Croitor2016-04-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qputenv() call inside gl_surface_qt.cpp, which is executed on a GpuChildThread, can reallocate the process environment structure, and it is possible that at the same time the main thread calls getenv, which will dereference a pointer to the freed environment structure, essentially causing a use-after-free crash. Make sure the qputenv() call happens before Chromium initialization starts, so no thread-race can occur. Change-Id: I4ecbdc8bf2abbe45f7d6c5d2633dc9fe27f51e66 Task-number: QTBUG-52124 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> (cherry picked from commit 76c61aa1400ef2def204c3732e30e08e40631e8d)
* | | Basic porting to Chromium 51Allan Sandfeld Jensen2016-06-011-4/+5
|/ / | | | | | | | | | | | | Trivial changes in methods, arguments and types. Change-Id: Ic707c376249f816268223e696ed5f6251df1f85f Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Fix crashes due to qputenv being called after Chromium initialization.Alexandru Croitor2016-03-311-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qputenv() call inside gl_surface_qt.cpp, which is executed on a GpuChildThread, can reallocate the process environment structure, and it is possible that at the same time the main thread calls getenv, which will dereference a pointer to the freed environment structure, essentially causing a use-after-free crash. Make sure the qputenv() call happens before Chromium initialization starts, so no thread-race can occur. Change-Id: I4ecbdc8bf2abbe45f7d6c5d2633dc9fe27f51e66 Task-number: QTBUG-52124 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Basic adaptation to Chromium 49Allan Sandfeld Jensen2016-03-071-2/+13
| | | | | | | | | | | | | | | | Converts types, callbacks and headers to match Chromium 49. Task-number: QTBUG-51173 Change-Id: I544ef46e187105e250fea1b48b72d2c81a906640 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Unify license header usage.Jani Heikkinen2016-02-011-11/+14
|/ | | | | | | | | Update files using old header.LGPL3 to use header.LGPL Update files using old header.FLD to use new header.FDL Update files using old header.BSD to use new header.BSD Change-Id: I36a67aaa8c3ca6c7946308defc9c03c3571a7d23 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Read egldisplay from QPAAllan Sandfeld Jensen2015-09-061-5/+0
| | | | | | | | Follow up to 6e6e2655bf03f2cc903f17d9e5283a81a4a837c2, we should get egldisplay from QPA, otherwise we end up with the wrong values. Change-Id: I668511a1ae9ab6f4f5132707ae03afc3fe3722ac Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Rebasing on Chromium 45Allan Sandfeld Jensen2015-08-251-2/+2
| | | | | | | Fixing the minor differences needed to work with Chromium 45. Change-Id: I5036b4b9a069d45e8dd37e24fab84cdfe5e67acc Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge branch '5.5' into 5.6Allan Sandfeld Jensen2015-08-181-6/+0
|\ | | | | | | Change-Id: I9977663123560a22f493b8c02d02de8897b38666
| * Fix crash on XCB GLES2 and WaylandAllan Sandfeld Jensen2015-08-121-6/+0
| | | | | | | | | | | | | | | | | | We can and must request the "egldisplay" from QPA, otherwise we get the wrong resource. Task-number: QTBUG-47301 Change-Id: I8bcd94415aa8f22b0d868ad751017f5babddf751 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Define DriverEGL::GetPlatformExtensions hereAllan Sandfeld Jensen2015-07-011-0/+16
| | | | | | | | | | | | | | We need access to Qt classes to extract the EGLDisplay. Change-Id: I4e57aa72f3f7e08a55bc5e9694389e35f258e039 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>