diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-06-10 13:57:42 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-09 15:19:10 +0200 |
commit | 455619d3875e0e0e7a03734806d61c7998735cd4 (patch) | |
tree | 3e2558da4525819ad9bd5e46ee9f471c73aa8d5f /src/core/ozone | |
parent | cd61343ceb4a3de8ce16082917a2f197b2481d08 (diff) |
Adaptations for Chromium 83
Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/ozone')
-rw-r--r-- | src/core/ozone/gl_context_qt.cpp | 3 | ||||
-rw-r--r-- | src/core/ozone/gl_ozone_egl_qt.cpp | 32 | ||||
-rw-r--r-- | src/core/ozone/gl_ozone_egl_qt.h | 2 | ||||
-rw-r--r-- | src/core/ozone/gl_surface_egl_qt.cpp | 3 | ||||
-rw-r--r-- | src/core/ozone/gl_surface_qt.cpp | 11 | ||||
-rw-r--r-- | src/core/ozone/surface_factory_qt.cpp | 4 |
6 files changed, 30 insertions, 25 deletions
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp index 10347bdc7..9a24f6bf4 100644 --- a/src/core/ozone/gl_context_qt.cpp +++ b/src/core/ozone/gl_context_qt.cpp @@ -123,7 +123,8 @@ void* GLContextHelper::getEGLConfig() void* GLContextHelper::getGlXConfig() { - return resourceForContext(QByteArrayLiteral("glxconfig")); + QByteArray resource = QByteArrayLiteral("glxconfig"); + return resourceForContext(resource); } void* GLContextHelper::getEGLDisplay() diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp index c692920cf..c33570d44 100644 --- a/src/core/ozone/gl_ozone_egl_qt.cpp +++ b/src/core/ozone/gl_ozone_egl_qt.cpp @@ -38,13 +38,21 @@ ****************************************************************************/ #if defined(USE_OZONE) -#include "gl_ozone_egl_qt.h" +#include <QtCore/qobject.h> +#include <QtGui/qtgui-config.h> + +#if QT_CONFIG(opengl) +#include <QOpenGLContext> +QT_BEGIN_NAMESPACE +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); +QT_END_NAMESPACE +#endif + #include "gl_context_qt.h" +#include "gl_ozone_egl_qt.h" #include "gl_surface_egl_qt.h" #include "base/files/file_path.h" #include "base/native_library.h" -#include "gl_context_qt.h" -#include "gl_ozone_egl_qt.h" #include "ui/gl/gl_context_egl.h" #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_surface.h" @@ -55,15 +63,6 @@ #include <EGL/egl.h> #include <dlfcn.h> -#include <QtGui/qtgui-config.h> - -#if QT_CONFIG(opengl) -#include <QOpenGLContext> -QT_BEGIN_NAMESPACE -Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); -QT_END_NAMESPACE -#endif - namespace ui { base::NativeLibrary LoadLibrary(const base::FilePath& filename) { @@ -142,14 +141,11 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::S return nullptr; } -intptr_t GLOzoneEGLQt::GetNativeDisplay() +gl::EGLDisplayPlatform GLOzoneEGLQt::GetNativeDisplay() { static void *display = GLContextHelper::getNativeDisplay(); - - if (display) - return reinterpret_cast<intptr_t>(display); - - return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY); + static gl::EGLDisplayPlatform platform(display ? reinterpret_cast<intptr_t>(display) : EGL_DEFAULT_DISPLAY); + return platform; } } // namespace ui diff --git a/src/core/ozone/gl_ozone_egl_qt.h b/src/core/ozone/gl_ozone_egl_qt.h index c24d03a81..c55ba232c 100644 --- a/src/core/ozone/gl_ozone_egl_qt.h +++ b/src/core/ozone/gl_ozone_egl_qt.h @@ -58,7 +58,7 @@ public: protected: // Returns native platform display handle. This is used to obtain the EGL // display connection for the native display. - intptr_t GetNativeDisplay() override; + gl::EGLDisplayPlatform GetNativeDisplay() override; // Sets up GL bindings for the native surface. bool LoadGLES2Bindings(gl::GLImplementation implementation) override; diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp index 31126eab9..8e8e66f63 100644 --- a/src/core/ozone/gl_surface_egl_qt.cpp +++ b/src/core/ozone/gl_surface_egl_qt.cpp @@ -194,8 +194,7 @@ bool GLSurfaceEGL::HasEGLExtension(const char* name) { return ExtensionsContain(GetEGLExtensions(), name); } - -bool GLSurfaceEGL::InitializeOneOff(EGLNativeDisplayType /*native_display*/) +bool GLSurfaceEGL::InitializeOneOff(gl::EGLDisplayPlatform /*native_display*/) { return GLSurfaceEGLQt::InitializeOneOff(); } diff --git a/src/core/ozone/gl_surface_qt.cpp b/src/core/ozone/gl_surface_qt.cpp index 4be17f12b..90f486532 100644 --- a/src/core/ozone/gl_surface_qt.cpp +++ b/src/core/ozone/gl_surface_qt.cpp @@ -243,6 +243,17 @@ bool DirectCompositionSurfaceWin::IsSwapChainTearingSupported() { return false; } + +bool DirectCompositionSurfaceWin::AreOverlaysSupported() +{ + return false; +} + +UINT DirectCompositionSurfaceWin::GetOverlaySupportFlags(DXGI_FORMAT format) +{ + Q_UNUSED(format); + return 0; +} } // namespace gl #endif #endif // !defined(OS_MACOSX) diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp index 5420b4809..533a97abc 100644 --- a/src/core/ozone/surface_factory_qt.cpp +++ b/src/core/ozone/surface_factory_qt.cpp @@ -45,18 +45,16 @@ #endif #include "ui/gl/gl_surface.h" -#include <QGuiApplication> #if defined(USE_OZONE) - #include "ozone/gl_ozone_egl_qt.h" #include "ozone/surface_factory_qt.h" #include "ui/gl/gl_surface.h" + namespace QtWebEngineCore { SurfaceFactoryQt::SurfaceFactoryQt() { - Q_ASSERT(qApp); #if defined(USE_GLX) if (GLContextHelper::getGlXConfig()) { m_impl = gl::kGLImplementationDesktopGL; |