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/ozone | |
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/ozone')
-rw-r--r-- | src/core/ozone/gl_surface_wgl_qt.cpp | 92 | ||||
-rw-r--r-- | src/core/ozone/gl_surface_wgl_qt.h | 74 |
2 files changed, 166 insertions, 0 deletions
diff --git a/src/core/ozone/gl_surface_wgl_qt.cpp b/src/core/ozone/gl_surface_wgl_qt.cpp new file mode 100644 index 000000000..7c9e87b86 --- /dev/null +++ b/src/core/ozone/gl_surface_wgl_qt.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#if defined(OS_WIN) + +#include "gl_surface_wgl_qt.h" +#include "ui/gl/gl_surface_wgl.h" + +namespace gl { + +GLSurfaceWGLQt::GLSurfaceWGLQt(const gfx::Size& size) + : GLSurfaceQt(size), + m_surfaceBuffer(nullptr) +{ +} + +GLSurfaceWGLQt::~GLSurfaceWGLQt() +{ + Destroy(); +} + +bool GLSurfaceWGLQt::InitializeOneOff() +{ + return GLSurfaceWGL::InitializeOneOff(); +} + +bool GLSurfaceWGLQt::Initialize(GLSurfaceFormat format) +{ + m_surfaceBuffer = new PbufferGLSurfaceWGL(m_size); + m_format = format; + return m_surfaceBuffer->Initialize(format); +} + +void GLSurfaceWGLQt::Destroy() +{ + m_surfaceBuffer = nullptr; +} + +void *GLSurfaceWGLQt::GetHandle() +{ + return m_surfaceBuffer->GetHandle(); +} + +void *GLSurfaceWGLQt::GetDisplay() +{ + return m_surfaceBuffer->GetDisplay(); +} + +void *GLSurfaceWGLQt::GetConfig() +{ + return m_surfaceBuffer->GetConfig(); +} + +} //namespace gl + +#endif // defined(OS_WIN) diff --git a/src/core/ozone/gl_surface_wgl_qt.h b/src/core/ozone/gl_surface_wgl_qt.h new file mode 100644 index 000000000..2b562b61b --- /dev/null +++ b/src/core/ozone/gl_surface_wgl_qt.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GL_SURFACE_WGL_QT_H +#define GL_SURFACE_WGL_QT_H + +#include "gl_surface_qt.h" + +#if defined(OS_WIN) + +namespace gl { + +class PbufferGLSurfaceWGL; + +class GLSurfaceWGLQt: public GLSurfaceQt { +public: + explicit GLSurfaceWGLQt(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: + ~GLSurfaceWGLQt(); + +private: + scoped_refptr<PbufferGLSurfaceWGL> m_surfaceBuffer; + DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGLQt); +}; + +} +#endif // defined(OS_WIN) +#endif // GL_SURFACE_WGL_QT_H + |