Commit 6e49d844 authored by Michal Klocek's avatar Michal Klocek
Browse files

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: default avatarQt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
Showing with 171 additions and 71 deletions
......@@ -83,6 +83,7 @@ SOURCES = \
ozone/gl_ozone_qt.cpp \
ozone/gl_surface_egl_qt.cpp \
ozone/gl_surface_glx_qt.cpp \
ozone/gl_surface_wgl_qt.cpp \
ozone/ozone_platform_qt.cpp \
ozone/platform_window_qt.cpp \
ozone/surface_factory_qt.cpp \
......@@ -168,6 +169,7 @@ HEADERS = \
ozone/gl_ozone_qt.h \
ozone/gl_surface_egl_qt.h \
ozone/gl_surface_glx_qt.h \
ozone/gl_surface_wgl_qt.h \
ozone/ozone_platform_qt.h \
ozone/platform_window_qt.h \
ozone/surface_factory_qt.h \
......
......@@ -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;
......
/****************************************************************************
**
** 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)
/****************************************************************************
**
** 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment