diff options
Diffstat (limited to 'src/core/ozone/gl_ozone_egl_qt.cpp')
-rw-r--r-- | src/core/ozone/gl_ozone_egl_qt.cpp | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp index a9b3da5e2..2fa86d79b 100644 --- a/src/core/ozone/gl_ozone_egl_qt.cpp +++ b/src/core/ozone/gl_ozone_egl_qt.cpp @@ -38,11 +38,13 @@ ****************************************************************************/ #if defined(USE_OZONE) - +#include "gl_ozone_egl_qt.h" +#include "gl_context_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 "ozone/gl_ozone_egl_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" @@ -53,12 +55,16 @@ #include <EGL/egl.h> #include <dlfcn.h> +#include <QtGui/qtgui-config.h> // for QT_NO_OPENGL + #ifndef QT_NO_OPENGL #include <QOpenGLContext> +QT_BEGIN_NAMESPACE Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); +QT_END_NAMESPACE #endif -namespace QtWebEngineCore { +namespace ui { base::NativeLibrary LoadLibrary(const base::FilePath& filename) { base::NativeLibraryLoadError error; @@ -103,6 +109,39 @@ bool GLOzoneEGLQt::LoadGLES2Bindings(gl::GLImplementation /*implementation*/) return true; } +bool GLOzoneEGLQt::InitializeGLOneOffPlatform() +{ + if (!gl::GLSurfaceEGLQt::InitializeOneOff()) { + LOG(ERROR) << "GLOzoneEGLQt::InitializeOneOff failed."; + return false; + } + return true; +} + +bool GLOzoneEGLQt::InitializeExtensionSettingsOneOffPlatform() +{ + return gl::GLSurfaceEGLQt::InitializeExtensionSettingsOneOff(); +} + +scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateViewGLSurface(gfx::AcceleratedWidget window) +{ + return nullptr; +} + +scoped_refptr<gl::GLSurface> GLOzoneEGLQt::CreateOffscreenGLSurface(const gfx::Size &size) +{ + scoped_refptr<gl::GLSurface> surface = new gl::GLSurfaceEGLQt(size); + if (surface->Initialize(gl::GLSurfaceFormat())) + return surface; + + surface = new gl::GLSurfacelessQtEGL(size); + if (surface->Initialize(gl::GLSurfaceFormat())) + return surface; + + LOG(WARNING) << "Failed to create offscreen GL surface"; + return nullptr; +} + intptr_t GLOzoneEGLQt::GetNativeDisplay() { static void *display = GLContextHelper::getNativeDisplay(); @@ -113,6 +152,6 @@ intptr_t GLOzoneEGLQt::GetNativeDisplay() return reinterpret_cast<intptr_t>(EGL_DEFAULT_DISPLAY); } -} // namespace QtWebEngineCore +} // namespace ui #endif // defined(USE_OZONE) |