summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowseglcontext.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-18 15:16:30 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-26 15:11:40 +0200
commit752497910b67b2a1a80560840ca44548d8893434 (patch)
tree541501c9abfd97c3d2fa450d2e6abb60582c4420 /src/plugins/platforms/windows/qwindowseglcontext.h
parent7db527dbdd911c79f31425d099d1fc9c63e42453 (diff)
Remove ANGLE
This marks the end of EGL and OpenGL ES support on Windows. The concepts of -opengl dynamic, -opengl desktop, QT_OPENGL=software, etc. remain unchanged, with the exception of the disapperance of everything ANGLE related. CMake builds now work identically to qmake on Windows: they default to 'dynamic' OpenGL on Windows, unless -DINPUT_opengl=desktop is specified. On Windows, Qt 6 is expected to default to the "dynamic" OpenGL model by default, just like Qt 5.15. This can be changed by switching to "desktop" OpenGL, which will link to opengl32 (publicly, so other libs and applications will do so as well) and disallows using another OpenGL DLL. The "dynamic" mode is essential still because the fallback to a software rasterizer, such as the opengl32sw.dll we ship with the Qt packages, has to to work exactly like in Qt 5, the removal of ANGLE does not change this concept in any way (except of course that the middle option of using ANGLE is now gone) When it comes to the windows plugin's OpenGL blacklist feature, it works like before and accepts the ANGLE/D3D related keywords. They will then be ignored. Similarly, requesting QT_OPENGL=angle is ignored (but will show a warning). The D3D11 and DXGI configure time tests are removed: Qt 5.14 already depends on D3D 11.1 and DXGI 1.3 headers being available unconditionally on Win32 (in QRhi's D3D11 backend). No need to test for these. [ChangeLog][Windows] ANGLE is no longer included with Qt. Dynamic OpenGL builds work like before but ANGLE is no longer an option. OpenGL proper or an alternative opengl32 implementation are the two remaining options now. Attempting to set QT_OPENGL=angle or Qt::AA_UseOpenGLES will have no effect on Windows. Fixes: QTBUG-79103 Change-Id: Ia404e0d07f3fe191b27434d863c81180112ecb3b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowseglcontext.h')
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.h176
1 files changed, 0 insertions, 176 deletions
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.h b/src/plugins/platforms/windows/qwindowseglcontext.h
deleted file mode 100644
index d96e266159..0000000000
--- a/src/plugins/platforms/windows/qwindowseglcontext.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins 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 QWINDOWSEGLCONTEXT_H
-#define QWINDOWSEGLCONTEXT_H
-
-#include "qwindowsopenglcontext.h"
-#include "qwindowsopengltester.h"
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-struct QWindowsLibEGL
-{
- bool init();
-
- EGLint (EGLAPIENTRY * eglGetError)(void);
- EGLDisplay (EGLAPIENTRY * eglGetDisplay)(EGLNativeDisplayType display_id);
- EGLBoolean (EGLAPIENTRY * eglInitialize)(EGLDisplay dpy, EGLint *major, EGLint *minor);
- EGLBoolean (EGLAPIENTRY * eglTerminate)(EGLDisplay dpy);
- EGLBoolean (EGLAPIENTRY * eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size,
- EGLint *num_config);
- EGLBoolean (EGLAPIENTRY * eglGetConfigAttrib)(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value);
- EGLSurface (EGLAPIENTRY * eglCreateWindowSurface)(EGLDisplay dpy, EGLConfig config,
- EGLNativeWindowType win,
- const EGLint *attrib_list);
- EGLSurface (EGLAPIENTRY * eglCreatePbufferSurface)(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list);
- EGLBoolean (EGLAPIENTRY * eglDestroySurface)(EGLDisplay dpy, EGLSurface surface);
- EGLBoolean (EGLAPIENTRY * eglBindAPI)(EGLenum api);
- EGLBoolean (EGLAPIENTRY * eglSwapInterval)(EGLDisplay dpy, EGLint interval);
- EGLContext (EGLAPIENTRY * eglCreateContext)(EGLDisplay dpy, EGLConfig config,
- EGLContext share_context,
- const EGLint *attrib_list);
- EGLBoolean (EGLAPIENTRY * eglDestroyContext)(EGLDisplay dpy, EGLContext ctx);
- EGLBoolean (EGLAPIENTRY * eglMakeCurrent)(EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext ctx);
- EGLContext (EGLAPIENTRY * eglGetCurrentContext)(void);
- EGLSurface (EGLAPIENTRY * eglGetCurrentSurface)(EGLint readdraw);
- EGLDisplay (EGLAPIENTRY * eglGetCurrentDisplay)(void);
- EGLBoolean (EGLAPIENTRY * eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface);
- QFunctionPointer (EGLAPIENTRY *eglGetProcAddress)(const char *procname);
-
- EGLDisplay (EGLAPIENTRY * eglGetPlatformDisplayEXT)(EGLenum platform, void *native_display, const EGLint *attrib_list);
-
-private:
-#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
- void *resolve(const char *name);
- HMODULE m_lib;
-#endif
-};
-
-struct QWindowsLibGLESv2
-{
- bool init();
-
-#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
- void *moduleHandle() const { return m_lib; }
-#else
- void *moduleHandle() const { return nullptr; }
-#endif
-
- const GLubyte * (APIENTRY * glGetString)(GLenum name);
-
-#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
- void *resolve(const char *name);
-private:
- HMODULE m_lib;
-#endif
-};
-
-class QWindowsEGLStaticContext : public QWindowsStaticOpenGLContext
-{
- Q_DISABLE_COPY_MOVE(QWindowsEGLStaticContext)
-
-public:
- static QWindowsEGLStaticContext *create(QWindowsOpenGLTester::Renderers preferredType);
- ~QWindowsEGLStaticContext() override;
-
- EGLDisplay display() const { return m_display; }
-
- QWindowsOpenGLContext *createContext(QOpenGLContext *context) override;
- void *moduleHandle() const override { return libGLESv2.moduleHandle(); }
- QOpenGLContext::OpenGLModuleType moduleType() const override { return QOpenGLContext::LibGLES; }
-
- void *createWindowSurface(void *nativeWindow, void *nativeConfig, int *err) override;
- void destroyWindowSurface(void *nativeSurface) override;
-
- QSurfaceFormat formatFromConfig(EGLDisplay display, EGLConfig config, const QSurfaceFormat &referenceFormat);
-
- static QWindowsLibEGL libEGL;
- static QWindowsLibGLESv2 libGLESv2;
-
-private:
- explicit QWindowsEGLStaticContext(EGLDisplay display);
- static bool initializeAngle(QWindowsOpenGLTester::Renderers preferredType, HDC dc,
- EGLDisplay *display, EGLint *major, EGLint *minor);
-
- const EGLDisplay m_display;
-};
-
-class QWindowsEGLContext : public QWindowsOpenGLContext
-{
-public:
- QWindowsEGLContext(QWindowsEGLStaticContext *staticContext,
- const QSurfaceFormat &format,
- QPlatformOpenGLContext *share);
- ~QWindowsEGLContext() override;
-
- bool makeCurrent(QPlatformSurface *surface) override;
- void doneCurrent() override;
- void swapBuffers(QPlatformSurface *surface) override;
- QFunctionPointer getProcAddress(const char *procName) override;
-
- QSurfaceFormat format() const override { return m_format; }
- bool isSharing() const override { return m_shareContext != EGL_NO_CONTEXT; }
- bool isValid() const override { return m_eglContext != EGL_NO_CONTEXT; }
-
- void *nativeContext() const override { return m_eglContext; }
- void *nativeDisplay() const override { return m_eglDisplay; }
- void *nativeConfig() const override { return m_eglConfig; }
-
-private:
- EGLConfig chooseConfig(const QSurfaceFormat &format);
-
- QWindowsEGLStaticContext *m_staticContext;
- EGLContext m_eglContext;
- EGLContext m_shareContext;
- EGLDisplay m_eglDisplay;
- EGLConfig m_eglConfig;
- QSurfaceFormat m_format;
- EGLenum m_api = EGL_OPENGL_ES_API;
- int m_swapInterval = -1;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWINDOWSEGLCONTEXT_H