diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-03-22 15:56:45 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2018-04-04 16:34:16 +0000 |
commit | 6e49d8444e932ab1c46f72f25443d8866f6c8e9e (patch) | |
tree | 2ff2bfd128e3ab9245160cb6de9f1e9a0ec72180 /src/core/gl_surface_qt.cpp | |
parent | 5c46e85c6683e08b8c2a839d4f08f6d8d8755281 (diff) |
Split GLSurfaceWGLQt
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>
Diffstat (limited to 'src/core/gl_surface_qt.cpp')
-rw-r--r-- | src/core/gl_surface_qt.cpp | 74 |
1 files changed, 3 insertions, 71 deletions
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index 54f220f8d..b41ce1d29 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -60,7 +60,7 @@ #include "ui/gl/init/gl_factory.h" #if defined(OS_WIN) -#include "ui/gl/gl_surface_wgl.h" +#include "ozone/gl_surface_wgl_qt.h" #include "ui/gl/gl_context_wgl.h" #include "ui/gl/vsync_provider_win.h" #endif @@ -85,74 +85,6 @@ GLSurfaceQt::~GLSurfaceQt() { } -#if defined(OS_WIN) - -class GLSurfaceQtWGL: public GLSurfaceQt { -public: - explicit GLSurfaceQtWGL(const gfx::Size& size); - - static bool InitializeOneOff(); - - bool Initialize(GLSurfaceFormat format) override; - void Destroy() override; - void *GetHandle() override; - void *GetDisplay() override; - void *GetConfig() override; - -protected: - ~GLSurfaceQtWGL(); - -private: - scoped_refptr<PbufferGLSurfaceWGL> m_surfaceBuffer; - DISALLOW_COPY_AND_ASSIGN(GLSurfaceQtWGL); -}; - -GLSurfaceQtWGL::GLSurfaceQtWGL(const gfx::Size& size) - : GLSurfaceQt(size), - m_surfaceBuffer(0) -{ -} - -GLSurfaceQtWGL::~GLSurfaceQtWGL() -{ - Destroy(); -} - -bool GLSurfaceQtWGL::InitializeOneOff() -{ - return GLSurfaceWGL::InitializeOneOff(); -} - -bool GLSurfaceQtWGL::Initialize(GLSurfaceFormat format) -{ - m_surfaceBuffer = new PbufferGLSurfaceWGL(m_size); - m_format = format; - - return m_surfaceBuffer->Initialize(format); -} - -void GLSurfaceQtWGL::Destroy() -{ - m_surfaceBuffer = 0; -} - -void *GLSurfaceQtWGL::GetHandle() -{ - return m_surfaceBuffer->GetHandle(); -} - -void *GLSurfaceQtWGL::GetDisplay() -{ - return m_surfaceBuffer->GetDisplay(); -} - -void *GLSurfaceQtWGL::GetConfig() -{ - return m_surfaceBuffer->GetConfig(); -} - -#endif // defined(OS_WIN) - GLSurfaceQt::GLSurfaceQt() { } @@ -219,7 +151,7 @@ bool InitializeGLOneOffPlatform() if (GetGLImplementation() == kGLImplementationDesktopGL) { #if defined(OS_WIN) - return GLSurfaceQtWGL::InitializeOneOff(); + return GLSurfaceWGLQt::InitializeOneOff(); #elif defined(USE_X11) if (GLSurfaceGLXQt::InitializeOneOff()) return true; @@ -247,7 +179,7 @@ CreateOffscreenGLSurfaceWithFormat(const gfx::Size& size, GLSurfaceFormat format case kGLImplementationDesktopGLCoreProfile: case kGLImplementationDesktopGL: { #if defined(OS_WIN) - surface = new GLSurfaceQtWGL(size); + surface = new GLSurfaceWGLQt(size); if (surface->Initialize(format)) return surface; break; |