summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/CMakeLists.txt27
-rw-r--r--src/opengl/doc/qtopengl.qdocconf16
-rw-r--r--src/opengl/doc/snippets/CMakeLists.txt5
-rw-r--r--src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp59
-rw-r--r--src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp51
-rw-r--r--src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp51
-rw-r--r--src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp51
-rw-r--r--src/opengl/doc/src/dontdocument.qdoc28
-rw-r--r--src/opengl/doc/src/qt6-changes.qdoc30
-rw-r--r--src/opengl/doc/src/qtopengl-examples.qdoc30
-rw-r--r--src/opengl/doc/src/qtopengl-index.qdoc69
-rw-r--r--src/opengl/doc/src/qtopengl-module.qdoc28
-rw-r--r--src/opengl/qopengl2pexvertexarray.cpp40
-rw-r--r--src/opengl/qopengl2pexvertexarray_p.h42
-rw-r--r--src/opengl/qopenglbuffer.cpp74
-rw-r--r--src/opengl/qopenglbuffer.h48
-rw-r--r--src/opengl/qopenglcompositor.cpp172
-rw-r--r--src/opengl/qopenglcompositor_p.h62
-rw-r--r--src/opengl/qopenglcompositorbackingstore.cpp139
-rw-r--r--src/opengl/qopenglcompositorbackingstore_p.h50
-rw-r--r--src/opengl/qopenglcustomshaderstage.cpp42
-rw-r--r--src/opengl/qopenglcustomshaderstage_p.h41
-rw-r--r--src/opengl/qopengldebug.cpp54
-rw-r--r--src/opengl/qopengldebug.h46
-rw-r--r--src/opengl/qopenglengineshadermanager.cpp65
-rw-r--r--src/opengl/qopenglengineshadermanager_p.h42
-rw-r--r--src/opengl/qopenglengineshadersource_p.h40
-rw-r--r--src/opengl/qopenglframebufferobject.cpp111
-rw-r--r--src/opengl/qopenglframebufferobject.h42
-rw-r--r--src/opengl/qopenglframebufferobject_p.h45
-rw-r--r--src/opengl/qopenglfunctions_1_0.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_0.h43
-rw-r--r--src/opengl/qopenglfunctions_1_1.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_1.h43
-rw-r--r--src/opengl/qopenglfunctions_1_2.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_2.h43
-rw-r--r--src/opengl/qopenglfunctions_1_3.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_3.h43
-rw-r--r--src/opengl/qopenglfunctions_1_4.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_4.h43
-rw-r--r--src/opengl/qopenglfunctions_1_5.cpp41
-rw-r--r--src/opengl/qopenglfunctions_1_5.h43
-rw-r--r--src/opengl/qopenglfunctions_2_0.cpp42
-rw-r--r--src/opengl/qopenglfunctions_2_0.h45
-rw-r--r--src/opengl/qopenglfunctions_2_1.cpp42
-rw-r--r--src/opengl/qopenglfunctions_2_1.h45
-rw-r--r--src/opengl/qopenglfunctions_3_0.cpp43
-rw-r--r--src/opengl/qopenglfunctions_3_0.h47
-rw-r--r--src/opengl/qopenglfunctions_3_1.cpp41
-rw-r--r--src/opengl/qopenglfunctions_3_1.h43
-rw-r--r--src/opengl/qopenglfunctions_3_2_compatibility.cpp43
-rw-r--r--src/opengl/qopenglfunctions_3_2_compatibility.h47
-rw-r--r--src/opengl/qopenglfunctions_3_2_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_3_2_core.h41
-rw-r--r--src/opengl/qopenglfunctions_3_3_compatibility.cpp42
-rw-r--r--src/opengl/qopenglfunctions_3_3_compatibility.h45
-rw-r--r--src/opengl/qopenglfunctions_3_3_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_3_3_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_0_compatibility.cpp42
-rw-r--r--src/opengl/qopenglfunctions_4_0_compatibility.h45
-rw-r--r--src/opengl/qopenglfunctions_4_0_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_0_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_1_compatibility.cpp42
-rw-r--r--src/opengl/qopenglfunctions_4_1_compatibility.h45
-rw-r--r--src/opengl/qopenglfunctions_4_1_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_1_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_2_compatibility.cpp42
-rw-r--r--src/opengl/qopenglfunctions_4_2_compatibility.h45
-rw-r--r--src/opengl/qopenglfunctions_4_2_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_2_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_3_compatibility.cpp42
-rw-r--r--src/opengl/qopenglfunctions_4_3_compatibility.h45
-rw-r--r--src/opengl/qopenglfunctions_4_3_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_3_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_4_compatibility.cpp39
-rw-r--r--src/opengl/qopenglfunctions_4_4_compatibility.h43
-rw-r--r--src/opengl/qopenglfunctions_4_4_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_4_core.h43
-rw-r--r--src/opengl/qopenglfunctions_4_5_compatibility.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_5_compatibility.h106
-rw-r--r--src/opengl/qopenglfunctions_4_5_core.cpp41
-rw-r--r--src/opengl/qopenglfunctions_4_5_core.h106
-rw-r--r--src/opengl/qopenglfunctions_es2.cpp40
-rw-r--r--src/opengl/qopenglfunctions_es2.h40
-rw-r--r--src/opengl/qopenglgradientcache.cpp40
-rw-r--r--src/opengl/qopenglgradientcache_p.h40
-rw-r--r--src/opengl/qopenglpaintdevice.cpp40
-rw-r--r--src/opengl/qopenglpaintdevice.h40
-rw-r--r--src/opengl/qopenglpaintdevice_p.h41
-rw-r--r--src/opengl/qopenglpaintengine.cpp171
-rw-r--r--src/opengl/qopenglpaintengine_p.h101
-rw-r--r--src/opengl/qopenglpixeltransferoptions.cpp41
-rw-r--r--src/opengl/qopenglpixeltransferoptions.h40
-rw-r--r--src/opengl/qopenglqueryhelper_p.h40
-rw-r--r--src/opengl/qopenglshadercache_p.h41
-rw-r--r--src/opengl/qopenglshaderprogram.cpp61
-rw-r--r--src/opengl/qopenglshaderprogram.h41
-rw-r--r--src/opengl/qopengltexture.cpp78
-rw-r--r--src/opengl/qopengltexture.h40
-rw-r--r--src/opengl/qopengltexture_p.h40
-rw-r--r--src/opengl/qopengltextureblitter.cpp235
-rw-r--r--src/opengl/qopengltextureblitter.h41
-rw-r--r--src/opengl/qopengltexturecache.cpp92
-rw-r--r--src/opengl/qopengltexturecache_p.h62
-rw-r--r--src/opengl/qopengltextureglyphcache.cpp63
-rw-r--r--src/opengl/qopengltextureglyphcache_p.h40
-rw-r--r--src/opengl/qopengltexturehelper.cpp40
-rw-r--r--src/opengl/qopengltexturehelper_p.h41
-rw-r--r--src/opengl/qopengltextureuploader.cpp40
-rw-r--r--src/opengl/qopengltextureuploader_p.h40
-rw-r--r--src/opengl/qopengltimerquery.cpp42
-rw-r--r--src/opengl/qopengltimerquery.h40
-rw-r--r--src/opengl/qopenglversionfunctions.cpp45
-rw-r--r--src/opengl/qopenglversionfunctions.h61
-rw-r--r--src/opengl/qopenglversionfunctions_p.h41
-rw-r--r--src/opengl/qopenglversionfunctionsfactory.cpp43
-rw-r--r--src/opengl/qopenglversionfunctionsfactory.h41
-rw-r--r--src/opengl/qopenglversionprofile.cpp40
-rw-r--r--src/opengl/qopenglversionprofile.h40
-rw-r--r--src/opengl/qopenglvertexarrayobject.cpp49
-rw-r--r--src/opengl/qopenglvertexarrayobject.h40
-rw-r--r--src/opengl/qopenglvertexarrayobject_p.h41
-rw-r--r--src/opengl/qopenglwindow.cpp65
-rw-r--r--src/opengl/qopenglwindow.h40
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.cpp465
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.h87
-rw-r--r--src/opengl/qtopengl.tracepoints12
-rw-r--r--src/opengl/qtopenglglobal.h40
-rw-r--r--src/opengl/qvkconvenience.cpp40
-rw-r--r--src/opengl/qvkconvenience_p.h41
130 files changed, 1277 insertions, 5644 deletions
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index 03ace0cad7..825e4cb71b 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from opengl.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## OpenGL Module:
@@ -25,16 +26,20 @@ qt_internal_add_module(OpenGL
qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h
qopengltexturehelper.cpp qopengltexturehelper_p.h
qopengltextureuploader.cpp qopengltextureuploader_p.h
+ qopengltimerquery.h
qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h
qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h
qopenglversionprofile.cpp qopenglversionprofile.h
- qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h
+ qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h qopenglvertexarrayobject_p.h
qopenglwindow.cpp qopenglwindow.h
- qplatformbackingstoreopenglsupport.cpp qplatformbackingstoreopenglsupport.h
qtopenglglobal.h
+ NO_UNITY_BUILD_SOURCES
+ qopengltextureblitter.cpp # qDebug()<< ambiguities
DEFINES
+ QT_NO_CONTEXTLESS_CONNECT
QT_NO_FOREACH
QT_NO_USING_NAMESPACE
+ QT_USE_NODISCARD_FILE_OPEN
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
@@ -50,6 +55,11 @@ qt_internal_add_module(OpenGL
## Scopes:
#####################################################################
+qt_internal_extend_target(OpenGL CONDITION APPLE
+ NO_UNITY_BUILD_SOURCES
+ qopenglversionfunctionsfactory.cpp
+)
+
qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
SOURCES
qopenglfunctions_es2.cpp qopenglfunctions_es2.h
@@ -84,7 +94,7 @@ qt_internal_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h
qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h
qopenglqueryhelper_p.h
- qopengltimerquery.cpp qopengltimerquery.h
+ qopengltimerquery.cpp
)
qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_vulkan
@@ -102,9 +112,12 @@ qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_egl
qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
)
-
-qt_internal_create_tracepoints(OpenGL qtopengl.tracepoints)
+qt_internal_generate_tracepoints(OpenGL opengl
+ SOURCES
+ qopenglframebufferobject.cpp
+ qopenglpaintengine.cpp
+ qopengltexturecache.cpp
+)
qt_internal_add_docs(OpenGL
doc/qtopengl.qdocconf
)
-
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 4073bd140e..7af173aac8 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -15,18 +15,17 @@ project = QtOpenGL
# <rootdir>/examples.
# Paths are relative to the location of this file.
-headerdirs += .. \
- ../../openglwidgets
-sourcedirs += .. \
- ../../openglwidgets \
- ../../../examples/opengl/doc/src
+{sourcedirs,headerdirs} += \
+ .. \
+ ../../openglwidgets
+
exampledirs += ../../../examples/opengl \
. \
snippets \
.. \
../../gui/doc/snippets
-imagedirs += images \
- ../../../examples/opengl/doc/images
+
+imagedirs += images
depends += qtcore qtgui qtwidgets qtdoc qmake qtcmake qtquick
@@ -64,3 +63,6 @@ qhp.QtOpenGL.subprojects.classes.sortPages = true
navigation.landingpage = "Qt OpenGL"
navigation.cppclassespage = "Qt OpenGL C++ Classes"
+
+# Enforce zero documentation warnings
+warninglimit = 0
diff --git a/src/opengl/doc/snippets/CMakeLists.txt b/src/opengl/doc/snippets/CMakeLists.txt
index 28b641adfd..419e0923e0 100644
--- a/src/opengl/doc/snippets/CMakeLists.txt
+++ b/src/opengl/doc/snippets/CMakeLists.txt
@@ -1,4 +1,7 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
#! [cmake_use]
-find_package(Qt6 COMPONENTS OpenGL REQUIRED)
+find_package(Qt6 REQUIRED COMPONENTS OpenGL)
target_link_libraries(mytarget PRIVATE Qt6::OpenGL)
#! [cmake_use]
diff --git a/src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp b/src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp
index 633a413b4f..f2c26e0bb8 100644
--- a/src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp
+++ b/src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
class MyGLWidget : public QOpenGLWidget
@@ -173,9 +126,14 @@ void MyGLWidget::initializeGL()
//! [4]
//! [5]
+MyGLWidget::~MyGLWidget()
+{
+ cleanup();
+}
+
void MyGLWidget::initializeGL()
{
- // context() and QOpenGLContext::currentContext() are equivalent when called from initializeGL or paintGL.
+ ...
connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &MyGLWidget::cleanup);
}
@@ -186,6 +144,7 @@ void MyGLWidget::cleanup()
m_texture = 0;
...
doneCurrent();
+ disconnect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &MyGLWidget::cleanup);
}
//! [5]
diff --git a/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp b/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp
index bd768b1ed7..f20eb3493a 100644
--- a/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp
+++ b/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtOpenGL/QOpenGLBuffer>
namespace src_gui_opengl_qopenglbuffer {
diff --git a/src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp b/src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp
index 241450c23a..bb5c212205 100644
--- a/src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp
+++ b/src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QOpenGLContext>
#include <QSurfaceFormat>
#include <QWidget>
diff --git a/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp b/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp
index 131936ed3f..de62069fda 100644
--- a/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp
+++ b/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QColor>
#include <QString>
#include <QtOpenGL/QOpenGLShader>
diff --git a/src/opengl/doc/src/dontdocument.qdoc b/src/opengl/doc/src/dontdocument.qdoc
index 72e997d933..b933f39982 100644
--- a/src/opengl/doc/src/dontdocument.qdoc
+++ b/src/opengl/doc/src/dontdocument.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\dontdocument (QOpenGLVersionStatus
diff --git a/src/opengl/doc/src/qt6-changes.qdoc b/src/opengl/doc/src/qt6-changes.qdoc
index c4cb6d0220..e227476868 100644
--- a/src/opengl/doc/src/qt6-changes.qdoc
+++ b/src/opengl/doc/src/qt6-changes.qdoc
@@ -1,35 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page opengl-changes-qt6.html
\title Changes to Qt OpenGL
\ingroup changes-qt-5-to-6
- \brief Migrate Qt OpenGL to Qt 6.
+ \brief QOpenGL classes migrated, QOpenGLWidget class has been moved to Qt OpenGL Widgets.
Qt 6 is a result of the conscious effort to make the framework more
efficient and easy to use.
diff --git a/src/opengl/doc/src/qtopengl-examples.qdoc b/src/opengl/doc/src/qtopengl-examples.qdoc
index 8770d6247e..3a98c16c70 100644
--- a/src/opengl/doc/src/qtopengl-examples.qdoc
+++ b/src/opengl/doc/src/qtopengl-examples.qdoc
@@ -1,33 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\ingroup all-examples
- \title OpenGL Examples from the Qt OpenGL module
+ \title Qt OpenGL Examples
\brief Accessing OpenGL from Qt.
\group examples-widgets-opengl
diff --git a/src/opengl/doc/src/qtopengl-index.qdoc b/src/opengl/doc/src/qtopengl-index.qdoc
index 4b975758a9..7ea1635827 100644
--- a/src/opengl/doc/src/qtopengl-index.qdoc
+++ b/src/opengl/doc/src/qtopengl-index.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtopengl-index.html
@@ -34,11 +10,11 @@
Qt has two main approaches to UI development: \l[QtQuick]{Qt Quick} and
\l{Qt Widgets}. They exist to support different types of user
- interfaces, and build on separate graphics engines which have been
+ interfaces, and build on separate graphics engines that have been
optimized for each of these types.
It is possible to combine code written in the OpenGL graphics API
- with both these user interface types in Qt. This can be useful
+ with both of these user interface types in Qt. This can be useful
when the application has its own OpenGL-dependent code, or when it
is integrating with a third-party OpenGL-based renderer.
@@ -70,15 +46,29 @@
For more details on enabling OpenGL with \l[QtQuick]{Qt Quick}, see
\l{Rendering via the Qt Rendering Hardware Interface}{scenegraph renderer documentation}.
- \section1 Overview
+ \section1 Using the Module
- \include module-use.qdocinc using qt module
- \snippet snippets/CMakeLists.txt cmake_use
+ \include {module-use.qdocinc} {using the c++ api}
- See also the \l {Build with CMake} overview.
+ \section2 Building with CMake
- \include module-use.qdocinc building with qmake
- \snippet snippets.pro qmake_use
+ \include {module-use.qdocinc} {building with cmake} {OpenGL}
+
+ \section2 Building with qmake
+
+ \include {module-use.qdocinc} {building_with_qmake} {opengl}
+
+ \section1 Examples
+
+ \list
+ \li \l {Qt OpenGL Examples}
+ \endlist
+
+ \section1 Reference
+
+ \list
+ \li \l {Qt OpenGL C++ Classes} {C++ Classes}
+ \endlist
\section1 Module Evolution
\l{Changes to Qt OpenGL} lists important changes in the module API
@@ -95,15 +85,4 @@
OpenGL\reg is a trademark of Silicon Graphics, Inc. in
the United States and other countries.
-
-
- \section1 Related Information
-
- These are links to the API reference materials and related pages.
-
- \list
- \li \l{Qt OpenGL C++ Classes}{C++ Classes}
- \li \l{OpenGL Window Example}
- \endlist
-
*/
diff --git a/src/opengl/doc/src/qtopengl-module.qdoc b/src/opengl/doc/src/qtopengl-module.qdoc
index 3659ae7843..a2f344ba13 100644
--- a/src/opengl/doc/src/qtopengl-module.qdoc
+++ b/src/opengl/doc/src/qtopengl-module.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QtOpenGL
diff --git a/src/opengl/qopengl2pexvertexarray.cpp b/src/opengl/qopengl2pexvertexarray.cpp
index df0fb764c9..aa8bae0282 100644
--- a/src/opengl/qopengl2pexvertexarray.cpp
+++ b/src/opengl/qopengl2pexvertexarray.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengl2pexvertexarray_p.h"
diff --git a/src/opengl/qopengl2pexvertexarray_p.h b/src/opengl/qopengl2pexvertexarray_p.h
index ac9a5732db..84c77f32ff 100644
--- a/src/opengl/qopengl2pexvertexarray_p.h
+++ b/src/opengl/qopengl2pexvertexarray_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -77,6 +41,7 @@ public:
operator QPointF() {return QPointF(x,y);}
operator QPointF() const {return QPointF(x,y);}
};
+Q_DECLARE_TYPEINFO(QOpenGLPoint, Q_PRIMITIVE_TYPE);
struct QOpenGLRect
{
@@ -93,6 +58,7 @@ struct QOpenGLRect
operator QRectF() const {return QRectF(left, top, right-left, bottom-top);}
};
+Q_DECLARE_TYPEINFO(QOpenGLRect, Q_PRIMITIVE_TYPE);
class QOpenGL2PEXVertexArray
{
diff --git a/src/opengl/qopenglbuffer.cpp b/src/opengl/qopenglbuffer.cpp
index 8a880662b1..64e7975043 100644
--- a/src/opengl/qopenglbuffer.cpp
+++ b/src/opengl/qopenglbuffer.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtGui/qopengl.h>
#include <QtGui/private/qopenglcontext_p.h>
@@ -202,7 +166,7 @@ QOpenGLBuffer::QOpenGLBuffer(const QOpenGLBuffer &other)
*/
QOpenGLBuffer::~QOpenGLBuffer()
{
- if (!d_ptr->ref.deref()) {
+ if (d_ptr && !d_ptr->ref.deref()) {
destroy();
delete d_ptr;
}
@@ -218,7 +182,7 @@ QOpenGLBuffer &QOpenGLBuffer::operator=(const QOpenGLBuffer &other)
{
if (d_ptr != other.d_ptr) {
other.d_ptr->ref.ref();
- if (!d_ptr->ref.deref()) {
+ if (d_ptr && !d_ptr->ref.deref()) {
destroy();
delete d_ptr;
}
@@ -228,6 +192,36 @@ QOpenGLBuffer &QOpenGLBuffer::operator=(const QOpenGLBuffer &other)
}
/*!
+ \fn QOpenGLBuffer::QOpenGLBuffer(QOpenGLBuffer &&other)
+ \since 6.5
+
+ Move-constructs a new QOpenGLBuffer from \a other.
+
+ \note The moved-from object \a other is placed in a partially-formed state,
+ in which the only valid operations are destruction and assignment of a new
+ value.
+*/
+
+/*!
+ \fn QOpenGLBuffer &QOpenGLBuffer::operator=(QOpenGLBuffer &&other)
+ \since 6.5
+
+ Move-assigns \a other to this QOpenGLBuffer instance.
+
+ \note The moved-from object \a other is placed in a partially-formed state,
+ in which the only valid operations are destruction and assignment of a new
+ value.
+*/
+
+/*!
+ \fn QOpenGLBuffer::swap(QOpenGLBuffer &other)
+ \since 6.5
+
+ Swaps buffer \a other with this buffer. This operation is very fast and
+ never fails.
+*/
+
+/*!
Returns the type of buffer represented by this object.
*/
QOpenGLBuffer::Type QOpenGLBuffer::type() const
diff --git a/src/opengl/qopenglbuffer.h b/src/opengl/qopenglbuffer.h
index 8a099a0320..b9f2265ca0 100644
--- a/src/opengl/qopenglbuffer.h
+++ b/src/opengl/qopenglbuffer.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLBUFFER_H
#define QOPENGLBUFFER_H
@@ -44,7 +8,6 @@
#ifndef QT_NO_OPENGL
-#include <QtCore/qscopedpointer.h>
#include <QtGui/qopengl.h>
QT_BEGIN_NAMESPACE
@@ -66,9 +29,15 @@ public:
QOpenGLBuffer();
explicit QOpenGLBuffer(QOpenGLBuffer::Type type);
QOpenGLBuffer(const QOpenGLBuffer &other);
+ QOpenGLBuffer(QOpenGLBuffer &&other) noexcept
+ : d_ptr{std::exchange(other.d_ptr, nullptr)} {}
~QOpenGLBuffer();
QOpenGLBuffer &operator=(const QOpenGLBuffer &other);
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QOpenGLBuffer)
+
+ void swap(QOpenGLBuffer &other) noexcept
+ { return qt_ptr_swap(d_ptr, other.d_ptr); }
enum UsagePattern
{
@@ -135,6 +104,7 @@ private:
Q_DECLARE_PRIVATE(QOpenGLBuffer)
};
+Q_DECLARE_SHARED(QOpenGLBuffer)
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLBuffer::RangeAccessFlags)
diff --git a/src/opengl/qopenglcompositor.cpp b/src/opengl/qopenglcompositor.cpp
index abfaca3f9c..3c5b1df905 100644
--- a/src/opengl/qopenglcompositor.cpp
+++ b/src/opengl/qopenglcompositor.cpp
@@ -1,45 +1,10 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtOpenGL/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLContext>
#include <QtGui/QWindow>
+#include <rhi/qrhi.h>
#include <qpa/qplatformbackingstore.h>
#include "qopenglcompositor_p.h"
@@ -93,14 +58,17 @@ QOpenGLCompositor::~QOpenGLCompositor()
compositor = 0;
}
-void QOpenGLCompositor::setTarget(QOpenGLContext *context, QWindow *targetWindow,
- const QRect &nativeTargetGeometry)
+void QOpenGLCompositor::setTargetWindow(QWindow *targetWindow, const QRect &nativeTargetGeometry)
{
- m_context = context;
m_targetWindow = targetWindow;
m_nativeTargetGeometry = nativeTargetGeometry;
}
+void QOpenGLCompositor::setTargetContext(QOpenGLContext *context)
+{
+ m_context = context;
+}
+
void QOpenGLCompositor::setRotation(int degrees)
{
m_rotation = degrees;
@@ -117,10 +85,23 @@ void QOpenGLCompositor::update()
QImage QOpenGLCompositor::grab()
{
Q_ASSERT(m_context && m_targetWindow);
+ QOpenGLFramebufferObject fbo(m_nativeTargetGeometry.size());
+ grabToFrameBufferObject(&fbo);
+ return fbo.toImage();
+}
+
+bool QOpenGLCompositor::grabToFrameBufferObject(QOpenGLFramebufferObject *fbo, GrabOrientation orientation)
+{
+ Q_ASSERT(fbo);
+ if (fbo->size() != m_nativeTargetGeometry.size()
+ || fbo->format().textureTarget() != GL_TEXTURE_2D)
+ return false;
+
m_context->makeCurrent(m_targetWindow);
- QScopedPointer<QOpenGLFramebufferObject> fbo(new QOpenGLFramebufferObject(m_nativeTargetGeometry.size()));
- renderAll(fbo.data());
- return fbo->toImage();
+ renderAll(fbo,
+ orientation == Flipped ? QOpenGLTextureBlitter::OriginTopLeft
+ : QOpenGLTextureBlitter::OriginBottomLeft);
+ return true;
}
void QOpenGLCompositor::handleRenderAllRequest()
@@ -130,7 +111,7 @@ void QOpenGLCompositor::handleRenderAllRequest()
renderAll(0);
}
-void QOpenGLCompositor::renderAll(QOpenGLFramebufferObject *fbo)
+void QOpenGLCompositor::renderAll(QOpenGLFramebufferObject *fbo, QOpenGLTextureBlitter::Origin origin)
{
if (fbo)
fbo->bind();
@@ -147,7 +128,7 @@ void QOpenGLCompositor::renderAll(QOpenGLFramebufferObject *fbo)
m_windows.at(i)->beginCompositing();
for (int i = 0; i < m_windows.size(); ++i)
- render(m_windows.at(i));
+ render(m_windows.at(i), origin);
m_blitter.release();
if (!fbo)
@@ -188,9 +169,10 @@ static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight)
topLeftRect.width(), topLeftRect.height());
}
-static void clippedBlit(const QPlatformTextureList *textures, int idx, const QRect &sourceWindowRect,
- const QRect &targetWindowRect,
- QOpenGLTextureBlitter *blitter, QMatrix4x4 *rotationMatrix)
+static void clippedBlit(const QPlatformTextureList *textures, int idx,
+ const QRect &sourceWindowRect, const QRect &targetWindowRect,
+ QOpenGLTextureBlitter *blitter, QMatrix4x4 *rotationMatrix,
+ QOpenGLTextureBlitter::Origin sourceOrigin)
{
const QRect clipRect = textures->clipRect(idx);
if (clipRect.isEmpty())
@@ -205,12 +187,13 @@ static void clippedBlit(const QPlatformTextureList *textures, int idx, const QRe
target = *rotationMatrix * target;
const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(srcRect, rectInWindow.size(),
- QOpenGLTextureBlitter::OriginBottomLeft);
+ sourceOrigin);
- blitter->blit(textures->textureId(idx), target, source);
+ const uint textureId = textures->texture(idx)->nativeTexture().object;
+ blitter->blit(textureId, target, source);
}
-void QOpenGLCompositor::render(QOpenGLCompositorWindow *window)
+void QOpenGLCompositor::render(QOpenGLCompositorWindow *window, QOpenGLTextureBlitter::Origin origin)
{
const QPlatformTextureList *textures = window->textures();
if (!textures)
@@ -220,8 +203,11 @@ void QOpenGLCompositor::render(QOpenGLCompositorWindow *window)
float currentOpacity = 1.0f;
BlendStateBinder blend;
const QRect sourceWindowRect = window->sourceWindow()->geometry();
+ auto clippedBlitSourceOrigin = origin == QOpenGLTextureBlitter::OriginTopLeft
+ ? QOpenGLTextureBlitter::OriginBottomLeft
+ : QOpenGLTextureBlitter::OriginTopLeft;
for (int i = 0; i < textures->count(); ++i) {
- uint textureId = textures->textureId(i);
+ const uint textureId = textures->texture(i)->nativeTexture().object;
const float opacity = window->sourceWindow()->opacity();
if (opacity != currentOpacity) {
currentOpacity = opacity;
@@ -234,7 +220,7 @@ void QOpenGLCompositor::render(QOpenGLCompositorWindow *window)
QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), targetWindowRect);
if (m_rotation)
target = m_rotationMatrix * target;
- m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
+ m_blitter.blit(textureId, target, origin);
} else if (textures->count() == 1) {
// A regular QWidget window
const bool translucent = window->sourceWindow()->requestedFormat().alphaBufferSize() > 0;
@@ -242,18 +228,20 @@ void QOpenGLCompositor::render(QOpenGLCompositorWindow *window)
QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(textures->geometry(i), targetWindowRect);
if (m_rotation)
target = m_rotationMatrix * target;
- m_blitter.blit(textureId, target, QOpenGLTextureBlitter::OriginTopLeft);
+ m_blitter.blit(textureId, target, origin);
} else if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
// Texture from an FBO belonging to a QOpenGLWidget or QQuickWidget
blend.set(false);
- clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr);
+ clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter,
+ m_rotation ? &m_rotationMatrix : nullptr, clippedBlitSourceOrigin);
}
}
for (int i = 0; i < textures->count(); ++i) {
if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
blend.set(true);
- clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter, m_rotation ? &m_rotationMatrix : nullptr);
+ clippedBlit(textures, i, sourceWindowRect, targetWindowRect, &m_blitter,
+ m_rotation ? &m_rotationMatrix : nullptr, clippedBlitSourceOrigin);
}
}
@@ -277,7 +265,9 @@ void QOpenGLCompositor::addWindow(QOpenGLCompositorWindow *window)
{
if (!m_windows.contains(window)) {
m_windows.append(window);
- emit topWindowChanged(window);
+ ensureCorrectZOrder();
+ if (window == m_windows.constLast())
+ emit topWindowChanged(window);
}
}
@@ -290,9 +280,17 @@ void QOpenGLCompositor::removeWindow(QOpenGLCompositorWindow *window)
void QOpenGLCompositor::moveToTop(QOpenGLCompositorWindow *window)
{
+ if (!m_windows.isEmpty() && window == m_windows.constLast()) {
+ // Already on top
+ return;
+ }
+
m_windows.removeOne(window);
m_windows.append(window);
- emit topWindowChanged(window);
+ ensureCorrectZOrder();
+
+ if (window == m_windows.constLast())
+ emit topWindowChanged(window);
}
void QOpenGLCompositor::changeWindowIndex(QOpenGLCompositorWindow *window, int newIdx)
@@ -300,9 +298,63 @@ void QOpenGLCompositor::changeWindowIndex(QOpenGLCompositorWindow *window, int n
int idx = m_windows.indexOf(window);
if (idx != -1 && idx != newIdx) {
m_windows.move(idx, newIdx);
- if (newIdx == m_windows.size() - 1)
+ ensureCorrectZOrder();
+ if (window == m_windows.constLast())
emit topWindowChanged(m_windows.last());
}
}
+void QOpenGLCompositor::ensureCorrectZOrder()
+{
+ const auto originalOrder = m_windows;
+
+ std::sort(m_windows.begin(), m_windows.end(),
+ [this, &originalOrder](QOpenGLCompositorWindow *cw1, QOpenGLCompositorWindow *cw2) {
+ QWindow *w1 = cw1->sourceWindow();
+ QWindow *w2 = cw2->sourceWindow();
+
+ // Case #1: The main window needs to have less z-order. It can never be in
+ // front of our tool windows, popups etc, because it's fullscreen!
+ if (w1 == m_targetWindow || w2 == m_targetWindow)
+ return w1 == m_targetWindow;
+
+ // Case #2:
+ if (w2->isAncestorOf(w1)) {
+ // w1 is transient child of w2. W1 goes in front then.
+ return false;
+ }
+
+ if (w1->isAncestorOf(w2)) {
+ // Or the other way around
+ return true;
+ }
+
+ // Case #3: Modality gets higher Z
+ if (w1->modality() != Qt::NonModal && w2->modality() == Qt::NonModal)
+ return false;
+
+ if (w2->modality() != Qt::NonModal && w1->modality() == Qt::NonModal)
+ return true;
+
+ const bool isTool1 = (w1->flags() & Qt::Tool) == Qt::Tool;
+ const bool isTool2 = (w2->flags() & Qt::Tool) == Qt::Tool;
+ const bool isPurePopup1 = !isTool1 && (w1->flags() & Qt::Popup) == Qt::Popup;
+ const bool isPurePopup2 = !isTool2 && (w2->flags() & Qt::Popup) == Qt::Popup;
+
+ // Case #4: By pure-popup we mean menus and tooltips. Qt::Tool implies Qt::Popup
+ // and we don't want to catch QDockWidget and other tool windows just yet
+ if (isPurePopup1 != isPurePopup2)
+ return !isPurePopup1;
+
+ // Case #5: One of the window is a Tool, that goes to front, as done in other QPAs
+ if (isTool1 != isTool2)
+ return !isTool1;
+
+ // Case #6: Just preserve original sorting:
+ return originalOrder.indexOf(cw1) < originalOrder.indexOf(cw2);
+ });
+}
+
QT_END_NAMESPACE
+
+#include "moc_qopenglcompositor_p.cpp"
diff --git a/src/opengl/qopenglcompositor_p.h b/src/opengl/qopenglcompositor_p.h
index d0d1c9303d..86229b13ca 100644
--- a/src/opengl/qopenglcompositor_p.h
+++ b/src/opengl/qopenglcompositor_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLCOMPOSITOR_H
#define QOPENGLCOMPOSITOR_H
@@ -56,6 +20,7 @@
#include <QtCore/QTimer>
#include <QtOpenGL/QOpenGLTextureBlitter>
#include <QtGui/QMatrix4x4>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
@@ -64,6 +29,7 @@ class QOpenGLFramebufferObject;
class QWindow;
class QPlatformTextureList;
+class QOpenGLCompositorBackingStore;
class QOpenGLCompositorWindow
{
public:
@@ -72,6 +38,8 @@ public:
virtual const QPlatformTextureList *textures() const = 0;
virtual void beginCompositing() { }
virtual void endCompositing() { }
+ virtual void setBackingStore(QOpenGLCompositorBackingStore *backingStore) = 0;
+ virtual QOpenGLCompositorBackingStore *backingStore() const = 0;
};
class Q_OPENGL_EXPORT QOpenGLCompositor : public QObject
@@ -79,17 +47,26 @@ class Q_OPENGL_EXPORT QOpenGLCompositor : public QObject
Q_OBJECT
public:
+ enum GrabOrientation {
+ Flipped,
+ NotFlipped,
+ };
+
static QOpenGLCompositor *instance();
static void destroy();
- void setTarget(QOpenGLContext *context, QWindow *window, const QRect &nativeTargetGeometry);
+ void setTargetWindow(QWindow *window, const QRect &nativeTargetGeometry);
+ void setTargetContext(QOpenGLContext *context);
void setRotation(int degrees);
QOpenGLContext *context() const { return m_context; }
QWindow *targetWindow() const { return m_targetWindow; }
+ QRect nativeTargetGeometry() const { return m_nativeTargetGeometry; }
void update();
QImage grab();
+ bool grabToFrameBufferObject(QOpenGLFramebufferObject *fbo, GrabOrientation orientation = Flipped);
+
QList<QOpenGLCompositorWindow *> windows() const { return m_windows; }
void addWindow(QOpenGLCompositorWindow *window);
void removeWindow(QOpenGLCompositorWindow *window);
@@ -106,8 +83,11 @@ private:
QOpenGLCompositor();
~QOpenGLCompositor();
- void renderAll(QOpenGLFramebufferObject *fbo);
- void render(QOpenGLCompositorWindow *window);
+ void renderAll(QOpenGLFramebufferObject *fbo,
+ QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
+ void render(QOpenGLCompositorWindow *window,
+ QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
+ void ensureCorrectZOrder();
QOpenGLContext *m_context;
QWindow *m_targetWindow;
diff --git a/src/opengl/qopenglcompositorbackingstore.cpp b/src/opengl/qopenglcompositorbackingstore.cpp
index 40400e2a19..931734cf60 100644
--- a/src/opengl/qopenglcompositorbackingstore.cpp
+++ b/src/opengl/qopenglcompositorbackingstore.cpp
@@ -1,48 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 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$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtGui/QOpenGLContext>
#include <QtGui/QWindow>
#include <QtGui/QPainter>
-#include <QtGui/QOffscreenSurface>
#include <qpa/qplatformbackingstore.h>
#include <private/qwindow_p.h>
+#include <rhi/qrhi.h>
#include "qopenglcompositorbackingstore_p.h"
#include "qopenglcompositor_p.h"
@@ -79,35 +43,22 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
: QPlatformBackingStore(window),
m_window(window),
m_bsTexture(0),
+ m_bsTextureWrapper(nullptr),
m_bsTextureContext(0),
m_textures(new QPlatformTextureList),
- m_lockedWidgetTextures(0)
+ m_lockedWidgetTextures(0),
+ m_rhi(nullptr)
{
}
QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
{
- if (m_bsTexture) {
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- // With render-to-texture-widgets QWidget makes sure the TLW's shareContext() is
- // made current before destroying backingstores. That is however not the case for
- // windows with regular widgets only.
- QScopedPointer<QOffscreenSurface> tempSurface;
- if (!ctx) {
- ctx = QOpenGLCompositor::instance()->context();
- tempSurface.reset(new QOffscreenSurface);
- tempSurface->setFormat(ctx->format());
- tempSurface->create();
- ctx->makeCurrent(tempSurface.data());
- }
-
- if (m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
- glDeleteTextures(1, &m_bsTexture);
- else
- qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context");
-
- if (tempSurface)
- ctx->doneCurrent();
+ if (m_bsTexture && m_rhi) {
+ delete m_bsTextureWrapper;
+ // Contexts are sharing resources, won't matter which one is
+ // current here, use the rhi's shortcut.
+ m_rhi->makeThreadLocalNativeContextCurrent();
+ glDeleteTextures(1, &m_bsTexture);
}
delete m_textures; // this does not actually own any GL resources
@@ -176,69 +127,99 @@ void QOpenGLCompositorBackingStore::updateTexture()
m_dirty = QRegion();
}
+
+ if (!m_bsTextureWrapper) {
+ m_bsTextureWrapper = m_rhi->newTexture(QRhiTexture::RGBA8, m_image.size());
+ m_bsTextureWrapper->createFrom({m_bsTexture, 0});
+ }
}
void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
// Called for ordinary raster windows.
+ auto *handle = dynamic_cast<QOpenGLCompositorWindow *>(window->handle());
+ if (handle && !handle->backingStore())
+ handle->setBackingStore(this);
Q_UNUSED(region);
Q_UNUSED(offset);
+ m_rhi = rhi();
+ if (!m_rhi) {
+ setRhiConfig(QPlatformBackingStoreRhiConfig(QPlatformBackingStoreRhiConfig::OpenGL));
+ m_rhi = rhi();
+ }
+ Q_ASSERT(m_rhi);
+
QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
QOpenGLContext *dstCtx = compositor->context();
- Q_ASSERT(dstCtx);
+ if (!dstCtx)
+ return;
QWindow *dstWin = compositor->targetWindow();
if (!dstWin)
return;
- dstCtx->makeCurrent(dstWin);
+ if (!dstCtx->makeCurrent(dstWin))
+ return;
+
updateTexture();
m_textures->clear();
- m_textures->appendTexture(nullptr, m_bsTexture, window->geometry());
+ m_textures->appendTexture(nullptr, m_bsTextureWrapper, window->geometry());
compositor->update();
}
-void QOpenGLCompositorBackingStore::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
- QPlatformTextureList *textures,
- bool translucentBackground)
+QPlatformBackingStore::FlushResult QOpenGLCompositorBackingStore::rhiFlush(QWindow *window,
+ qreal sourceDevicePixelRatio,
+ const QRegion &region,
+ const QPoint &offset,
+ QPlatformTextureList *textures,
+ bool translucentBackground)
{
// QOpenGLWidget/QQuickWidget content provided as textures. The raster content goes on top.
Q_UNUSED(region);
Q_UNUSED(offset);
Q_UNUSED(translucentBackground);
+ Q_UNUSED(sourceDevicePixelRatio);
+
+ m_rhi = rhi();
+ if (!m_rhi) {
+ setRhiConfig(QPlatformBackingStoreRhiConfig(QPlatformBackingStoreRhiConfig::OpenGL));
+ m_rhi = rhi();
+ }
+ Q_ASSERT(m_rhi);
QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
QOpenGLContext *dstCtx = compositor->context();
- Q_ASSERT(dstCtx); // setTarget() must have been called before, e.g. from QEGLFSWindow
-
- // The compositor's context and the context to which QOpenGLWidget/QQuickWidget
- // textures belong are not the same. They share resources, though.
- Q_ASSERT(qt_window_private(window)->shareContext()->shareGroup() == dstCtx->shareGroup());
+ if (!dstCtx)
+ return FlushFailed;
QWindow *dstWin = compositor->targetWindow();
if (!dstWin)
- return;
+ return FlushFailed;
- dstCtx->makeCurrent(dstWin);
+ if (!dstCtx->makeCurrent(dstWin))
+ return FlushFailed;
QWindowPrivate::get(window)->lastComposeTime.start();
m_textures->clear();
- for (int i = 0; i < textures->count(); ++i)
- m_textures->appendTexture(textures->source(i), textures->textureId(i), textures->geometry(i),
+ for (int i = 0; i < textures->count(); ++i) {
+ m_textures->appendTexture(textures->source(i), textures->texture(i), textures->geometry(i),
textures->clipRect(i), textures->flags(i));
+ }
updateTexture();
- m_textures->appendTexture(nullptr, m_bsTexture, window->geometry());
+ m_textures->appendTexture(nullptr, m_bsTextureWrapper, window->geometry());
textures->lock(true);
m_lockedWidgetTextures = textures;
compositor->update();
+
+ return FlushSuccess;
}
void QOpenGLCompositorBackingStore::notifyComposited()
@@ -268,6 +249,8 @@ void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &sta
QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
QOpenGLContext *dstCtx = compositor->context();
+ if (!dstCtx)
+ return;
QWindow *dstWin = compositor->targetWindow();
if (!dstWin)
return;
@@ -278,6 +261,8 @@ void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &sta
dstCtx->makeCurrent(dstWin);
if (m_bsTexture) {
+ delete m_bsTextureWrapper;
+ m_bsTextureWrapper = nullptr;
glDeleteTextures(1, &m_bsTexture);
m_bsTexture = 0;
m_bsTextureContext = nullptr;
diff --git a/src/opengl/qopenglcompositorbackingstore_p.h b/src/opengl/qopenglcompositorbackingstore_p.h
index fcce75ab4e..4512e2d589 100644
--- a/src/opengl/qopenglcompositorbackingstore_p.h
+++ b/src/opengl/qopenglcompositorbackingstore_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLCOMPOSITORBACKINGSTORE_H
#define QOPENGLCOMPOSITORBACKINGSTORE_H
@@ -56,11 +20,13 @@
#include <qpa/qplatformbackingstore.h>
#include <QImage>
#include <QRegion>
+#include <private/qglobal_p.h>
QT_BEGIN_NAMESPACE
class QOpenGLContext;
class QPlatformTextureList;
+class QRhiTexture;
class Q_OPENGL_EXPORT QOpenGLCompositorBackingStore : public QPlatformBackingStore
{
@@ -76,7 +42,11 @@ public:
void resize(const QSize &size, const QRegion &staticContents) override;
QImage toImage() const override;
- void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+
+ FlushResult rhiFlush(QWindow *window,
+ qreal sourceDevicePixelRatio,
+ const QRegion &region,
+ const QPoint &offset,
QPlatformTextureList *textures,
bool translucentBackground) override;
@@ -91,9 +61,11 @@ private:
QImage m_image;
QRegion m_dirty;
uint m_bsTexture;
+ QRhiTexture *m_bsTextureWrapper;
QOpenGLContext *m_bsTextureContext;
QPlatformTextureList *m_textures;
QPlatformTextureList *m_lockedWidgetTextures;
+ QRhi *m_rhi;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qopenglcustomshaderstage.cpp b/src/opengl/qopenglcustomshaderstage.cpp
index 7a32b2fbc0..1be8d783d6 100644
--- a/src/opengl/qopenglcustomshaderstage.cpp
+++ b/src/opengl/qopenglcustomshaderstage.cpp
@@ -1,47 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglcustomshaderstage_p.h"
#include "qopenglengineshadermanager_p.h"
#include "qopenglpaintengine_p.h"
#include <private/qpainter_p.h>
+#include <QtCore/qpointer.h>
+
QT_BEGIN_NAMESPACE
class QOpenGLCustomShaderStagePrivate
diff --git a/src/opengl/qopenglcustomshaderstage_p.h b/src/opengl/qopenglcustomshaderstage_p.h
index 255c115e3c..29be9df75d 100644
--- a/src/opengl/qopenglcustomshaderstage_p.h
+++ b/src/opengl/qopenglcustomshaderstage_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGL_CUSTOM_SHADER_STAGE_H
#define QOPENGL_CUSTOM_SHADER_STAGE_H
@@ -53,6 +17,7 @@
#include <QtOpenGL/qtopenglglobal.h>
#include <QOpenGLShaderProgram>
+#include <private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qopengldebug.cpp b/src/opengl/qopengldebug.cpp
index 3df1f2f29a..b774d0a85e 100644
--- a/src/opengl/qopengldebug.cpp
+++ b/src/opengl/qopengldebug.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/private/qobject_p.h>
#include <QtCore/qglobal.h>
@@ -48,6 +12,8 @@
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QOpenGLDebugMessage)
+
/*!
\class QOpenGLDebugMessage
\brief The QOpenGLDebugMessage class wraps an OpenGL debug message.
@@ -1181,7 +1147,7 @@ void QOpenGLDebugLoggerPrivate::controlDebugMessages(QOpenGLDebugMessage::Source
QVarLengthArray<GLenum, 8> glTypes;
QVarLengthArray<GLenum, 8> glSeverities;
- if (ids.count() > 0) {
+ if (ids.size() > 0) {
Q_ASSERT(severities == QOpenGLDebugMessage::AnySeverity);
// The GL_KHR_debug extension says:
@@ -1222,7 +1188,7 @@ void QOpenGLDebugLoggerPrivate::controlDebugMessages(QOpenGLDebugMessage::Source
CONVERT_TO_GL_DEBUG_MESSAGE_CONTROL_PARAMETERS(Severity, severities, glSeverities)
#undef CONVERT_TO_GL_DEBUG_MESSAGE_CONTROL_PARAMETERS
- const GLsizei idCount = ids.count();
+ const GLsizei idCount = ids.size();
// The GL_KHR_debug extension says that if idCount is 0, idPtr must be ignored.
// Unfortunately, some bugged drivers do NOT ignore it, so pass NULL in case.
const GLuint * const idPtr = idCount ? ids.constData() : nullptr;
@@ -1538,9 +1504,9 @@ void QOpenGLDebugLogger::logMessage(const QOpenGLDebugMessage &debugMessage)
QByteArray rawMessage = debugMessage.message().toUtf8();
rawMessage.append('\0');
- if (rawMessage.length() > d->maxMessageLength) {
+ if (rawMessage.size() > d->maxMessageLength) {
qWarning("QOpenGLDebugLogger::logMessage(): message too long, truncating it\n"
- " (%d bytes long, but the GL accepts up to %d bytes)", int(rawMessage.length()), d->maxMessageLength);
+ " (%d bytes long, but the GL accepts up to %d bytes)", int(rawMessage.size()), d->maxMessageLength);
rawMessage.resize(d->maxMessageLength - 1);
rawMessage.append('\0');
}
@@ -1590,9 +1556,9 @@ void QOpenGLDebugLogger::pushGroup(const QString &name, GLuint id, QOpenGLDebugM
QByteArray rawName = name.toUtf8();
rawName.append('\0');
- if (rawName.length() > d->maxMessageLength) {
+ if (rawName.size() > d->maxMessageLength) {
qWarning("QOpenGLDebugLogger::pushGroup(): group name too long, truncating it\n"
- " (%d bytes long, but the GL accepts up to %d bytes)", int(rawName.length()), d->maxMessageLength);
+ " (%d bytes long, but the GL accepts up to %d bytes)", int(rawName.size()), d->maxMessageLength);
rawName.resize(d->maxMessageLength - 1);
rawName.append('\0');
}
diff --git a/src/opengl/qopengldebug.h b/src/opengl/qopengldebug.h
index f61808e4c7..843ab7212a 100644
--- a/src/opengl/qopengldebug.h
+++ b/src/opengl/qopengldebug.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLDEBUG_H
#define QOPENGLDEBUG_H
@@ -51,7 +15,7 @@
#include <QtCore/qdebug.h>
#include <QtGui/qopenglcontext.h>
-#if defined(Q_CLANG_QDOC)
+#if defined(Q_QDOC)
#undef GLuint
typedef unsigned int GLuint;
#endif
@@ -112,7 +76,7 @@ public:
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpenGLDebugMessage)
~QOpenGLDebugMessage();
- void swap(QOpenGLDebugMessage &other) noexcept { qSwap(d, other.d); }
+ void swap(QOpenGLDebugMessage &other) noexcept { d.swap(other.d); }
Source source() const;
Type type() const;
@@ -213,7 +177,7 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QOpenGLDebugMessage)
+QT_DECL_METATYPE_EXTERN(QOpenGLDebugMessage, Q_OPENGL_EXPORT)
#endif // QT_NO_OPENGL
diff --git a/src/opengl/qopenglengineshadermanager.cpp b/src/opengl/qopenglengineshadermanager.cpp
index eb2aa12d07..4b0c9ffdcf 100644
--- a/src/opengl/qopenglengineshadermanager.cpp
+++ b/src/opengl/qopenglengineshadermanager.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglengineshadermanager_p.h"
#include "qopenglengineshadersource_p.h"
@@ -46,6 +10,7 @@
#include <QtCore/qthreadstorage.h>
#include <algorithm>
+#include <memory>
#if defined(QT_DEBUG)
#include <QMetaEnum>
@@ -372,7 +337,7 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
}
}
- QScopedPointer<QOpenGLEngineShaderProg> newProg;
+ std::unique_ptr<QOpenGLEngineShaderProg> newProg;
do {
QByteArray fragSource;
@@ -395,10 +360,10 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
vertexSource.append(qShaderSnippets[prog.mainVertexShader]);
vertexSource.append(qShaderSnippets[prog.positionVertexShader]);
#endif
- QScopedPointer<QOpenGLShaderProgram> shaderProgram(new QOpenGLShaderProgram);
+ auto shaderProgram = std::make_unique<QOpenGLShaderProgram>();
CachedShader shaderCache(fragSource, vertexSource);
- bool inCache = shaderCache.load(shaderProgram.data(), QOpenGLContext::currentContext());
+ bool inCache = shaderCache.load(shaderProgram.get(), QOpenGLContext::currentContext());
if (!inCache) {
if (!shaderProgram->addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, vertexSource)) {
@@ -446,18 +411,16 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
}
newProg.reset(new QOpenGLEngineShaderProg(prog));
- newProg->program = shaderProgram.take();
+ newProg->program = shaderProgram.release();
newProg->program->link();
if (newProg->program->isLinked()) {
if (!inCache)
shaderCache.store(newProg->program, QOpenGLContext::currentContext());
} else {
- QString error;
- error = QLatin1String("Shader program failed to link")
- + QLatin1String(" Error Log:\n")
- + QLatin1String(" ") + newProg->program->log();
- qWarning() << error;
+ qWarning("Shader program failed to link\n"
+ " Error Log:\n"
+ " %ls", qUtf16Printable(newProg->program->log()));
break;
}
@@ -468,7 +431,7 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
newProg->program->setUniformValue(location, QT_MASK_TEXTURE_UNIT);
}
- if (cachedPrograms.count() > 30) {
+ if (cachedPrograms.size() > 30) {
// The cache is full, so delete the last 5 programs in the list.
// These programs will be least used, as a program us bumped to
// the top of the list when it's used.
@@ -478,10 +441,10 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
}
}
- cachedPrograms.insert(0, newProg.data());
+ cachedPrograms.insert(0, newProg.get());
} while (false);
- return newProg.take();
+ return newProg.release();
}
void QOpenGLEngineSharedShaders::cleanupCustomStage(QOpenGLCustomShaderStage* stage)
@@ -894,3 +857,5 @@ bool QOpenGLEngineShaderManager::useCorrectShaderProg()
}
QT_END_NAMESPACE
+
+#include "moc_qopenglengineshadermanager_p.cpp"
diff --git a/src/opengl/qopenglengineshadermanager_p.h b/src/opengl/qopenglengineshadermanager_p.h
index 5aaa1903a1..78ad5d54fb 100644
--- a/src/opengl/qopenglengineshadermanager_p.h
+++ b/src/opengl/qopenglengineshadermanager_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -163,7 +127,7 @@
all color components so it can be defined to colorp or lowp depending upon
the implementation.
- So there are differnt frament shader main functions, depending on the
+ So there are different fragment shader main functions, depending on the
number & type of pipelines the fragment needs to go through.
The choice of which main() fragment shader string to use depends on:
diff --git a/src/opengl/qopenglengineshadersource_p.h b/src/opengl/qopenglengineshadersource_p.h
index 49d17c8d79..35390da15a 100644
--- a/src/opengl/qopenglengineshadersource_p.h
+++ b/src/opengl/qopenglengineshadersource_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
diff --git a/src/opengl/qopenglframebufferobject.cpp b/src/opengl/qopenglframebufferobject.cpp
index aa1c396892..5c8f769d39 100644
--- a/src/opengl/qopenglframebufferobject.cpp
+++ b/src/opengl/qopenglframebufferobject.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglframebufferobject.h"
#include "qopenglframebufferobject_p.h"
@@ -54,6 +18,15 @@
QT_BEGIN_NAMESPACE
+Q_TRACE_PREFIX(qtopengl,
+ "#include <private/qopengl2pexvertexarray_p.h>" \
+ "#include <private/qopengltextureuploader_p.h>" \
+ "#include <qopenglframebufferobject.h>"
+);
+Q_TRACE_PARAM_REPLACE(GLenum, int);
+Q_TRACE_PARAM_REPLACE(GLint, int);
+Q_TRACE_METADATA(qtopengl, "ENUM { } QOpenGLFramebufferObject::Attachment; ");
+
#ifndef QT_NO_DEBUG
#define QT_RESET_GLERROR() \
{ \
@@ -488,10 +461,11 @@ namespace
}
}
-void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *qfbo, const QSize &size,
- QOpenGLFramebufferObject::Attachment attachment,
- GLenum texture_target, GLenum internal_format,
- GLint samples, bool mipmap)
+void Q_TRACE_INSTRUMENT(qtopengl) QOpenGLFramebufferObjectPrivate::init(
+ QOpenGLFramebufferObject *qfbo, const QSize &size,
+ QOpenGLFramebufferObject::Attachment attachment,
+ GLenum texture_target, GLenum internal_format,
+ GLint samples, bool mipmap)
{
Q_TRACE_SCOPE(QOpenGLFramebufferObjectPrivate_init, qfbo, size, attachment, texture_target, internal_format, samples, mipmap);
Q_UNUSED(qfbo);
@@ -576,8 +550,22 @@ void QOpenGLFramebufferObjectPrivate::initTexture(int idx)
else if (color.internalFormat == GL_RGB16F || color.internalFormat == GL_RGBA16F)
pixelType = GL_HALF_FLOAT;
+ bool isOpaque = false;
+ switch (color.internalFormat) {
+ case GL_RGB8:
+ case GL_RGB16:
+ case GL_RGB16F:
+ case GL_RGB32F:
+ isOpaque = true;
+ break;
+ case GL_RGB10:
+ // opaque but the pixel type (INT_2_10_10_10) has alpha and so requires RGBA texture format
+ break;
+ }
+ const GLuint textureFormat = isOpaque ? GL_RGB : GL_RGBA;
+
funcs.glTexImage2D(target, 0, color.internalFormat, color.size.width(), color.size.height(), 0,
- GL_RGBA, pixelType, nullptr);
+ textureFormat, pixelType, nullptr);
if (format.mipmap()) {
int width = color.size.width();
int height = color.size.height();
@@ -586,8 +574,8 @@ void QOpenGLFramebufferObjectPrivate::initTexture(int idx)
width = qMax(1, width >> 1);
height = qMax(1, height >> 1);
++level;
- funcs.glTexImage2D(target, level, color.internalFormat, width, height, 0,
- GL_RGBA, pixelType, nullptr);
+ funcs.glTexImage2D(target, level, color.internalFormat, width, height, 0, textureFormat,
+ pixelType, nullptr);
}
}
funcs.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + idx,
@@ -1029,7 +1017,7 @@ QOpenGLFramebufferObject::~QOpenGLFramebufferObject()
if (isBound())
release();
- for (const auto &color : qAsConst(d->colorAttachments)) {
+ for (const auto &color : std::as_const(d->colorAttachments)) {
if (color.guard)
color.guard->free();
}
@@ -1089,7 +1077,7 @@ void QOpenGLFramebufferObject::addColorAttachment(const QSize &size, GLenum inte
QOpenGLFramebufferObjectPrivate::ColorAttachment color(size, effectiveInternalFormat(internalFormat));
d->colorAttachments.append(color);
- const int idx = d->colorAttachments.count() - 1;
+ const int idx = d->colorAttachments.size() - 1;
if (d->requestedSamples == 0) {
d->initTexture(idx);
@@ -1170,7 +1158,7 @@ bool QOpenGLFramebufferObject::bind()
if (d->format.samples() == 0) {
// Create new textures to replace the ones stolen via takeTexture().
- for (int i = 0; i < d->colorAttachments.count(); ++i) {
+ for (int i = 0; i < d->colorAttachments.size(); ++i) {
if (!d->colorAttachments.at(i).guard)
d->initTexture(i);
}
@@ -1250,7 +1238,7 @@ QList<GLuint> QOpenGLFramebufferObject::textures() const
QList<GLuint> ids;
if (d->format.samples() != 0)
return ids;
- ids.reserve(d->colorAttachments.count());
+ ids.reserve(d->colorAttachments.size());
for (const auto &color : d->colorAttachments)
ids.append(color.guard ? color.guard->id() : 0);
return ids;
@@ -1302,7 +1290,7 @@ GLuint QOpenGLFramebufferObject::takeTexture(int colorAttachmentIndex)
{
Q_D(QOpenGLFramebufferObject);
GLuint id = 0;
- if (isValid() && d->format.samples() == 0 && d->colorAttachments.count() > colorAttachmentIndex) {
+ if (isValid() && d->format.samples() == 0 && d->colorAttachments.size() > colorAttachmentIndex) {
QOpenGLContext *current = QOpenGLContext::currentContext();
if (current && current->shareGroup() == d->fbo_guard->group() && isBound())
release();
@@ -1370,7 +1358,8 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
bool isOpenGL12orBetter = !context->isOpenGLES() && (context->format().majorVersion() >= 2 || context->format().minorVersion() >= 2);
if (isOpenGL12orBetter) {
QImage img(size, include_alpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
- funcs->glReadPixels(0, 0, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, img.bits());
+ if (!img.isNull())
+ funcs->glReadPixels(0, 0, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, img.bits());
return img;
}
@@ -1380,7 +1369,8 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
// BGRA capable impl would return BGRA from there)
QImage rgbaImage(size, include_alpha ? QImage::Format_RGBA8888_Premultiplied : QImage::Format_RGBX8888);
- funcs->glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, rgbaImage.bits());
+ if (!rgbaImage.isNull())
+ funcs->glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, rgbaImage.bits());
return rgbaImage;
}
@@ -1388,7 +1378,8 @@ static inline QImage qt_gl_read_framebuffer_rgb10a2(const QSize &size, bool incl
{
// We assume OpenGL 1.2+ or ES 3.0+ here.
QImage img(size, include_alpha ? QImage::Format_A2BGR30_Premultiplied : QImage::Format_BGR30);
- context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, img.bits());
+ if (!img.isNull())
+ context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, img.bits());
return img;
}
@@ -1396,7 +1387,8 @@ static inline QImage qt_gl_read_framebuffer_rgba16(const QSize &size, bool inclu
{
// We assume OpenGL 1.2+ or ES 3.0+ here.
QImage img(size, include_alpha ? QImage::Format_RGBA64_Premultiplied : QImage::Format_RGBX64);
- context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_UNSIGNED_SHORT, img.bits());
+ if (!img.isNull())
+ context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_UNSIGNED_SHORT, img.bits());
return img;
}
@@ -1404,14 +1396,16 @@ static inline QImage qt_gl_read_framebuffer_rgba16f(const QSize &size, bool incl
{
// We assume OpenGL (ES) 3.0+ here.
QImage img(size, include_alpha ? QImage::Format_RGBA16FPx4_Premultiplied : QImage::Format_RGBX16FPx4);
- context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_HALF_FLOAT, img.bits());
+ if (!img.isNull())
+ context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_HALF_FLOAT, img.bits());
return img;
}
static inline QImage qt_gl_read_framebuffer_rgba32f(const QSize &size, bool include_alpha, QOpenGLContext *context)
{
QImage img(size, include_alpha ? QImage::Format_RGBA32FPx4_Premultiplied : QImage::Format_RGBX32FPx4);
- context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_FLOAT, img.bits());
+ if (!img.isNull())
+ context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_FLOAT, img.bits());
return img;
}
@@ -1450,8 +1444,7 @@ static QImage qt_gl_read_framebuffer(const QSize &size, GLenum internal_format,
return qt_gl_read_framebuffer_rgba8(size, include_alpha, ctx).mirrored(false, flip);
}
- Q_UNREACHABLE();
- return QImage();
+ Q_UNREACHABLE_RETURN(QImage());
}
Q_OPENGL_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha)
@@ -1527,7 +1520,7 @@ QImage QOpenGLFramebufferObject::toImage(bool flipped, int colorAttachmentIndex)
return QImage();
}
- if (d->colorAttachments.count() <= colorAttachmentIndex) {
+ if (d->colorAttachments.size() <= colorAttachmentIndex) {
qWarning("QOpenGLFramebufferObject::toImage() called for missing color attachment");
return QImage();
}
diff --git a/src/opengl/qopenglframebufferobject.h b/src/opengl/qopenglframebufferobject.h
index 3153aac3f6..1701901e9d 100644
--- a/src/opengl/qopenglframebufferobject.h
+++ b/src/opengl/qopenglframebufferobject.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLFRAMEBUFFEROBJECT_H
#define QOPENGLFRAMEBUFFEROBJECT_H
@@ -47,7 +11,7 @@
#include <QtCore/qscopedpointer.h>
-#if defined(Q_CLANG_QDOC)
+#if defined(Q_QDOC)
#undef GLuint
typedef unsigned int GLuint;
#undef GLenum
diff --git a/src/opengl/qopenglframebufferobject_p.h b/src/opengl/qopenglframebufferobject_p.h
index 62c541fdc3..d6c95f53de 100644
--- a/src/opengl/qopenglframebufferobject_p.h
+++ b/src/opengl/qopenglframebufferobject_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLFRAMEBUFFEROBJECT_P_H
#define QOPENGLFRAMEBUFFEROBJECT_P_H
@@ -51,6 +15,7 @@
// We mean it.
//
+#include <QtCore/qvarlengtharray.h>
#include <qopenglframebufferobject.h>
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
@@ -69,8 +34,8 @@ public:
{
#if !QT_CONFIG(opengles2)
// There is nothing that says QOpenGLFramebufferObjectFormat needs a current
- // context, so we need a fallback just to be safe, even though in pratice there
- // will usually be a context current.
+ // context, so we need a fallback just to be safe, even though in practice there
+ // will usually be a current context.
QOpenGLContext *ctx = QOpenGLContext::currentContext();
const bool isES = ctx ? ctx->isOpenGLES() : QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL;
internal_format = isES ? GL_RGBA : GL_RGBA8;
diff --git a/src/opengl/qopenglfunctions_1_0.cpp b/src/opengl/qopenglfunctions_1_0.cpp
index f440764df8..416414555b 100644
--- a/src/opengl/qopenglfunctions_1_0.cpp
+++ b/src/opengl/qopenglfunctions_1_0.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_0.h b/src/opengl/qopenglfunctions_1_0.h
index 4d0b325eb4..ea1ffd9463 100644
--- a/src/opengl/qopenglfunctions_1_0.h
+++ b/src/opengl/qopenglfunctions_1_0.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_1.cpp b/src/opengl/qopenglfunctions_1_1.cpp
index 7860123757..43f9bcb432 100644
--- a/src/opengl/qopenglfunctions_1_1.cpp
+++ b/src/opengl/qopenglfunctions_1_1.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_1.h b/src/opengl/qopenglfunctions_1_1.h
index b948b55fe6..b5565f122e 100644
--- a/src/opengl/qopenglfunctions_1_1.h
+++ b/src/opengl/qopenglfunctions_1_1.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_2.cpp b/src/opengl/qopenglfunctions_1_2.cpp
index 5993210674..cc81e15cee 100644
--- a/src/opengl/qopenglfunctions_1_2.cpp
+++ b/src/opengl/qopenglfunctions_1_2.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_2.h b/src/opengl/qopenglfunctions_1_2.h
index 3b3886e934..b028e93b25 100644
--- a/src/opengl/qopenglfunctions_1_2.h
+++ b/src/opengl/qopenglfunctions_1_2.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_3.cpp b/src/opengl/qopenglfunctions_1_3.cpp
index 41ef4d4cf3..de94e4b925 100644
--- a/src/opengl/qopenglfunctions_1_3.cpp
+++ b/src/opengl/qopenglfunctions_1_3.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_3.h b/src/opengl/qopenglfunctions_1_3.h
index 1a004c0c16..efd269a4f6 100644
--- a/src/opengl/qopenglfunctions_1_3.h
+++ b/src/opengl/qopenglfunctions_1_3.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/**************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_4.cpp b/src/opengl/qopenglfunctions_1_4.cpp
index 92a331d775..e9d87abee2 100644
--- a/src/opengl/qopenglfunctions_1_4.cpp
+++ b/src/opengl/qopenglfunctions_1_4.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_4.h b/src/opengl/qopenglfunctions_1_4.h
index af814bc047..f85b4a0be5 100644
--- a/src/opengl/qopenglfunctions_1_4.h
+++ b/src/opengl/qopenglfunctions_1_4.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/**************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_5.cpp b/src/opengl/qopenglfunctions_1_5.cpp
index d304679409..e57b7d3ac4 100644
--- a/src/opengl/qopenglfunctions_1_5.cpp
+++ b/src/opengl/qopenglfunctions_1_5.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_1_5.h b/src/opengl/qopenglfunctions_1_5.h
index 857c6d156b..3908b27b5d 100644
--- a/src/opengl/qopenglfunctions_1_5.h
+++ b/src/opengl/qopenglfunctions_1_5.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_2_0.cpp b/src/opengl/qopenglfunctions_2_0.cpp
index 63bfe641f2..0641f41390 100644
--- a/src/opengl/qopenglfunctions_2_0.cpp
+++ b/src/opengl/qopenglfunctions_2_0.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -79,7 +44,6 @@ QOpenGLFunctions_2_0::QOpenGLFunctions_2_0()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_2_0.h b/src/opengl/qopenglfunctions_2_0.h
index abe4ade56a..cca8d590e7 100644
--- a/src/opengl/qopenglfunctions_2_0.h
+++ b/src/opengl/qopenglfunctions_2_0.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -691,7 +656,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
};
// OpenGL 1.0 core functions
diff --git a/src/opengl/qopenglfunctions_2_1.cpp b/src/opengl/qopenglfunctions_2_1.cpp
index 1eb8d2a95c..28f8b29dab 100644
--- a/src/opengl/qopenglfunctions_2_1.cpp
+++ b/src/opengl/qopenglfunctions_2_1.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -80,7 +45,6 @@ QOpenGLFunctions_2_1::QOpenGLFunctions_2_1()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_2_1.h b/src/opengl/qopenglfunctions_2_1.h
index dc46d8a4b2..3b192e3b62 100644
--- a/src/opengl/qopenglfunctions_2_1.h
+++ b/src/opengl/qopenglfunctions_2_1.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -702,7 +667,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
};
// OpenGL 1.0 core functions
diff --git a/src/opengl/qopenglfunctions_3_0.cpp b/src/opengl/qopenglfunctions_3_0.cpp
index 9d933b50d5..b186ff2a9f 100644
--- a/src/opengl/qopenglfunctions_3_0.cpp
+++ b/src/opengl/qopenglfunctions_3_0.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -81,8 +46,6 @@ QOpenGLFunctions_3_0::QOpenGLFunctions_3_0()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
- , m_reserved_3_0_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_3_0.h b/src/opengl/qopenglfunctions_3_0.h
index cce2b32c81..01d6ccefaf 100644
--- a/src/opengl/qopenglfunctions_3_0.h
+++ b/src/opengl/qopenglfunctions_3_0.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -791,8 +756,8 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
- void *m_reserved_3_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_3_0_Deprecated = nullptr; // To maintain BC
};
// OpenGL 1.0 core functions
diff --git a/src/opengl/qopenglfunctions_3_1.cpp b/src/opengl/qopenglfunctions_3_1.cpp
index 353ddf35ab..a1a8851aac 100644
--- a/src/opengl/qopenglfunctions_3_1.cpp
+++ b/src/opengl/qopenglfunctions_3_1.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_3_1.h b/src/opengl/qopenglfunctions_3_1.h
index bb0c6dd26a..db25e02ca1 100644
--- a/src/opengl/qopenglfunctions_3_1.h
+++ b/src/opengl/qopenglfunctions_3_1.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_3_2_compatibility.cpp b/src/opengl/qopenglfunctions_3_2_compatibility.cpp
index 92c7b6e3ba..c1b1806998 100644
--- a/src/opengl/qopenglfunctions_3_2_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_3_2_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -83,8 +48,6 @@ QOpenGLFunctions_3_2_Compatibility::QOpenGLFunctions_3_2_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
- , m_reserved_3_0_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_3_2_compatibility.h b/src/opengl/qopenglfunctions_3_2_compatibility.h
index 413b106b44..b01c232385 100644
--- a/src/opengl/qopenglfunctions_3_2_compatibility.h
+++ b/src/opengl/qopenglfunctions_3_2_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -832,8 +797,8 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
- void *m_reserved_3_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_3_0_Deprecated = nullptr; // To maintain BC
};
// OpenGL 1.0 core functions
diff --git a/src/opengl/qopenglfunctions_3_2_core.cpp b/src/opengl/qopenglfunctions_3_2_core.cpp
index 5f7d32fb61..a989d33105 100644
--- a/src/opengl/qopenglfunctions_3_2_core.cpp
+++ b/src/opengl/qopenglfunctions_3_2_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_3_2_core.h b/src/opengl/qopenglfunctions_3_2_core.h
index 543f2ae26b..33ba1d340f 100644
--- a/src/opengl/qopenglfunctions_3_2_core.h
+++ b/src/opengl/qopenglfunctions_3_2_core.h
@@ -1,42 +1,7 @@
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_3_3_compatibility.cpp b/src/opengl/qopenglfunctions_3_3_compatibility.cpp
index 9b9617c1e7..60ef10553b 100644
--- a/src/opengl/qopenglfunctions_3_3_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_3_3_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -84,7 +49,6 @@ QOpenGLFunctions_3_3_Compatibility::QOpenGLFunctions_3_3_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_3_3_compatibility.h b/src/opengl/qopenglfunctions_3_3_compatibility.h
index ee8884d6b0..25490648f3 100644
--- a/src/opengl/qopenglfunctions_3_3_compatibility.h
+++ b/src/opengl/qopenglfunctions_3_3_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -895,7 +860,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
QOpenGLFunctions_3_3_DeprecatedBackend* d_3_3_Deprecated;
};
diff --git a/src/opengl/qopenglfunctions_3_3_core.cpp b/src/opengl/qopenglfunctions_3_3_core.cpp
index 78a2e8b568..086278bcfa 100644
--- a/src/opengl/qopenglfunctions_3_3_core.cpp
+++ b/src/opengl/qopenglfunctions_3_3_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_3_3_core.h b/src/opengl/qopenglfunctions_3_3_core.h
index ca63e38345..ce4cc18600 100644
--- a/src/opengl/qopenglfunctions_3_3_core.h
+++ b/src/opengl/qopenglfunctions_3_3_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_0_compatibility.cpp b/src/opengl/qopenglfunctions_4_0_compatibility.cpp
index e94a0bf5ab..7074de5bde 100644
--- a/src/opengl/qopenglfunctions_4_0_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_0_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -85,7 +50,6 @@ QOpenGLFunctions_4_0_Compatibility::QOpenGLFunctions_4_0_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_4_0_compatibility.h b/src/opengl/qopenglfunctions_4_0_compatibility.h
index 8b6027e0fc..b72d01305a 100644
--- a/src/opengl/qopenglfunctions_4_0_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_0_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -946,7 +911,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
QOpenGLFunctions_3_3_DeprecatedBackend* d_3_3_Deprecated;
};
diff --git a/src/opengl/qopenglfunctions_4_0_core.cpp b/src/opengl/qopenglfunctions_4_0_core.cpp
index a5fc44f31d..20ac8c13a7 100644
--- a/src/opengl/qopenglfunctions_4_0_core.cpp
+++ b/src/opengl/qopenglfunctions_4_0_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/**************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_0_core.h b/src/opengl/qopenglfunctions_4_0_core.h
index 0007c3e7cd..e8e7359868 100644
--- a/src/opengl/qopenglfunctions_4_0_core.h
+++ b/src/opengl/qopenglfunctions_4_0_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_1_compatibility.cpp b/src/opengl/qopenglfunctions_4_1_compatibility.cpp
index 6198412ebc..035cc79276 100644
--- a/src/opengl/qopenglfunctions_4_1_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_1_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -86,7 +51,6 @@ QOpenGLFunctions_4_1_Compatibility::QOpenGLFunctions_4_1_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_4_1_compatibility.h b/src/opengl/qopenglfunctions_4_1_compatibility.h
index 72d122e1f2..08b7c05232 100644
--- a/src/opengl/qopenglfunctions_4_1_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_1_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -1039,7 +1004,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
QOpenGLFunctions_3_3_DeprecatedBackend* d_3_3_Deprecated;
};
diff --git a/src/opengl/qopenglfunctions_4_1_core.cpp b/src/opengl/qopenglfunctions_4_1_core.cpp
index 81eedaa7bb..e7925b1c44 100644
--- a/src/opengl/qopenglfunctions_4_1_core.cpp
+++ b/src/opengl/qopenglfunctions_4_1_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_1_core.h b/src/opengl/qopenglfunctions_4_1_core.h
index c1862357bd..affcac9300 100644
--- a/src/opengl/qopenglfunctions_4_1_core.h
+++ b/src/opengl/qopenglfunctions_4_1_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_2_compatibility.cpp b/src/opengl/qopenglfunctions_4_2_compatibility.cpp
index f04a30854b..faf0ca845f 100644
--- a/src/opengl/qopenglfunctions_4_2_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_2_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -87,7 +52,6 @@ QOpenGLFunctions_4_2_Compatibility::QOpenGLFunctions_4_2_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_4_2_compatibility.h b/src/opengl/qopenglfunctions_4_2_compatibility.h
index 6fca54752d..2bc4f8b228 100644
--- a/src/opengl/qopenglfunctions_4_2_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_2_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -1062,7 +1027,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
QOpenGLFunctions_3_3_DeprecatedBackend* d_3_3_Deprecated;
};
diff --git a/src/opengl/qopenglfunctions_4_2_core.cpp b/src/opengl/qopenglfunctions_4_2_core.cpp
index 15d7eba25a..bad52e46eb 100644
--- a/src/opengl/qopenglfunctions_4_2_core.cpp
+++ b/src/opengl/qopenglfunctions_4_2_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_2_core.h b/src/opengl/qopenglfunctions_4_2_core.h
index a1d7ec689d..f4d25b8e89 100644
--- a/src/opengl/qopenglfunctions_4_2_core.h
+++ b/src/opengl/qopenglfunctions_4_2_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_3_compatibility.cpp b/src/opengl/qopenglfunctions_4_3_compatibility.cpp
index d17a4adb10..c3a3d5d32b 100644
--- a/src/opengl/qopenglfunctions_4_3_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_3_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -88,7 +53,6 @@ QOpenGLFunctions_4_3_Compatibility::QOpenGLFunctions_4_3_Compatibility()
, d_1_2_Deprecated(nullptr)
, d_1_3_Deprecated(nullptr)
, d_1_4_Deprecated(nullptr)
- , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(nullptr)
{
}
diff --git a/src/opengl/qopenglfunctions_4_3_compatibility.h b/src/opengl/qopenglfunctions_4_3_compatibility.h
index bff937d86a..0370637653 100644
--- a/src/opengl/qopenglfunctions_4_3_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_3_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -1100,7 +1065,7 @@ private:
QOpenGLFunctions_1_2_DeprecatedBackend* d_1_2_Deprecated;
QOpenGLFunctions_1_3_DeprecatedBackend* d_1_3_Deprecated;
QOpenGLFunctions_1_4_DeprecatedBackend* d_1_4_Deprecated;
- void *m_reserved_2_0_Deprecated; // To maintain BC
+ Q_DECL_UNUSED_MEMBER void *m_reserved_2_0_Deprecated = nullptr; // To maintain BC
QOpenGLFunctions_3_3_DeprecatedBackend* d_3_3_Deprecated;
};
diff --git a/src/opengl/qopenglfunctions_4_3_core.cpp b/src/opengl/qopenglfunctions_4_3_core.cpp
index 72c09db076..f2f2fd3d71 100644
--- a/src/opengl/qopenglfunctions_4_3_core.cpp
+++ b/src/opengl/qopenglfunctions_4_3_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_3_core.h b/src/opengl/qopenglfunctions_4_3_core.h
index 495f325776..f31cae2759 100644
--- a/src/opengl/qopenglfunctions_4_3_core.h
+++ b/src/opengl/qopenglfunctions_4_3_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_4_compatibility.cpp b/src/opengl/qopenglfunctions_4_4_compatibility.cpp
index 38348869db..308bab1afb 100644
--- a/src/opengl/qopenglfunctions_4_4_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_4_compatibility.cpp
@@ -1,41 +1,6 @@
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_4_compatibility.h b/src/opengl/qopenglfunctions_4_4_compatibility.h
index af23197dfa..e51e1976b1 100644
--- a/src/opengl/qopenglfunctions_4_4_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_4_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_4_core.cpp b/src/opengl/qopenglfunctions_4_4_core.cpp
index e0a78e1527..06020de64f 100644
--- a/src/opengl/qopenglfunctions_4_4_core.cpp
+++ b/src/opengl/qopenglfunctions_4_4_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_4_core.h b/src/opengl/qopenglfunctions_4_4_core.h
index 2b7cb71dfc..310447698a 100644
--- a/src/opengl/qopenglfunctions_4_4_core.h
+++ b/src/opengl/qopenglfunctions_4_4_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_5_compatibility.cpp b/src/opengl/qopenglfunctions_4_5_compatibility.cpp
index 253b305452..f67de09632 100644
--- a/src/opengl/qopenglfunctions_4_5_compatibility.cpp
+++ b/src/opengl/qopenglfunctions_4_5_compatibility.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_5_compatibility.h b/src/opengl/qopenglfunctions_4_5_compatibility.h
index 620ee6862e..cca3eae9e2 100644
--- a/src/opengl/qopenglfunctions_4_5_compatibility.h
+++ b/src/opengl/qopenglfunctions_4_5_compatibility.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -735,25 +700,52 @@ public:
void glNamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param);
void glNamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void glCreateFramebuffers(GLsizei n, GLuint *framebuffers);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data);
+#else
void glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, void *data);
+#endif
void glGetNamedBufferPointerv(GLuint buffer, GLenum pname, void * *params);
void glGetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64 *params);
void glGetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length);
+#else
void glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length);
+#endif
GLboolean glUnmapNamedBuffer(GLuint buffer);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void * glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+#else
void * glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
+#endif
void * glMapNamedBuffer(GLuint buffer, GLenum access);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+#else
void glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
+#endif
void glClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
+ void glNamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
+ void glNamedBufferStorage(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
+#else
void glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
void glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data);
void glNamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage);
void glNamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
+#endif
void glCreateBuffers(GLsizei n, GLuint *buffers);
void glGetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
void glGetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index, GLint *param);
void glGetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#else
void glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
+#endif
void glTransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer);
void glCreateTransformFeedbacks(GLsizei n, GLuint *ids);
void glClipControl(GLenum origin, GLenum depth);
@@ -4416,7 +4408,11 @@ inline void QOpenGLFunctions_4_5_Compatibility::glCreateFramebuffers(GLsizei n,
d_4_5_Core->f.CreateFramebuffers(n, framebuffers);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, void *data)
+#endif
{
d_4_5_Core->f.GetNamedBufferSubData(buffer, offset, size, data);
}
@@ -4436,7 +4432,11 @@ inline void QOpenGLFunctions_4_5_Compatibility::glGetNamedBufferParameteriv(GLui
d_4_5_Core->f.GetNamedBufferParameteriv(buffer, pname, params);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length)
+#endif
{
d_4_5_Core->f.FlushMappedNamedBufferRange(buffer, offset, length);
}
@@ -4446,7 +4446,11 @@ inline GLboolean QOpenGLFunctions_4_5_Compatibility::glUnmapNamedBuffer(GLuint b
return d_4_5_Core->f.UnmapNamedBuffer(buffer);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void * QOpenGLFunctions_4_5_Compatibility::glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access)
+#else
inline void * QOpenGLFunctions_4_5_Compatibility::glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access)
+#endif
{
return d_4_5_Core->f.MapNamedBufferRange(buffer, offset, length, access);
}
@@ -4456,7 +4460,11 @@ inline void * QOpenGLFunctions_4_5_Compatibility::glMapNamedBuffer(GLuint buffer
return d_4_5_Core->f.MapNamedBuffer(buffer, access);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data)
+#endif
{
d_4_5_Core->f.ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data);
}
@@ -4466,22 +4474,38 @@ inline void QOpenGLFunctions_4_5_Compatibility::glClearNamedBufferData(GLuint bu
d_4_5_Core->f.ClearNamedBufferData(buffer, internalformat, format, type, data);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size)
+#endif
{
d_4_5_Core->f.CopyNamedBufferSubData(readBuffer, writeBuffer, readOffset, writeOffset, size);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data)
+#endif
{
d_4_5_Core->f.NamedBufferSubData(buffer, offset, size, data);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage)
+#endif
{
d_4_5_Core->f.NamedBufferData(buffer, size, data, usage);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferStorage(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glNamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags)
+#endif
{
d_4_5_Core->f.NamedBufferStorage(buffer, size, data, flags);
}
@@ -4506,7 +4530,11 @@ inline void QOpenGLFunctions_4_5_Compatibility::glGetTransformFeedbackiv(GLuint
d_4_5_Core->f.GetTransformFeedbackiv(xfb, pname, param);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Compatibility::glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+#else
inline void QOpenGLFunctions_4_5_Compatibility::glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size)
+#endif
{
d_4_5_Core->f.TransformFeedbackBufferRange(xfb, index, buffer, offset, size);
}
diff --git a/src/opengl/qopenglfunctions_4_5_core.cpp b/src/opengl/qopenglfunctions_4_5_core.cpp
index b680629e91..47066a365f 100644
--- a/src/opengl/qopenglfunctions_4_5_core.cpp
+++ b/src/opengl/qopenglfunctions_4_5_core.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglfunctions_4_5_core.h b/src/opengl/qopenglfunctions_4_5_core.h
index fe0c0f1917..e3944f0741 100644
--- a/src/opengl/qopenglfunctions_4_5_core.h
+++ b/src/opengl/qopenglfunctions_4_5_core.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -735,25 +700,52 @@ public:
void glNamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param);
void glNamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void glCreateFramebuffers(GLsizei n, GLuint *framebuffers);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data);
+#else
void glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, void *data);
+#endif
void glGetNamedBufferPointerv(GLuint buffer, GLenum pname, void * *params);
void glGetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64 *params);
void glGetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length);
+#else
void glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length);
+#endif
GLboolean glUnmapNamedBuffer(GLuint buffer);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void * glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+#else
void * glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
+#endif
void * glMapNamedBuffer(GLuint buffer, GLenum access);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+#else
void glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
+#endif
void glClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
+ void glNamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
+ void glNamedBufferStorage(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
+#else
void glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
void glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data);
void glNamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage);
void glNamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
+#endif
void glCreateBuffers(GLsizei n, GLuint *buffers);
void glGetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
void glGetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index, GLint *param);
void glGetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+ void glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#else
void glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
+#endif
void glTransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer);
void glCreateTransformFeedbacks(GLsizei n, GLuint *ids);
void glClipControl(GLenum origin, GLenum depth);
@@ -3949,7 +3941,11 @@ inline void QOpenGLFunctions_4_5_Core::glCreateFramebuffers(GLsizei n, GLuint *f
d_4_5_Core->f.CreateFramebuffers(n, framebuffers);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data)
+#else
inline void QOpenGLFunctions_4_5_Core::glGetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, void *data)
+#endif
{
d_4_5_Core->f.GetNamedBufferSubData(buffer, offset, size, data);
}
@@ -3969,7 +3965,11 @@ inline void QOpenGLFunctions_4_5_Core::glGetNamedBufferParameteriv(GLuint buffer
d_4_5_Core->f.GetNamedBufferParameteriv(buffer, pname, params);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
+#else
inline void QOpenGLFunctions_4_5_Core::glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length)
+#endif
{
d_4_5_Core->f.FlushMappedNamedBufferRange(buffer, offset, length);
}
@@ -3979,7 +3979,11 @@ inline GLboolean QOpenGLFunctions_4_5_Core::glUnmapNamedBuffer(GLuint buffer)
return d_4_5_Core->f.UnmapNamedBuffer(buffer);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void * QOpenGLFunctions_4_5_Core::glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access)
+#else
inline void * QOpenGLFunctions_4_5_Core::glMapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access)
+#endif
{
return d_4_5_Core->f.MapNamedBufferRange(buffer, offset, length, access);
}
@@ -3989,7 +3993,11 @@ inline void * QOpenGLFunctions_4_5_Core::glMapNamedBuffer(GLuint buffer, GLenum
return d_4_5_Core->f.MapNamedBuffer(buffer, access);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data)
+#else
inline void QOpenGLFunctions_4_5_Core::glClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data)
+#endif
{
d_4_5_Core->f.ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data);
}
@@ -3999,22 +4007,38 @@ inline void QOpenGLFunctions_4_5_Core::glClearNamedBufferData(GLuint buffer, GLe
d_4_5_Core->f.ClearNamedBufferData(buffer, internalformat, format, type, data);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+#else
inline void QOpenGLFunctions_4_5_Core::glCopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size)
+#endif
{
d_4_5_Core->f.CopyNamedBufferSubData(readBuffer, writeBuffer, readOffset, writeOffset, size);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data)
+#else
inline void QOpenGLFunctions_4_5_Core::glNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data)
+#endif
{
d_4_5_Core->f.NamedBufferSubData(buffer, offset, size, data);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glNamedBufferData(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage)
+#else
inline void QOpenGLFunctions_4_5_Core::glNamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage)
+#endif
{
d_4_5_Core->f.NamedBufferData(buffer, size, data, usage);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glNamedBufferStorage(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags)
+#else
inline void QOpenGLFunctions_4_5_Core::glNamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags)
+#endif
{
d_4_5_Core->f.NamedBufferStorage(buffer, size, data, flags);
}
@@ -4039,7 +4063,11 @@ inline void QOpenGLFunctions_4_5_Core::glGetTransformFeedbackiv(GLuint xfb, GLen
d_4_5_Core->f.GetTransformFeedbackiv(xfb, pname, param);
}
+#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
+inline void QOpenGLFunctions_4_5_Core::glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+#else
inline void QOpenGLFunctions_4_5_Core::glTransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size)
+#endif
{
d_4_5_Core->f.TransformFeedbackBufferRange(xfb, index, buffer, offset, size);
}
diff --git a/src/opengl/qopenglfunctions_es2.cpp b/src/opengl/qopenglfunctions_es2.cpp
index 39d86e647f..1bba9ded7a 100644
--- a/src/opengl/qopenglfunctions_es2.cpp
+++ b/src/opengl/qopenglfunctions_es2.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglfunctions_es2.h"
#include "qopenglcontext.h"
diff --git a/src/opengl/qopenglfunctions_es2.h b/src/opengl/qopenglfunctions_es2.h
index e9837bae29..5623138a3f 100644
--- a/src/opengl/qopenglfunctions_es2.h
+++ b/src/opengl/qopenglfunctions_es2.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLVERSIONFUNCTIONS_ES2_H
#define QOPENGLVERSIONFUNCTIONS_ES2_H
diff --git a/src/opengl/qopenglgradientcache.cpp b/src/opengl/qopenglgradientcache.cpp
index 7a932a19bb..24453655e2 100644
--- a/src/opengl/qopenglgradientcache.cpp
+++ b/src/opengl/qopenglgradientcache.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglgradientcache_p.h"
#include <private/qdrawhelper_p.h>
diff --git a/src/opengl/qopenglgradientcache_p.h b/src/opengl/qopenglgradientcache_p.h
index da070ae233..d888d7d21b 100644
--- a/src/opengl/qopenglgradientcache_p.h
+++ b/src/opengl/qopenglgradientcache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLGRADIENTCACHE_P_H
#define QOPENGLGRADIENTCACHE_P_H
diff --git a/src/opengl/qopenglpaintdevice.cpp b/src/opengl/qopenglpaintdevice.cpp
index 158dacf241..fbc54c46fb 100644
--- a/src/opengl/qopenglpaintdevice.cpp
+++ b/src/opengl/qopenglpaintdevice.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <qopenglpaintdevice.h>
#include <qpaintengine.h>
diff --git a/src/opengl/qopenglpaintdevice.h b/src/opengl/qopenglpaintdevice.h
index f4e1ce4a2e..f71d5054ca 100644
--- a/src/opengl/qopenglpaintdevice.h
+++ b/src/opengl/qopenglpaintdevice.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLPAINTDEVICE_H
#define QOPENGLPAINTDEVICE_H
diff --git a/src/opengl/qopenglpaintdevice_p.h b/src/opengl/qopenglpaintdevice_p.h
index f4f02e7b57..4de11f3cde 100644
--- a/src/opengl/qopenglpaintdevice_p.h
+++ b/src/opengl/qopenglpaintdevice_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGL_PAINTDEVICE_P_H
#define QOPENGL_PAINTDEVICE_P_H
@@ -52,6 +16,7 @@
//
#include <qopenglpaintdevice.h>
+#include <private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qopenglpaintengine.cpp b/src/opengl/qopenglpaintengine.cpp
index 8606a2e7ef..972e276370 100644
--- a/src/opengl/qopenglpaintengine.cpp
+++ b/src/opengl/qopenglpaintengine.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/*
When the active program changes, we need to update it's uniforms.
@@ -112,7 +76,7 @@
QT_BEGIN_NAMESPACE
-Q_OPENGL_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert);
+Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert);
////////////////////////////////// Private Methods //////////////////////////////////////////
@@ -187,7 +151,7 @@ void QOpenGL2PaintEngineExPrivate::useSimpleShader()
\note Any code or Qt API that internally activates or binds will
not affect the cache used by this function, which means they will
- lead to inconsisent state. QPainter::beginNativePainting() takes
+ lead to inconsistent state. QPainter::beginNativePainting() takes
care of resetting the cache, so for user–code this is fine, but
internally in the paint engine care must be taken to not call
functions that may activate or bind under our feet.
@@ -196,10 +160,14 @@ template<typename T>
void QOpenGL2PaintEngineExPrivate::updateTexture(GLenum textureUnit, const T &texture, GLenum wrapMode, GLenum filterMode, TextureUpdateMode updateMode)
{
static const GLenum target = GL_TEXTURE_2D;
+ bool newTextureCreated = false;
activateTextureUnit(textureUnit);
- GLuint textureId = bindTexture(texture);
+ GLuint textureId = bindTexture(texture, &newTextureCreated);
+
+ if (newTextureCreated)
+ lastTextureUsed = GLuint(-1);
if (updateMode == UpdateIfNeeded && textureId == lastTextureUsed)
return;
@@ -228,8 +196,11 @@ void QOpenGL2PaintEngineExPrivate::activateTextureUnit(GLenum textureUnit)
}
template<>
-GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const GLuint &textureId)
+GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const GLuint &textureId, bool *newTextureCreated)
{
+ if (newTextureCreated)
+ *newTextureCreated = false;
+
if (textureId != lastTextureUsed)
funcs.glBindTexture(GL_TEXTURE_2D, textureId);
@@ -237,19 +208,25 @@ GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const GLuint &textureId)
}
template<>
-GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QImage &image)
+GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QImage &image, bool *newTextureCreated)
{
- return QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, image);
+ QOpenGLTextureCache::BindResult result = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, image);
+ if (newTextureCreated)
+ *newTextureCreated = result.flags.testFlag(QOpenGLTextureCache::BindResultFlag::NewTexture);
+ return result.id;
}
template<>
-GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QPixmap &pixmap)
+GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QPixmap &pixmap, bool *newTextureCreated)
{
- return QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, pixmap);
+ QOpenGLTextureCache::BindResult result = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, pixmap);
+ if (newTextureCreated)
+ *newTextureCreated = result.flags.testFlag(QOpenGLTextureCache::BindResultFlag::NewTexture);
+ return result.id;
}
template<>
-GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QGradient &gradient)
+GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QGradient &gradient, bool *newTextureCreated)
{
// We apply global opacity in the fragment shaders, so we always pass 1.0
// for opacity to the cache.
@@ -259,7 +236,7 @@ GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const QGradient &gradient)
// hasn't been cached yet, but will otherwise return an unbound texture id. To
// be sure that the texture is bound, we unfortunately have to bind again,
// which results in the initial generation of the texture doing two binds.
- return bindTexture(textureId);
+ return bindTexture(textureId, newTextureCreated);
}
struct ImageWithBindOptions
@@ -269,9 +246,14 @@ struct ImageWithBindOptions
};
template<>
-GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const ImageWithBindOptions &imageWithOptions)
+GLuint QOpenGL2PaintEngineExPrivate::bindTexture(const ImageWithBindOptions &imageWithOptions, bool *newTextureCreated)
{
- return QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx, imageWithOptions.image, imageWithOptions.options);
+ QOpenGLTextureCache::BindResult result = QOpenGLTextureCache::cacheForContext(ctx)->bindTexture(ctx,
+ imageWithOptions.image,
+ imageWithOptions.options);
+ if (newTextureCreated)
+ *newTextureCreated = result.flags.testFlag(QOpenGLTextureCache::BindResultFlag::NewTexture);
+ return result.id;
}
inline static bool isPowerOfTwo(int x)
@@ -340,6 +322,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushUniforms()
return;
QTransform brushQTransform = currentBrush.transform();
+ bool isCosmetic = false;
if (style == Qt::SolidPattern) {
QColor col = qt_premultiplyColor(currentBrush.color(), (GLfloat)q->state()->opacity);
@@ -356,6 +339,8 @@ void QOpenGL2PaintEngineExPrivate::updateBrushUniforms()
QVector2D halfViewportSize(width*0.5, height*0.5);
shaderManager->currentProgram()->setUniformValue(location(QOpenGLEngineShaderManager::HalfViewportSize), halfViewportSize);
+
+ isCosmetic = !q->painter()->testRenderHint(QPainter::NonCosmeticBrushPatterns);
}
else if (style == Qt::LinearGradientPattern) {
const QLinearGradient *g = static_cast<const QLinearGradient *>(currentBrush.gradient());
@@ -430,8 +415,12 @@ void QOpenGL2PaintEngineExPrivate::updateBrushUniforms()
qWarning("QOpenGL2PaintEngineEx: Unimplemented fill style");
const QPointF &brushOrigin = q->state()->brushOrigin;
- QTransform matrix = q->state()->matrix;
+ QTransform matrix;
+ if (!isCosmetic)
+ matrix = q->state()->matrix;
matrix.translate(brushOrigin.x(), brushOrigin.y());
+ if (!isCosmetic)
+ matrix = brushQTransform * matrix;
QTransform translate(1, 0, 0, 1, -translationPoint.x(), -translationPoint.y());
qreal m22 = -1;
@@ -441,7 +430,7 @@ void QOpenGL2PaintEngineExPrivate::updateBrushUniforms()
dy = 0;
}
QTransform gl_to_qt(1, 0, 0, m22, 0, dy);
- QTransform inv_matrix = gl_to_qt * (brushQTransform * matrix).inverted() * translate;
+ QTransform inv_matrix = gl_to_qt * matrix.inverted() * translate;
shaderManager->currentProgram()->setUniformValue(location(QOpenGLEngineShaderManager::BrushTransform), inv_matrix);
shaderManager->currentProgram()->setUniformValue(location(QOpenGLEngineShaderManager::BrushTexture), QT_BRUSH_TEXTURE_UNIT);
@@ -635,8 +624,9 @@ static inline void setCoords(GLfloat *coords, const QOpenGLRect &rect)
coords[7] = rect.bottom;
}
-void QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
+void Q_TRACE_INSTRUMENT(qtopengl) QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
{
+ Q_TRACE_PARAM_REPLACE(QOpenGLRect, QRectF);
Q_TRACE_SCOPE(QOpenGL2PaintEngineExPrivate_drawTexture, dest, src, textureSize, opaque, pattern);
// Setup for texture drawing
@@ -755,11 +745,11 @@ void QOpenGL2PaintEngineExPrivate::resetGLState()
float color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
funcs.glVertexAttrib4fv(3, color);
}
- if (vao.isCreated()) {
+ if (vao.isCreated())
vao.release();
- funcs.glBindBuffer(GL_ARRAY_BUFFER, 0);
- funcs.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- }
+
+ funcs.glBindBuffer(GL_ARRAY_BUFFER, 0);
+ funcs.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void QOpenGL2PaintEngineEx::endNativePainting()
@@ -854,8 +844,11 @@ void QOpenGL2PaintEngineExPrivate::fill(const QVectorPath& path)
}
// Might need to call updateMatrix to re-calculate inverseScale
- if (matrixDirty)
+ if (matrixDirty) {
updateMatrix();
+ if (currentBrush.style() > Qt::SolidPattern)
+ brushUniformsDirty = true;
+ }
const bool supportsElementIndexUint = funcs.hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint);
@@ -1124,6 +1117,10 @@ void QOpenGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data,
funcs.glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes
useSimpleShader();
+#ifndef QT_NO_DEBUG
+ if (ctx->format().stencilBufferSize() <= 0)
+ qWarning("OpenGL paint engine: attempted to use stencil test without requesting a stencil buffer.");
+#endif
funcs.glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d
if (mode == WindingFillMode) {
@@ -1451,7 +1448,12 @@ void QOpenGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &p
void QOpenGL2PaintEngineEx::penChanged() { }
void QOpenGL2PaintEngineEx::brushChanged() { }
-void QOpenGL2PaintEngineEx::brushOriginChanged() { }
+
+void QOpenGL2PaintEngineEx::brushOriginChanged()
+{
+ Q_D(QOpenGL2PaintEngineEx);
+ d->brushUniformsDirty = true;
+}
void QOpenGL2PaintEngineEx::opacityChanged()
{
@@ -1494,7 +1496,7 @@ void QOpenGL2PaintEngineEx::renderHintsChanged()
d->lastTextureUsed = GLuint(-1);
d->brushTextureDirty = true;
-// qDebug("QOpenGL2PaintEngineEx::renderHintsChanged() not implemented!");
+ d->brushUniformsDirty = true;
}
void QOpenGL2PaintEngineEx::transformChanged()
@@ -2149,6 +2151,10 @@ void QOpenGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFra
transferMode(ImageOpacityArrayDrawingMode);
+ uploadData(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data(), vertexCoordinateArray.vertexCount() * 2);
+ uploadData(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data(), textureCoordinateArray.vertexCount() * 2);
+ uploadData(QT_OPACITY_ATTR, (GLfloat*)opacityArray.data(), opacityArray.size());
+
GLenum filterMode = q->state()->renderHints & QPainter::SmoothPixmapTransform ? GL_LINEAR : GL_NEAREST;
updateTexture(QT_IMAGE_TEXTURE_UNIT, pixmap, GL_CLAMP_TO_EDGE, filterMode);
@@ -2215,28 +2221,27 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev)
bool created = d->vao.create();
// If we managed to create it then we have a profile that supports VAOs
- if (created) {
+ if (created)
d->vao.bind();
+ }
- // Generate a new Vertex Buffer Object if we don't have one already
- if (!d->vertexBuffer.isCreated()) {
- d->vertexBuffer.create();
- // Set its usage to StreamDraw, we will use this buffer only a few times before refilling it
- d->vertexBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
- }
- if (!d->texCoordBuffer.isCreated()) {
- d->texCoordBuffer.create();
- d->texCoordBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
- }
- if (!d->opacityBuffer.isCreated()) {
- d->opacityBuffer.create();
- d->opacityBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
- }
- if (!d->indexBuffer.isCreated()) {
- d->indexBuffer.create();
- d->indexBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
- }
- }
+ // Generate a new Vertex Buffer Object if we don't have one already
+ if (!d->vertexBuffer.isCreated()) {
+ d->vertexBuffer.create();
+ // Set its usage to StreamDraw, we will use this buffer only a few times before refilling it
+ d->vertexBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
+ }
+ if (!d->texCoordBuffer.isCreated()) {
+ d->texCoordBuffer.create();
+ d->texCoordBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
+ }
+ if (!d->opacityBuffer.isCreated()) {
+ d->opacityBuffer.create();
+ d->opacityBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
+ }
+ if (!d->indexBuffer.isCreated()) {
+ d->indexBuffer.create();
+ d->indexBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
}
for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
@@ -2346,6 +2351,10 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest()
{
Q_Q(QOpenGL2PaintEngineEx);
if (q->state()->clipTestEnabled) {
+#ifndef QT_NO_DEBUG
+ if (ctx->format().stencilBufferSize() <= 0)
+ qWarning("OpenGL paint engine: attempted to use stencil test for clipping without requesting a stencil buffer.");
+#endif
funcs.glEnable(GL_STENCIL_TEST);
funcs.glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
} else {
@@ -2518,7 +2527,7 @@ void QOpenGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op)
&& qFuzzyIsNull(state()->matrix.m11())
&& qFuzzyIsNull(state()->matrix.m22())))
{
- state()->rectangleClip = state()->rectangleClip.intersected(state()->matrix.mapRect(rect).toAlignedRect());
+ state()->rectangleClip &= qt_mapFillRect(rect, state()->matrix);
d->updateClipScissorTest();
return;
}
diff --git a/src/opengl/qopenglpaintengine_p.h b/src/opengl/qopenglpaintengine_p.h
index f2e5d97f39..40ed7fe609 100644
--- a/src/opengl/qopenglpaintengine_p.h
+++ b/src/opengl/qopenglpaintengine_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLPAINTENGINE_P_H
#define QOPENGLPAINTENGINE_P_H
@@ -213,7 +177,7 @@ public:
template<typename T>
void updateTexture(GLenum textureUnit, const T &texture, GLenum wrapMode, GLenum filterMode, TextureUpdateMode updateMode = UpdateIfNeeded);
template<typename T>
- GLuint bindTexture(const T &texture);
+ GLuint bindTexture(const T &texture, bool *newTextureCreated);
void activateTextureUnit(GLenum textureUnit);
void resetGLState();
@@ -343,51 +307,32 @@ void QOpenGL2PaintEngineExPrivate::uploadData(unsigned int arrayIndex, const GLf
{
Q_ASSERT(arrayIndex < 3);
- // If a vertex array object is created we have a profile that supports them
- // and we will upload the data via a QOpenGLBuffer. Otherwise we will use
- // the legacy way of uploading the data via glVertexAttribPointer.
- if (vao.isCreated()) {
- if (arrayIndex == QT_VERTEX_COORDS_ATTR) {
- vertexBuffer.bind();
- vertexBuffer.allocate(data, count * sizeof(float));
- }
- if (arrayIndex == QT_TEXTURE_COORDS_ATTR) {
- texCoordBuffer.bind();
- texCoordBuffer.allocate(data, count * sizeof(float));
- }
- if (arrayIndex == QT_OPACITY_ATTR) {
- opacityBuffer.bind();
- opacityBuffer.allocate(data, count * sizeof(float));
- }
- if (arrayIndex == QT_OPACITY_ATTR)
- funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, nullptr);
- else
- funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
+ if (arrayIndex == QT_VERTEX_COORDS_ATTR) {
+ vertexBuffer.bind();
+ vertexBuffer.allocate(data, count * sizeof(float));
+ }
+ if (arrayIndex == QT_TEXTURE_COORDS_ATTR) {
+ texCoordBuffer.bind();
+ texCoordBuffer.allocate(data, count * sizeof(float));
+ }
+ if (arrayIndex == QT_OPACITY_ATTR) {
+ opacityBuffer.bind();
+ opacityBuffer.allocate(data, count * sizeof(float));
+
+ funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, nullptr);
} else {
- // If we already uploaded the data we don't have to do it again
- if (data == vertexAttribPointers[arrayIndex])
- return;
-
- // Store the data in cache and upload it to the graphics card.
- vertexAttribPointers[arrayIndex] = data;
- if (arrayIndex == QT_OPACITY_ATTR)
- funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, data);
- else
- funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, data);
+ funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
}
}
bool QOpenGL2PaintEngineExPrivate::uploadIndexData(const void *data, GLenum indexValueType, GLuint count)
{
- // Follow the uploadData() logic: VBOs are used only when VAO support is available.
- // Otherwise the legacy client-side pointer path is used.
- if (vao.isCreated()) {
- Q_ASSERT(indexValueType == GL_UNSIGNED_SHORT || indexValueType == GL_UNSIGNED_INT);
- indexBuffer.bind();
- indexBuffer.allocate(data, count * (indexValueType == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32)));
- return true;
- }
- return false;
+ Q_ASSERT(indexValueType == GL_UNSIGNED_SHORT || indexValueType == GL_UNSIGNED_INT);
+ indexBuffer.bind();
+ indexBuffer.allocate(
+ data,
+ count * (indexValueType == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32)));
+ return true;
}
QT_END_NAMESPACE
diff --git a/src/opengl/qopenglpixeltransferoptions.cpp b/src/opengl/qopenglpixeltransferoptions.cpp
index aa1af3b092..2e6766ca6a 100644
--- a/src/opengl/qopenglpixeltransferoptions.cpp
+++ b/src/opengl/qopenglpixeltransferoptions.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglpixeltransferoptions.h"
#include <QSharedData>
@@ -44,6 +8,7 @@ QT_BEGIN_NAMESPACE
/*!
* \class QOpenGLPixelTransferOptions
+ * \inmodule QtOpenGL
*
* \brief The QOpenGLPixelTransferOptions class describes the pixel storage
* modes that affect the unpacking of pixels during texture upload.
diff --git a/src/opengl/qopenglpixeltransferoptions.h b/src/opengl/qopenglpixeltransferoptions.h
index 1f9c1eb9db..02139309cf 100644
--- a/src/opengl/qopenglpixeltransferoptions.h
+++ b/src/opengl/qopenglpixeltransferoptions.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLPIXELUPLOADOPTIONS_H
#define QOPENGLPIXELUPLOADOPTIONS_H
diff --git a/src/opengl/qopenglqueryhelper_p.h b/src/opengl/qopenglqueryhelper_p.h
index 40fe4cd89d..231888bff0 100644
--- a/src/opengl/qopenglqueryhelper_p.h
+++ b/src/opengl/qopenglqueryhelper_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLQUERYHELPER_P_H
#define QOPENGLQUERYHELPER_P_H
diff --git a/src/opengl/qopenglshadercache_p.h b/src/opengl/qopenglshadercache_p.h
index 88efa34216..8221995797 100644
--- a/src/opengl/qopenglshadercache_p.h
+++ b/src/opengl/qopenglshadercache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -52,6 +16,7 @@
#define QOPENGLSHADERCACHE_P_H
#include <QtOpenGL/qtopenglglobal.h>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qopenglshaderprogram.cpp b/src/opengl/qopenglshaderprogram.cpp
index da3ff392ef..fb33bf0d5c 100644
--- a/src/opengl/qopenglshaderprogram.cpp
+++ b/src/opengl/qopenglshaderprogram.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglshaderprogram.h"
#include "qopenglextrafunctions.h"
@@ -57,9 +21,12 @@
#endif
#include <algorithm>
+#include <memory>
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
/*!
\class QOpenGLShaderProgram
\brief The QOpenGLShaderProgram class allows OpenGL shader programs to be linked and used.
@@ -397,7 +364,7 @@ bool QOpenGLShaderPrivate::compile(QOpenGLShader *q)
if (logBuffer)
log = QString::fromLatin1(logBuffer);
else
- log = QLatin1String("failed");
+ log = u"failed"_s;
if (name.isEmpty())
qWarning("QOpenGLShader::compile(%s): %s", type, qPrintable(log));
@@ -578,7 +545,7 @@ static QVersionDirectivePosition findVersionDirectivePosition(const char *source
case CommentEnding:
if (*c == '/')
state = Normal;
- else if (*c != QLatin1Char('*'))
+ else if (*c != u'*')
state = MultiLineComment;
break;
}
@@ -662,7 +629,7 @@ bool QOpenGLShader::compileSourceCode(const char *source)
// Append #line directive in order to compensate for text insertion
lineDirective = QStringLiteral("#line %1\n").arg(versionDirectivePosition.line).toUtf8();
sourceChunks.append(lineDirective.constData());
- sourceChunkLengths.append(GLint(lineDirective.length()));
+ sourceChunkLengths.append(GLint(lineDirective.size()));
}
// Append rest of shader code
@@ -1263,7 +1230,7 @@ void QOpenGLShaderProgram::removeAllShaders()
{
Q_D(QOpenGLShaderProgram);
d->removingShaders = true;
- for (QOpenGLShader *shader : qAsConst(d->shaders)) {
+ for (QOpenGLShader *shader : std::as_const(d->shaders)) {
if (d->programGuard && d->programGuard->id()
&& shader && shader->d_func()->shaderGuard)
{
@@ -3760,13 +3727,13 @@ bool QOpenGLShaderProgramPrivate::isCacheDisabled() const
bool QOpenGLShaderProgramPrivate::compileCacheable()
{
Q_Q(QOpenGLShaderProgram);
- for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : qAsConst(binaryProgram.shaders)) {
- QScopedPointer<QOpenGLShader> s(new QOpenGLShader(qt_shaderStageToType(shader.stage), q));
+ for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : std::as_const(binaryProgram.shaders)) {
+ auto s = std::make_unique<QOpenGLShader>(qt_shaderStageToType(shader.stage), q);
if (!s->compileSourceCode(shader.source)) {
log = s->log();
return false;
}
- anonShaders.append(s.take());
+ anonShaders.append(s.release());
if (!q->addShader(anonShaders.last()))
return false;
}
@@ -3782,7 +3749,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
const QByteArray cacheKey = binaryProgram.cacheKey();
if (lcOpenGLProgramDiskCache().isEnabled(QtDebugMsg))
qCDebug(lcOpenGLProgramDiskCache, "program with %d shaders, cache key %s",
- int(binaryProgram.shaders.count()), cacheKey.constData());
+ int(binaryProgram.shaders.size()), cacheKey.constData());
bool needsCompile = true;
if (binCache.load(cacheKey, q->programId())) {
@@ -3809,3 +3776,5 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
}
QT_END_NAMESPACE
+
+#include "moc_qopenglshaderprogram.cpp"
diff --git a/src/opengl/qopenglshaderprogram.h b/src/opengl/qopenglshaderprogram.h
index 4cbf7e0d3b..e9912d1ee5 100644
--- a/src/opengl/qopenglshaderprogram.h
+++ b/src/opengl/qopenglshaderprogram.h
@@ -1,45 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLSHADERPROGRAM_H
#define QOPENGLSHADERPROGRAM_H
+#include <QtCore/qobject.h>
#include <QtOpenGL/qtopenglglobal.h>
#include <QtGui/qopengl.h>
diff --git a/src/opengl/qopengltexture.cpp b/src/opengl/qopengltexture.cpp
index 809ffaf634..3b8e14490b 100644
--- a/src/opengl/qopengltexture.cpp
+++ b/src/opengl/qopengltexture.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltexture.h"
#include "qopengltexture_p.h"
@@ -467,8 +431,7 @@ static bool isSizedTextureFormat(QOpenGLTexture::TextureFormat internalFormat)
return false;
}
- Q_UNREACHABLE();
- return false;
+ Q_UNREACHABLE_RETURN(false);
}
static bool isTextureTargetMultisample(QOpenGLTexture::Target target)
@@ -492,8 +455,7 @@ static bool isTextureTargetMultisample(QOpenGLTexture::Target target)
return false;
}
- Q_UNREACHABLE();
- return false;
+ Q_UNREACHABLE_RETURN(false);
}
bool QOpenGLTexturePrivate::isUsingImmutableStorage() const
@@ -792,8 +754,7 @@ static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpen
return QOpenGLTexture::LuminanceAlpha;
}
- Q_UNREACHABLE();
- return QOpenGLTexture::NoSourceFormat;
+ Q_UNREACHABLE_RETURN(QOpenGLTexture::NoSourceFormat);
}
static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTexture::TextureFormat internalFormat)
@@ -972,8 +933,7 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
return QOpenGLTexture::UInt8;
}
- Q_UNREACHABLE();
- return QOpenGLTexture::NoPixelType;
+ Q_UNREACHABLE_RETURN(QOpenGLTexture::NoPixelType);
}
static bool isCompressedFormat(QOpenGLTexture::TextureFormat internalFormat)
@@ -1116,8 +1076,7 @@ static bool isCompressedFormat(QOpenGLTexture::TextureFormat internalFormat)
return false;
}
- Q_UNREACHABLE();
- return false;
+ Q_UNREACHABLE_RETURN(false);
}
void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
@@ -2497,6 +2456,9 @@ QOpenGLTexture::QOpenGLTexture(Target target)
This does create the underlying OpenGL texture object. Therefore,
construction using this constructor does require a valid current
OpenGL context.
+
+ \note \a image is automatically converted to QImage::Format_RGBA8888 which
+ may have performance implications for large images with a different format.
*/
QOpenGLTexture::QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps)
: QOpenGLTexture(QOpenGLTexture::Target2D)
@@ -3289,7 +3251,7 @@ bool QOpenGLTexture::isFixedSamplePositions() const
create the mutable storage. You can use the other
allocateStorage() overload to specify exactly the pixel format
and the pixel type to use when allocating mutable storage;
- this is particulary useful under certain OpenGL ES implementations
+ this is particularly useful under certain OpenGL ES implementations
(notably, OpenGL ES 2), where the pixel format and the pixel type
used at allocation time must perfectly match the format
and the type passed to any subsequent setData() call.
@@ -3354,7 +3316,7 @@ bool QOpenGLTexture::isStorageAllocated() const
Attempts to create a texture view onto this texture. A texture
view is somewhat analogous to a view in SQL in that it presents
a restricted or reinterpreted view of the original data. Texture
- views do not allocate any more server-side storage, insted relying
+ views do not allocate any more server-side storage, instead relying
on the storage buffer of the source texture.
Texture views are only available when using immutable storage. For
@@ -3651,6 +3613,9 @@ void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
The pixel data is contained in \a image. Mipmaps are generated by default.
Set \a genMipMaps to \l DontGenerateMipMaps to turn off mipmap generation.
+ \note \a image is automatically converted to QImage::Format_RGBA8888 which
+ may have performance implications for large images with a different format.
+
\overload
*/
void QOpenGLTexture::setData(const QImage& image, MipMapGeneration genMipMaps)
@@ -3666,6 +3631,12 @@ void QOpenGLTexture::setData(const QImage& image, MipMapGeneration genMipMaps)
return;
}
+ QImage glImage = image.convertToFormat(QImage::Format_RGBA8888);
+ if (glImage.isNull()) {
+ qWarning("QOpenGLTexture::setData() failed to convert image");
+ return;
+ }
+
if (context->isOpenGLES() && context->format().majorVersion() < 3)
setFormat(QOpenGLTexture::RGBAFormat);
else
@@ -3676,7 +3647,6 @@ void QOpenGLTexture::setData(const QImage& image, MipMapGeneration genMipMaps)
allocateStorage(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8);
// Upload pixel data and generate mipmaps
- QImage glImage = image.convertToFormat(QImage::Format_RGBA8888);
QOpenGLPixelTransferOptions uploadOptions;
uploadOptions.setAlignment(1);
setData(0, QOpenGLTexture::RGBA, QOpenGLTexture::UInt8, glImage.constBits(), &uploadOptions);
@@ -4457,7 +4427,7 @@ float QOpenGLTexture::maximumAnisotropy() const
}
/*!
- Sets the wrap (or repeat mode) for all texture dimentions to \a mode.
+ Sets the wrap (or repeat mode) for all texture dimensions to \a mode.
\sa wrapMode()
*/
@@ -4872,3 +4842,5 @@ QDebug operator<<(QDebug debug, const QOpenGLTexture *t)
#endif // QT_NO_DEBUG_STREAM
QT_END_NAMESPACE
+
+#include "moc_qopengltexture.cpp"
diff --git a/src/opengl/qopengltexture.h b/src/opengl/qopengltexture.h
index c56f832035..c9210fa529 100644
--- a/src/opengl/qopengltexture.h
+++ b/src/opengl/qopengltexture.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLABSTRACTTEXTURE_H
#define QOPENGLABSTRACTTEXTURE_H
diff --git a/src/opengl/qopengltexture_p.h b/src/opengl/qopengltexture_p.h
index 1dc0801644..12d7e1cf78 100644
--- a/src/opengl/qopengltexture_p.h
+++ b/src/opengl/qopengltexture_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QABSTRACTOPENGLTEXTURE_P_H
#define QABSTRACTOPENGLTEXTURE_P_H
diff --git a/src/opengl/qopengltextureblitter.cpp b/src/opengl/qopengltextureblitter.cpp
index 0f389547cc..5f58876f32 100644
--- a/src/opengl/qopengltextureblitter.cpp
+++ b/src/opengl/qopengltextureblitter.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltextureblitter.h"
@@ -44,10 +8,20 @@
#include <QtOpenGL/QOpenGLBuffer>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
+#include <QtGui/QOpenGLExtraFunctions>
#ifndef GL_TEXTURE_EXTERNAL_OES
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
#endif
+#ifndef GL_TEXTURE_RECTANGLE
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#endif
+#ifndef GL_TEXTURE_WIDTH
+#define GL_TEXTURE_WIDTH 0x1000
+#endif
+#ifndef GL_TEXTURE_HEIGHT
+#define GL_TEXTURE_HEIGHT 0x1001
+#endif
QT_BEGIN_NAMESPACE
@@ -153,6 +127,30 @@ static const char fragment_shader_external_oes[] =
" gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}";
+static const char fragment_shader_rectangle[] =
+ "varying highp vec2 uv;"
+ "uniform sampler2DRect textureSampler;"
+ "uniform bool swizzle;"
+ "uniform highp float opacity;"
+ "void main() {"
+ " highp vec4 tmpFragColor = texture2DRect(textureSampler,uv);"
+ " tmpFragColor.a *= opacity;"
+ " gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
+ "}";
+
+static const char fragment_shader150_rectangle[] =
+ "#version 150 core\n"
+ "in vec2 uv;"
+ "out vec4 fragcolor;"
+ "uniform sampler2DRect textureSampler;"
+ "uniform bool swizzle;"
+ "uniform float opacity;"
+ "void main() {"
+ " vec4 tmpFragColor = texture(textureSampler, uv);"
+ " tmpFragColor.a *= opacity;"
+ " fragcolor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
+ "}";
+
static const GLfloat vertex_buffer_data[] = {
-1,-1, 0,
-1, 1, 0,
@@ -171,14 +169,14 @@ static const GLfloat texture_buffer_data[] = {
1, 1
};
-class TextureBinder
+class QBlitterTextureBinder
{
public:
- TextureBinder(GLenum target, GLuint textureId) : m_target(target)
+ explicit QBlitterTextureBinder(GLenum target, GLuint textureId) : m_target(target)
{
QOpenGLContext::currentContext()->functions()->glBindTexture(m_target, textureId);
}
- ~TextureBinder()
+ ~QBlitterTextureBinder()
{
QOpenGLContext::currentContext()->functions()->glBindTexture(m_target, 0);
}
@@ -198,10 +196,12 @@ public:
enum ProgramIndex {
TEXTURE_2D,
- TEXTURE_EXTERNAL_OES
+ TEXTURE_EXTERNAL_OES,
+ TEXTURE_RECTANGLE
};
- QOpenGLTextureBlitterPrivate() :
+ QOpenGLTextureBlitterPrivate(QOpenGLTextureBlitter *q_ptr) :
+ q(q_ptr),
swizzle(false),
opacity(1.0f),
vao(new QOpenGLVertexArrayObject),
@@ -209,12 +209,16 @@ public:
{ }
bool buildProgram(ProgramIndex idx, const char *vs, const char *fs);
+ bool ensureProgram(ProgramIndex idx);
+
+ void blit(GLuint texture, const QMatrix4x4 &targetTransform, const QMatrix3x3 &sourceTransform);
+ void blit(GLuint texture, const QMatrix4x4 &targetTransform, QOpenGLTextureBlitter::Origin origin);
- void blit(GLuint texture, const QMatrix4x4 &vertexTransform, const QMatrix3x3 &textureTransform);
- void blit(GLuint texture, const QMatrix4x4 &vertexTransform, QOpenGLTextureBlitter::Origin origin);
+ QMatrix3x3 toTextureCoordinates(const QMatrix3x3 &sourceTransform) const;
- void prepareProgram(const QMatrix4x4 &vertexTransform);
+ bool prepareProgram(const QMatrix4x4 &vertexTransform);
+ QOpenGLTextureBlitter *q;
QOpenGLBuffer vertexBuffer;
QOpenGLBuffer textureBuffer;
struct Program {
@@ -239,7 +243,7 @@ public:
bool swizzle;
float opacity;
TextureMatrixUniform textureMatrixUniformState;
- } programs[2];
+ } programs[3];
bool swizzle;
float opacity;
QScopedPointer<QOpenGLVertexArrayObject> vao;
@@ -253,15 +257,21 @@ static inline QOpenGLTextureBlitterPrivate::ProgramIndex targetToProgramIndex(GL
return QOpenGLTextureBlitterPrivate::TEXTURE_2D;
case GL_TEXTURE_EXTERNAL_OES:
return QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES;
+ case GL_TEXTURE_RECTANGLE:
+ return QOpenGLTextureBlitterPrivate::TEXTURE_RECTANGLE;
default:
qWarning("Unsupported texture target 0x%x", target);
return QOpenGLTextureBlitterPrivate::TEXTURE_2D;
}
}
-void QOpenGLTextureBlitterPrivate::prepareProgram(const QMatrix4x4 &vertexTransform)
+bool QOpenGLTextureBlitterPrivate::prepareProgram(const QMatrix4x4 &vertexTransform)
{
- Program *program = &programs[targetToProgramIndex(currentTarget)];
+ ProgramIndex programIndex = targetToProgramIndex(currentTarget);
+ if (!ensureProgram(programIndex))
+ return false;
+
+ Program *program = &programs[programIndex];
vertexBuffer.bind();
program->glProgram->setAttributeBuffer(program->vertexCoordAttribPos, GL_FLOAT, 0, 3, 0);
@@ -284,16 +294,38 @@ void QOpenGLTextureBlitterPrivate::prepareProgram(const QMatrix4x4 &vertexTransf
program->glProgram->setUniformValue(program->opacityUniformPos, opacity);
program->opacity = opacity;
}
+
+ return true;
+}
+
+QMatrix3x3 QOpenGLTextureBlitterPrivate::toTextureCoordinates(const QMatrix3x3 &sourceTransform) const
+{
+ if (currentTarget == GL_TEXTURE_RECTANGLE) {
+ // Non-normalized coordinates
+ QMatrix4x4 textureTransform(sourceTransform);
+ if (auto *glFunctions = QOpenGLContext::currentContext()->extraFunctions()) {
+ int width, height;
+ glFunctions->glGetTexLevelParameteriv(currentTarget, 0, GL_TEXTURE_WIDTH, &width);
+ glFunctions->glGetTexLevelParameteriv(currentTarget, 0, GL_TEXTURE_HEIGHT, &height);
+ textureTransform.scale(width, height);
+ }
+ return textureTransform.toGenericMatrix<3, 3>();
+ }
+
+ return sourceTransform; // Normalized coordinates
}
void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
- const QMatrix4x4 &vertexTransform,
- const QMatrix3x3 &textureTransform)
+ const QMatrix4x4 &targetTransform,
+ const QMatrix3x3 &sourceTransform)
{
- TextureBinder binder(currentTarget, texture);
- prepareProgram(vertexTransform);
+ QBlitterTextureBinder binder(currentTarget, texture);
+ if (!prepareProgram(targetTransform))
+ return;
Program *program = &programs[targetToProgramIndex(currentTarget)];
+
+ const QMatrix3x3 textureTransform = toTextureCoordinates(sourceTransform);
program->glProgram->setUniformValue(program->textureTransformUniformPos, textureTransform);
program->textureMatrixUniformState = User;
@@ -301,23 +333,27 @@ void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
}
void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
- const QMatrix4x4 &vertexTransform,
+ const QMatrix4x4 &targetTransform,
QOpenGLTextureBlitter::Origin origin)
{
- TextureBinder binder(currentTarget, texture);
- prepareProgram(vertexTransform);
+ QBlitterTextureBinder binder(currentTarget, texture);
+ if (!prepareProgram(targetTransform))
+ return;
Program *program = &programs[targetToProgramIndex(currentTarget)];
+
if (origin == QOpenGLTextureBlitter::OriginTopLeft) {
if (program->textureMatrixUniformState != IdentityFlipped) {
- QMatrix3x3 flipped;
- flipped(1,1) = -1;
- flipped(1,2) = 1;
- program->glProgram->setUniformValue(program->textureTransformUniformPos, flipped);
+ QMatrix3x3 sourceTransform;
+ sourceTransform(1,1) = -1;
+ sourceTransform(1,2) = 1;
+ const QMatrix3x3 textureTransform = toTextureCoordinates(sourceTransform);
+ program->glProgram->setUniformValue(program->textureTransformUniformPos, textureTransform);
program->textureMatrixUniformState = IdentityFlipped;
}
} else if (program->textureMatrixUniformState != Identity) {
- program->glProgram->setUniformValue(program->textureTransformUniformPos, QMatrix3x3());
+ const QMatrix3x3 textureTransform = toTextureCoordinates(QMatrix3x3());
+ program->glProgram->setUniformValue(program->textureTransformUniformPos, textureTransform);
program->textureMatrixUniformState = Identity;
}
@@ -355,6 +391,35 @@ bool QOpenGLTextureBlitterPrivate::buildProgram(ProgramIndex idx, const char *vs
return true;
}
+bool QOpenGLTextureBlitterPrivate::ensureProgram(ProgramIndex idx)
+{
+ if (programs[idx].glProgram)
+ return true;
+
+ QOpenGLContext *currentContext = QOpenGLContext::currentContext();
+ if (!currentContext)
+ return false;
+
+ QSurfaceFormat format = currentContext->format();
+ if (format.profile() == QSurfaceFormat::CoreProfile && format.version() >= qMakePair(3,2)) {
+ if (idx == QOpenGLTextureBlitterPrivate::TEXTURE_RECTANGLE && q->supportsRectangleTarget()) {
+ if (!buildProgram(idx, vertex_shader150, fragment_shader150_rectangle))
+ return false;
+ }
+ } else {
+ if (idx == QOpenGLTextureBlitterPrivate::TEXTURE_RECTANGLE && q->supportsRectangleTarget()) {
+ if (!buildProgram(idx, vertex_shader, fragment_shader_rectangle))
+ return false;
+ }
+ if (idx == QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES && q->supportsExternalOESTarget()) {
+ if (!buildProgram(idx, vertex_shader, fragment_shader_external_oes))
+ return false;
+ }
+ }
+
+ return !programs[idx].glProgram.isNull();
+}
+
/*!
Constructs a new QOpenGLTextureBlitter instance.
@@ -365,7 +430,7 @@ bool QOpenGLTextureBlitterPrivate::buildProgram(ProgramIndex idx, const char *vs
create().
*/
QOpenGLTextureBlitter::QOpenGLTextureBlitter()
- : d_ptr(new QOpenGLTextureBlitterPrivate)
+ : d_ptr(new QOpenGLTextureBlitterPrivate(this))
{
}
@@ -405,15 +470,14 @@ bool QOpenGLTextureBlitter::create()
return true;
QSurfaceFormat format = currentContext->format();
+ // Build the most common, 2D texture shader variant.
+ // The other special ones are deferred and compiled only when first needed.
if (format.profile() == QSurfaceFormat::CoreProfile && format.version() >= qMakePair(3,2)) {
if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_2D, vertex_shader150, fragment_shader150))
return false;
} else {
if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_2D, vertex_shader, fragment_shader))
return false;
- if (supportsExternalOESTarget())
- if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES, vertex_shader, fragment_shader_external_oes))
- return false;
}
// Create and bind the VAO, if supported.
@@ -459,6 +523,7 @@ void QOpenGLTextureBlitter::destroy()
Q_D(QOpenGLTextureBlitter);
d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_2D].glProgram.reset();
d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES].glProgram.reset();
+ d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_RECTANGLE].glProgram.reset();
d->vertexBuffer.destroy();
d->textureBuffer.destroy();
d->vao.reset();
@@ -477,13 +542,39 @@ bool QOpenGLTextureBlitter::supportsExternalOESTarget() const
}
/*!
+ \return \c true when bind() accepts \c GL_TEXTURE_RECTANGLE as
+ its target argument.
+
+ \sa bind(), blit()
+ */
+bool QOpenGLTextureBlitter::supportsRectangleTarget() const
+{
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (!ctx || ctx->isOpenGLES())
+ return false;
+
+ if (ctx->hasExtension("GL_ARB_texture_rectangle"))
+ return true;
+
+ if (ctx->hasExtension("GL_EXT_texture_rectangle"))
+ return true;
+
+ QSurfaceFormat f = ctx->format();
+ const auto version = qMakePair(f.majorVersion(), f.minorVersion());
+ if (version >= qMakePair(3, 1))
+ return true;
+
+ return false;
+}
+
+/*!
Binds the graphics resources used by the blitter. This must be
called before calling blit(). Code modifying the OpenGL state
should be avoided between the call to bind() and blit() because
otherwise conflicts may arise.
\a target is the texture target for the source texture and must be
- either \c GL_TEXTURE_2D or \c GL_OES_EGL_image_external.
+ either \c GL_TEXTURE_2D, \c GL_TEXTURE_RECTANGLE, or \c GL_OES_EGL_image_external.
\sa release(), blit()
*/
@@ -495,7 +586,11 @@ void QOpenGLTextureBlitter::bind(GLenum target)
d->vao->bind();
d->currentTarget = target;
- QOpenGLTextureBlitterPrivate::Program *p = &d->programs[targetToProgramIndex(target)];
+ QOpenGLTextureBlitterPrivate::ProgramIndex programIndex = targetToProgramIndex(target);
+ if (!d->ensureProgram(programIndex))
+ return;
+
+ QOpenGLTextureBlitterPrivate::Program *p = &d->programs[programIndex];
p->glProgram->bind();
d->vertexBuffer.bind();
@@ -517,7 +612,9 @@ void QOpenGLTextureBlitter::bind(GLenum target)
void QOpenGLTextureBlitter::release()
{
Q_D(QOpenGLTextureBlitter);
- d->programs[targetToProgramIndex(d->currentTarget)].glProgram->release();
+ QOpenGLTextureBlitterPrivate::Program *p = &d->programs[targetToProgramIndex(d->currentTarget)];
+ if (p->glProgram)
+ p->glProgram->release();
if (d->vao->isCreated())
d->vao->release();
}
@@ -586,7 +683,7 @@ void QOpenGLTextureBlitter::blit(GLuint texture,
Origin sourceOrigin)
{
Q_D(QOpenGLTextureBlitter);
- d->blit(texture,targetTransform, sourceOrigin);
+ d->blit(texture, targetTransform, sourceOrigin);
}
/*!
diff --git a/src/opengl/qopengltextureblitter.h b/src/opengl/qopengltextureblitter.h
index 1818576085..06ffcf928b 100644
--- a/src/opengl/qopengltextureblitter.h
+++ b/src/opengl/qopengltextureblitter.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLTEXTUREBLITTER_H
#define QOPENGLTEXTUREBLITTER_H
@@ -66,6 +30,7 @@ public:
void destroy();
bool supportsExternalOESTarget() const;
+ bool supportsRectangleTarget() const;
void bind(GLenum target = GL_TEXTURE_2D);
void release();
diff --git a/src/opengl/qopengltexturecache.cpp b/src/opengl/qopengltexturecache.cpp
index a58570dbc4..64583c03a9 100644
--- a/src/opengl/qopengltexturecache.cpp
+++ b/src/opengl/qopengltexturecache.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltexturecache_p.h"
#include <private/qopengltextureuploader_p.h>
@@ -97,9 +61,19 @@ void QOpenGLTextureCacheWrapper::cleanupTexturesForPixmapData(QPlatformPixmap *p
cleanupTexturesForCacheKey(pmd->cacheKey());
}
+static quint64 cacheSize()
+{
+ bool ok = false;
+ const int envCacheSize = qEnvironmentVariableIntValue("QT_OPENGL_TEXTURE_CACHE_SIZE", &ok);
+ if (ok)
+ return envCacheSize;
+
+ return 1024 * 1024; // 1024 MB cache default
+}
+
QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx)
: QOpenGLSharedResource(ctx->shareGroup())
- , m_cache(256 * 1024) // 256 MB cache
+ , m_cache(cacheSize())
{
}
@@ -107,10 +81,12 @@ QOpenGLTextureCache::~QOpenGLTextureCache()
{
}
-GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &pixmap, QOpenGLTextureUploader::BindOptions options)
+QOpenGLTextureCache::BindResult QOpenGLTextureCache::bindTexture(QOpenGLContext *context,
+ const QPixmap &pixmap,
+ QOpenGLTextureUploader::BindOptions options)
{
if (pixmap.isNull())
- return 0;
+ return { 0, {} };
QMutexLocker locker(&m_mutex);
qint64 key = pixmap.cacheKey();
@@ -119,21 +95,23 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &
QOpenGLCachedTexture *entry = m_cache.object(key);
if (entry && entry->options() == options) {
context->functions()->glBindTexture(GL_TEXTURE_2D, entry->id());
- return entry->id();
+ return { entry->id(), {} };
}
}
- GLuint id = bindTexture(context, key, pixmap.toImage(), options);
- if (id > 0)
+ BindResult result = bindTexture(context, key, pixmap.toImage(), options);
+ if (result.id > 0)
QImagePixmapCleanupHooks::enableCleanupHooks(pixmap);
- return id;
+ return result;
}
-GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &image, QOpenGLTextureUploader::BindOptions options)
+QOpenGLTextureCache::BindResult QOpenGLTextureCache::bindTexture(QOpenGLContext *context,
+ const QImage &image,
+ QOpenGLTextureUploader::BindOptions options)
{
if (image.isNull())
- return 0;
+ return { 0, {} };
QMutexLocker locker(&m_mutex);
qint64 key = image.cacheKey();
@@ -142,7 +120,7 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
QOpenGLCachedTexture *entry = m_cache.object(key);
if (entry && entry->options() == options) {
context->functions()->glBindTexture(GL_TEXTURE_2D, entry->id());
- return entry->id();
+ return { entry->id(), {} };
}
}
@@ -150,16 +128,22 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
if (!context->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures))
options |= QOpenGLTextureUploader::PowerOfTwoBindOption;
- GLuint id = bindTexture(context, key, img, options);
- if (id > 0)
+ BindResult result = bindTexture(context, key, img, options);
+ if (result.id > 0)
QImagePixmapCleanupHooks::enableCleanupHooks(image);
- return id;
+ return result;
}
-GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)
+Q_TRACE_POINT(qtopengl, QOpenGLTextureCache_bindTexture_entry, QOpenGLContext *context, qint64 key, const unsigned char *image, int options);
+Q_TRACE_POINT(qtopengl, QOpenGLTextureCache_bindTexture_exit);
+
+QOpenGLTextureCache::BindResult QOpenGLTextureCache::bindTexture(QOpenGLContext *context,
+ qint64 key,
+ const QImage &image,
+ QOpenGLTextureUploader::BindOptions options)
{
- Q_TRACE_SCOPE(QOpenGLTextureCache_bindTexture, context, key, image, options);
+ Q_TRACE_SCOPE(QOpenGLTextureCache_bindTexture, context, key, image.bits(), options);
GLuint id;
QOpenGLFunctions *funcs = context->functions();
@@ -170,7 +154,7 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, con
m_cache.insert(key, new QOpenGLCachedTexture(id, options, context), cost / 1024);
- return id;
+ return { id, BindResultFlag::NewTexture };
}
void QOpenGLTextureCache::invalidate(qint64 key)
diff --git a/src/opengl/qopengltexturecache_p.h b/src/opengl/qopengltexturecache_p.h
index 14e03ebea1..b70520aa1c 100644
--- a/src/opengl/qopengltexturecache_p.h
+++ b/src/opengl/qopengltexturecache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
@@ -71,10 +35,20 @@ public:
QOpenGLTextureCache(QOpenGLContext *);
~QOpenGLTextureCache();
- GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap,
- QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption);
- GLuint bindTexture(QOpenGLContext *context, const QImage &image,
- QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption);
+ enum class BindResultFlag : quint8 {
+ NewTexture = 0x01
+ };
+ Q_DECLARE_FLAGS(BindResultFlags, BindResultFlag)
+
+ struct BindResult {
+ GLuint id;
+ BindResultFlags flags;
+ };
+
+ BindResult bindTexture(QOpenGLContext *context, const QPixmap &pixmap,
+ QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption);
+ BindResult bindTexture(QOpenGLContext *context, const QImage &image,
+ QOpenGLTextureUploader::BindOptions options = QOpenGLTextureUploader::PremultipliedAlphaBindOption);
void invalidate(qint64 key);
@@ -82,12 +56,14 @@ public:
void freeResource(QOpenGLContext *ctx) override;
private:
- GLuint bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options);
+ BindResult bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options);
QMutex m_mutex;
QCache<quint64, QOpenGLCachedTexture> m_cache;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTextureCache::BindResultFlags)
+
class QOpenGLCachedTexture
{
public:
diff --git a/src/opengl/qopengltextureglyphcache.cpp b/src/opengl/qopengltextureglyphcache.cpp
index 6c8971fddb..0bab710b1b 100644
--- a/src/opengl/qopengltextureglyphcache.cpp
+++ b/src/opengl/qopengltextureglyphcache.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltextureglyphcache_p.h"
#include <private/qopenglpaintengine_p.h>
@@ -49,7 +13,7 @@ QT_BEGIN_NAMESPACE
static int next_qopengltextureglyphcache_serial_number()
{
- static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0);
+ Q_CONSTINIT static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0);
return 1 + serial.fetchAndAddRelaxed(1);
}
@@ -345,11 +309,11 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
{
QString source;
#ifdef Q_OS_WASM
- source.append(QLatin1String(isCoreProfile ? qopenglslUntransformedPositionVertexShader_core : qopenglslUntransformedPositionVertexShader));
- source.append(QLatin1String(isCoreProfile ? qopenglslMainWithTexCoordsVertexShader_core : qopenglslMainWithTexCoordsVertexShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslUntransformedPositionVertexShader_core : qopenglslUntransformedPositionVertexShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslMainWithTexCoordsVertexShader_core : qopenglslMainWithTexCoordsVertexShader));
#else
- source.append(QLatin1String(isCoreProfile ? qopenglslMainWithTexCoordsVertexShader_core : qopenglslMainWithTexCoordsVertexShader));
- source.append(QLatin1String(isCoreProfile ? qopenglslUntransformedPositionVertexShader_core : qopenglslUntransformedPositionVertexShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslMainWithTexCoordsVertexShader_core : qopenglslMainWithTexCoordsVertexShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslUntransformedPositionVertexShader_core : qopenglslUntransformedPositionVertexShader));
#endif
m_blitProgram->addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, source);
}
@@ -357,11 +321,11 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
{
QString source;
#ifdef Q_OS_WASM
- source.append(QLatin1String(isCoreProfile ? qopenglslImageSrcFragmentShader_core : qopenglslImageSrcFragmentShader));
- source.append(QLatin1String(isCoreProfile ? qopenglslMainFragmentShader_core : qopenglslMainFragmentShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslImageSrcFragmentShader_core : qopenglslImageSrcFragmentShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslMainFragmentShader_core : qopenglslMainFragmentShader));
#else
- source.append(QLatin1String(isCoreProfile ? qopenglslMainFragmentShader_core : qopenglslMainFragmentShader));
- source.append(QLatin1String(isCoreProfile ? qopenglslImageSrcFragmentShader_core : qopenglslImageSrcFragmentShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslMainFragmentShader_core : qopenglslMainFragmentShader));
+ source.append(QLatin1StringView(isCoreProfile ? qopenglslImageSrcFragmentShader_core : qopenglslImageSrcFragmentShader));
#endif
m_blitProgram->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, source);
}
@@ -443,7 +407,10 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c,
int QOpenGLTextureGlyphCache::glyphPadding() const
{
- return 1;
+ if (m_format == QFontEngine::Format_Mono)
+ return 8;
+ else
+ return 1;
}
int QOpenGLTextureGlyphCache::maxTextureWidth() const
diff --git a/src/opengl/qopengltextureglyphcache_p.h b/src/opengl/qopengltextureglyphcache_p.h
index 5b30881e55..a07a88dc2a 100644
--- a/src/opengl/qopengltextureglyphcache_p.h
+++ b/src/opengl/qopengltextureglyphcache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLTEXTUREGLYPHCACHE_P_H
#define QOPENGLTEXTUREGLYPHCACHE_P_H
diff --git a/src/opengl/qopengltexturehelper.cpp b/src/opengl/qopengltexturehelper.cpp
index 9aab0bcc79..b5466d3a18 100644
--- a/src/opengl/qopengltexturehelper.cpp
+++ b/src/opengl/qopengltexturehelper.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltexturehelper_p.h"
diff --git a/src/opengl/qopengltexturehelper_p.h b/src/opengl/qopengltexturehelper_p.h
index d3c17c33a4..375e47b053 100644
--- a/src/opengl/qopengltexturehelper_p.h
+++ b/src/opengl/qopengltexturehelper_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLTEXTUREHELPER_P_H
#define QOPENGLTEXTUREHELPER_P_H
@@ -52,6 +16,7 @@
//
#include <QtOpenGL/qtopenglglobal.h>
+#include <QtCore/private/qglobal_p.h>
#ifndef QT_NO_OPENGL
diff --git a/src/opengl/qopengltextureuploader.cpp b/src/opengl/qopengltextureuploader.cpp
index 488baf32ad..3dca0a439a 100644
--- a/src/opengl/qopengltextureuploader.cpp
+++ b/src/opengl/qopengltextureuploader.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltextureuploader_p.h"
diff --git a/src/opengl/qopengltextureuploader_p.h b/src/opengl/qopengltextureuploader_p.h
index cea6d97658..299a4b81dc 100644
--- a/src/opengl/qopengltextureuploader_p.h
+++ b/src/opengl/qopengltextureuploader_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
diff --git a/src/opengl/qopengltimerquery.cpp b/src/opengl/qopengltimerquery.cpp
index 921a9f759f..d4e385630e 100644
--- a/src/opengl/qopengltimerquery.cpp
+++ b/src/opengl/qopengltimerquery.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopengltimerquery.h"
@@ -878,3 +842,5 @@ void QOpenGLTimeMonitor::reset()
}
QT_END_NAMESPACE
+
+#include "moc_qopengltimerquery.cpp"
diff --git a/src/opengl/qopengltimerquery.h b/src/opengl/qopengltimerquery.h
index a81c181b51..dbfda1f5ff 100644
--- a/src/opengl/qopengltimerquery.h
+++ b/src/opengl/qopengltimerquery.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLTIMERQUERY_H
#define QOPENGLTIMERQUERY_H
diff --git a/src/opengl/qopenglversionfunctions.cpp b/src/opengl/qopenglversionfunctions.cpp
index 487bc56b48..a03fa2c2d3 100644
--- a/src/opengl/qopenglversionfunctions.cpp
+++ b/src/opengl/qopenglversionfunctions.cpp
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -56,7 +21,7 @@ QT_BEGIN_NAMESPACE
QOpenGLContextVersionData::~QOpenGLContextVersionData()
{
- for (auto *f : qAsConst(externalFunctions)) {
+ for (auto *f : std::as_const(externalFunctions)) {
auto *fp = QAbstractOpenGLFunctionsPrivate::get(f);
fp->owningContext = nullptr;
fp->initialized = false;
diff --git a/src/opengl/qopenglversionfunctions.h b/src/opengl/qopenglversionfunctions.h
index 445f293069..dc01b940bb 100644
--- a/src/opengl/qopenglversionfunctions.h
+++ b/src/opengl/qopenglversionfunctions.h
@@ -1,42 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -1214,25 +1179,25 @@ public:
F(void, NamedFramebufferParameteri, (GLuint framebuffer, GLenum pname, GLint param)) \
F(void, NamedFramebufferRenderbuffer, (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) \
F(void, CreateFramebuffers, (GLsizei n, GLuint *framebuffers)) \
- F(void, GetNamedBufferSubData, (GLuint buffer, GLintptr offset, GLsizei size, void *data)) \
+ F(void, GetNamedBufferSubData, (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data)) \
F(void, GetNamedBufferPointerv, (GLuint buffer, GLenum pname, GLvoid* *params)) \
F(void, GetNamedBufferParameteri64v, (GLuint buffer, GLenum pname, GLint64 *params)) \
F(void, GetNamedBufferParameteriv, (GLuint buffer, GLenum pname, GLint *params)) \
- F(void, FlushMappedNamedBufferRange, (GLuint buffer, GLintptr offset, GLsizei length)) \
+ F(void, FlushMappedNamedBufferRange, (GLuint buffer, GLintptr offset, GLsizeiptr length)) \
F(GLboolean, UnmapNamedBuffer, (GLuint buffer)) \
- F(GLvoid *, MapNamedBufferRange, (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access)) \
+ F(GLvoid *, MapNamedBufferRange, (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access)) \
F(GLvoid *, MapNamedBuffer, (GLuint buffer, GLenum access)) \
- F(void, ClearNamedBufferSubData, (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data)) \
+ F(void, ClearNamedBufferSubData, (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data)) \
F(void, ClearNamedBufferData, (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data)) \
- F(void, CopyNamedBufferSubData, (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size)) \
- F(void, NamedBufferSubData, (GLuint buffer, GLintptr offset, GLsizei size, const void *data)) \
- F(void, NamedBufferData, (GLuint buffer, GLsizei size, const void *data, GLenum usage)) \
- F(void, NamedBufferStorage, (GLuint buffer, GLsizei size, const void *data, GLbitfield flags)) \
+ F(void, CopyNamedBufferSubData, (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)) \
+ F(void, NamedBufferSubData, (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data)) \
+ F(void, NamedBufferData, (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage)) \
+ F(void, NamedBufferStorage, (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags)) \
F(void, CreateBuffers, (GLsizei n, GLuint *buffers)) \
F(void, GetTransformFeedbacki64_v,(GLuint xfb, GLenum pname, GLuint index, GLint64 *param)) \
F(void, GetTransformFeedbacki_v,(GLuint xfb, GLenum pname, GLuint index, GLint *param)) \
F(void, GetTransformFeedbackiv, (GLuint xfb, GLenum pname, GLint *param)) \
- F(void, TransformFeedbackBufferRange, (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size)) \
+ F(void, TransformFeedbackBufferRange, (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)) \
F(void, TransformFeedbackBufferBase, (GLuint xfb, GLuint index, GLuint buffer)) \
F(void, CreateTransformFeedbacks, (GLsizei n, GLuint *ids)) \
F(void, ClipControl, (GLenum origin, GLenum depth)) \
diff --git a/src/opengl/qopenglversionfunctions_p.h b/src/opengl/qopenglversionfunctions_p.h
index cad4374e27..02ce44b6da 100644
--- a/src/opengl/qopenglversionfunctions_p.h
+++ b/src/opengl/qopenglversionfunctions_p.h
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglversionfunctionsfactory.cpp b/src/opengl/qopenglversionfunctionsfactory.cpp
index 6415c9439f..12d00c0554 100644
--- a/src/opengl/qopenglversionfunctionsfactory.cpp
+++ b/src/opengl/qopenglversionfunctionsfactory.cpp
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
@@ -170,7 +135,7 @@ static QAbstractOpenGLFunctions *createFunctions(const QOpenGLVersionProfile &ve
*/
/*!
- \fn static T *QOpenGLVersionFunctionsFactory::get(QOpenGLContext *context)
+ \fn template <class T> static T *QOpenGLVersionFunctionsFactory::get(QOpenGLContext *context)
\overload get()
diff --git a/src/opengl/qopenglversionfunctionsfactory.h b/src/opengl/qopenglversionfunctionsfactory.h
index 0445c2e03d..1b5a121102 100644
--- a/src/opengl/qopenglversionfunctionsfactory.h
+++ b/src/opengl/qopenglversionfunctionsfactory.h
@@ -1,41 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-**
+// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+/***************************************************************************
** This file was generated by glgen version 0.1
** Command line was: glgen
**
diff --git a/src/opengl/qopenglversionprofile.cpp b/src/opengl/qopenglversionprofile.cpp
index afda77857e..3b5ed83a13 100644
--- a/src/opengl/qopenglversionprofile.cpp
+++ b/src/opengl/qopenglversionprofile.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglversionprofile.h"
diff --git a/src/opengl/qopenglversionprofile.h b/src/opengl/qopenglversionprofile.h
index e207548dd6..580a24b5fd 100644
--- a/src/opengl/qopenglversionprofile.h
+++ b/src/opengl/qopenglversionprofile.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLVERSIONPROFILE_H
#define QOPENGLVERSIONPROFILE_H
diff --git a/src/opengl/qopenglvertexarrayobject.cpp b/src/opengl/qopenglvertexarrayobject.cpp
index 63e37727f9..98374fb9e2 100644
--- a/src/opengl/qopenglvertexarrayobject.cpp
+++ b/src/opengl/qopenglvertexarrayobject.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglvertexarrayobject.h"
@@ -46,8 +10,11 @@
#include <QtGui/qguiapplication.h>
#include <QtOpenGL/QOpenGLVersionFunctionsFactory>
-#include <QtOpenGL/qopenglfunctions_3_0.h>
-#include <QtOpenGL/qopenglfunctions_3_2_core.h>
+
+#if !QT_CONFIG(opengles2)
+# include <QtOpenGL/qopenglfunctions_3_0.h>
+# include <QtOpenGL/qopenglfunctions_3_2_core.h>
+#endif
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
@@ -274,7 +241,7 @@ void QOpenGLVertexArrayObjectPrivate::destroy()
vao = 0;
}
- if (oldContext && oldContextSurface) {
+ if (oldContext && oldContextSurface && oldContextSurface->surfaceHandle()) {
if (!oldContext->makeCurrent(oldContextSurface))
qWarning("QOpenGLVertexArrayObject::destroy() failed to restore current context");
}
diff --git a/src/opengl/qopenglvertexarrayobject.h b/src/opengl/qopenglvertexarrayobject.h
index 7ed1270b86..e50c56942a 100644
--- a/src/opengl/qopenglvertexarrayobject.h
+++ b/src/opengl/qopenglvertexarrayobject.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLVERTEXARRAYOBJECT_H
#define QOPENGLVERTEXARRAYOBJECT_H
diff --git a/src/opengl/qopenglvertexarrayobject_p.h b/src/opengl/qopenglvertexarrayobject_p.h
index bd50d86073..2dfb31b539 100644
--- a/src/opengl/qopenglvertexarrayobject_p.h
+++ b/src/opengl/qopenglvertexarrayobject_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sean Harmer <sean.harmer@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLVERTEXARRAYOBJECT_P_H
#define QOPENGLVERTEXARRAYOBJECT_P_H
@@ -54,6 +18,7 @@
#include <QtOpenGL/qtopenglglobal.h>
#include <QtGui/qopengl.h>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp
index d000dced94..a3677aa828 100644
--- a/src/opengl/qopenglwindow.cpp
+++ b/src/opengl/qopenglwindow.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qopenglwindow.h"
#include <QtGui/QOpenGLFunctions>
@@ -80,7 +44,7 @@ QT_BEGIN_NAMESPACE
immediately result in a call to paintGL(). Calling update() multiple times in
a row will not change the behavior in any way.
- This is a slot so it can be connected to a \l QTimer::timeout() signal to
+ This is a slot so it can be connected to a \l QChronoTimer::timeout() signal to
perform animation. Note however that in the modern OpenGL world it is a much
better choice to rely on synchronization to the vertical refresh rate of the
display. See \l{QSurfaceFormat::setSwapInterval()}{setSwapInterval()} on a
@@ -96,6 +60,23 @@ QT_BEGIN_NAMESPACE
given OpenGL version and profile, or enabling depth and stencil
buffers.
+ \note It is up to the application to ensure depth and stencil buffers are
+ requested from the underlying windowing system interface. Without requesting
+ a non-zero depth buffer size there is no guarantee that a depth buffer will
+ be available, and as a result depth testing related OpenGL operations may fail
+ to function as expected.
+
+ Commonly used depth and stencil buffer size requests are 24 and 8,
+ respectively. For example, a QOpenGLWindow subclass could do this in its
+ constructor:
+
+ \code
+ QSurfaceFormat format;
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ setFormat(format);
+ \endcode
+
Unlike QWindow, QOpenGLWindow allows opening a painter on itself and perform
QPainter-based drawing.
@@ -412,7 +393,7 @@ bool QOpenGLWindow::isValid() const
/*!
Prepares for rendering OpenGL content for this window by making the
corresponding context current and binding the framebuffer object, if there is
- one, in that context context.
+ one, in that context.
It is not necessary to call this function in most cases, because it is called
automatically before invoking paintGL(). It is provided nonetheless to support
@@ -590,7 +571,7 @@ void QOpenGLWindow::resizeGL(int w, int h)
\note When using a partial update behavior, like \c PartialUpdateBlend, the
output of the previous paintGL() call is preserved and, after the additional
- drawing perfomed in the current invocation of the function, the content is
+ drawing performed in the current invocation of the function, the content is
blitted or blended over the content drawn directly to the window in
paintUnderGL().
@@ -696,3 +677,5 @@ QPaintDevice *QOpenGLWindow::redirected(QPoint *) const
}
QT_END_NAMESPACE
+
+#include "moc_qopenglwindow.cpp"
diff --git a/src/opengl/qopenglwindow.h b/src/opengl/qopenglwindow.h
index 926e4fabfd..d759b3cfbc 100644
--- a/src/opengl/qopenglwindow.h
+++ b/src/opengl/qopenglwindow.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QOPENGLWINDOW_H
#define QOPENGLWINDOW_H
diff --git a/src/opengl/qplatformbackingstoreopenglsupport.cpp b/src/opengl/qplatformbackingstoreopenglsupport.cpp
deleted file mode 100644
index 30532c5b4b..0000000000
--- a/src/opengl/qplatformbackingstoreopenglsupport.cpp
+++ /dev/null
@@ -1,465 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui 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 QT_NO_OPENGL
-
-#include "qplatformbackingstoreopenglsupport.h"
-
-#include <QtGui/private/qwindow_p.h>
-
-#include <qpa/qplatformgraphicsbuffer.h>
-#include <qpa/qplatformgraphicsbufferhelper.h>
-
-#include <QtOpenGL/QOpenGLTextureBlitter>
-#include <QtGui/qopengl.h>
-#include <QtGui/QOpenGLFunctions>
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOffscreenSurface>
-
-#ifndef GL_TEXTURE_BASE_LEVEL
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#endif
-#ifndef GL_TEXTURE_MAX_LEVEL
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#endif
-#ifndef GL_UNPACK_ROW_LENGTH
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#endif
-#ifndef GL_RGB10_A2
-#define GL_RGB10_A2 0x8059
-#endif
-#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#endif
-
-#ifndef GL_FRAMEBUFFER_SRGB
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-#endif
-#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE
-#define GL_FRAMEBUFFER_SRGB_CAPABLE 0x8DBA
-#endif
-
-QT_BEGIN_NAMESPACE
-
-static inline QRect deviceRect(const QRect &rect, QWindow *window)
-{
- QRect deviceRect(rect.topLeft() * window->devicePixelRatio(),
- rect.size() * window->devicePixelRatio());
- return deviceRect;
-}
-
-static inline QPoint deviceOffset(const QPoint &pt, QWindow *window)
-{
- return pt * window->devicePixelRatio();
-}
-
-static QRegion deviceRegion(const QRegion &region, QWindow *window, const QPoint &offset)
-{
- if (offset.isNull() && window->devicePixelRatio() <= 1)
- return region;
-
- QVarLengthArray<QRect, 4> rects;
- rects.reserve(region.rectCount());
- for (const QRect &rect : region)
- rects.append(deviceRect(rect.translated(offset), window));
-
- QRegion deviceRegion;
- deviceRegion.setRects(rects.constData(), rects.count());
- return deviceRegion;
-}
-
-static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight)
-{
- return QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1,
- topLeftRect.width(), topLeftRect.height());
-}
-
-static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect,
- QOpenGLTextureBlitter *blitter, const QPoint &offset, bool canUseSrgb)
-{
- const QRect clipRect = textures->clipRect(idx);
- if (clipRect.isEmpty())
- return;
-
- QRect rectInWindow = textures->geometry(idx);
- // relative to the TLW, not necessarily our window (if the flush is for a native child widget), have to adjust
- rectInWindow.translate(-offset);
-
- const QRect clippedRectInWindow = rectInWindow & clipRect.translated(rectInWindow.topLeft());
- const QRect srcRect = toBottomLeftRect(clipRect, rectInWindow.height());
-
- const QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(deviceRect(clippedRectInWindow, window),
- deviceWindowRect);
-
- const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(deviceRect(srcRect, window),
- deviceRect(rectInWindow, window).size(),
- QOpenGLTextureBlitter::OriginBottomLeft);
-
- QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
- const bool srgb = textures->flags(idx).testFlag(QPlatformTextureList::TextureIsSrgb);
- if (srgb && canUseSrgb)
- funcs->glEnable(GL_FRAMEBUFFER_SRGB);
-
- blitter->blit(textures->textureId(idx), target, source);
-
- if (srgb && canUseSrgb)
- funcs->glDisable(GL_FRAMEBUFFER_SRGB);
-}
-
-QPlatformBackingStoreOpenGLSupport::~QPlatformBackingStoreOpenGLSupport() {
- if (context) {
- QOffscreenSurface offscreenSurface;
- offscreenSurface.setFormat(context->format());
- offscreenSurface.create();
- context->makeCurrent(&offscreenSurface);
- if (textureId)
- context->functions()->glDeleteTextures(1, &textureId);
- if (blitter)
- blitter->destroy();
- }
- delete blitter;
-}
-
-void QPlatformBackingStoreOpenGLSupport::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground)
-{
- if (!qt_window_private(window)->receivedExpose)
- return;
-
- if (!context) {
- context.reset(new QOpenGLContext);
- context->setFormat(window->requestedFormat());
- context->setScreen(window->screen());
- context->setShareContext(qt_window_private(window)->shareContext());
- if (!context->create()) {
- qCWarning(lcQpaBackingStore, "composeAndFlush: QOpenGLContext creation failed");
- return;
- }
- }
-
- bool current = context->makeCurrent(window);
-
- if (!current && !context->isValid()) {
- // release resources and attempt to reinitialize upon context loss
- delete blitter;
- blitter = nullptr;
- textureId = 0;
- current = context->create() && context->makeCurrent(window);
- }
-
- if (!current) {
- qCWarning(lcQpaBackingStore, "composeAndFlush: makeCurrent() failed");
- return;
- }
-
- qCDebug(lcQpaBackingStore) << "Composing and flushing" << region << "of" << window
- << "at offset" << offset << "with" << textures->count() << "texture(s) in" << textures;
-
- QWindowPrivate::get(window)->lastComposeTime.start();
-
- QOpenGLFunctions *funcs = context->functions();
- funcs->glViewport(0, 0, qRound(window->width() * window->devicePixelRatio()), qRound(window->height() * window->devicePixelRatio()));
- funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1);
- funcs->glClear(GL_COLOR_BUFFER_BIT);
-
- if (!blitter) {
- blitter = new QOpenGLTextureBlitter;
- blitter->create();
- }
-
- blitter->bind();
-
- const QRect deviceWindowRect = deviceRect(QRect(QPoint(), window->size()), window);
- const QPoint deviceWindowOffset = deviceOffset(offset, window);
-
- bool canUseSrgb = false;
- // If there are any sRGB textures in the list, check if the destination
- // framebuffer is sRGB capable.
- for (int i = 0; i < textures->count(); ++i) {
- if (textures->flags(i).testFlag(QPlatformTextureList::TextureIsSrgb)) {
- GLint cap = 0;
- funcs->glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE, &cap);
- if (cap)
- canUseSrgb = true;
- break;
- }
- }
-
- // Textures for renderToTexture widgets.
- for (int i = 0; i < textures->count(); ++i) {
- if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
- blitTextureForWidget(textures, i, window, deviceWindowRect, blitter, offset, canUseSrgb);
- }
-
- // Backingstore texture with the normal widgets.
- GLuint textureId = 0;
- QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft;
- if (QPlatformGraphicsBuffer *graphicsBuffer = backingStore->graphicsBuffer()) {
- if (graphicsBuffer->size() != textureSize) {
- if (this->textureId)
- funcs->glDeleteTextures(1, &this->textureId);
- funcs->glGenTextures(1, &this->textureId);
- funcs->glBindTexture(GL_TEXTURE_2D, this->textureId);
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
- }
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- if (QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &needsSwizzle, &premultiplied)) {
- textureSize = graphicsBuffer->size();
- } else {
- textureSize = QSize(0,0);
- }
-
- graphicsBuffer->unlock();
- } else if (!region.isEmpty()){
- funcs->glBindTexture(GL_TEXTURE_2D, this->textureId);
- QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &needsSwizzle, &premultiplied);
- graphicsBuffer->unlock();
- }
-
- if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft)
- origin = QOpenGLTextureBlitter::OriginBottomLeft;
- textureId = this->textureId;
- } else {
- QPlatformBackingStore::TextureFlags flags;
- textureId = backingStore->toTexture(deviceRegion(region, window, offset), &textureSize, &flags);
- needsSwizzle = (flags & QPlatformBackingStore::TextureSwizzle) != 0;
- premultiplied = (flags & QPlatformBackingStore::TexturePremultiplied) != 0;
- if (flags & QPlatformBackingStore::TextureFlip)
- origin = QOpenGLTextureBlitter::OriginBottomLeft;
- }
-
- funcs->glEnable(GL_BLEND);
- if (premultiplied)
- funcs->glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
- else
- funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
-
- if (textureId) {
- if (needsSwizzle)
- blitter->setRedBlueSwizzle(true);
- // The backingstore is for the entire tlw.
- // In case of native children offset tells the position relative to the tlw.
- const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(deviceWindowOffset), textureSize.height());
- const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(srcRect,
- textureSize,
- origin);
- blitter->blit(textureId, QMatrix4x4(), source);
- if (needsSwizzle)
- blitter->setRedBlueSwizzle(false);
- }
-
- // Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
- bool blendIsPremultiplied = premultiplied;
- for (int i = 0; i < textures->count(); ++i) {
- const QPlatformTextureList::Flags flags = textures->flags(i);
- if (flags.testFlag(QPlatformTextureList::NeedsPremultipliedAlphaBlending)) {
- if (!blendIsPremultiplied) {
- funcs->glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
- blendIsPremultiplied = true;
- }
- } else {
- if (blendIsPremultiplied) {
- funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
- blendIsPremultiplied = false;
- }
- }
- if (flags.testFlag(QPlatformTextureList::StacksOnTop))
- blitTextureForWidget(textures, i, window, deviceWindowRect, blitter, offset, canUseSrgb);
- }
-
- funcs->glDisable(GL_BLEND);
- blitter->release();
-
- context->swapBuffers(window);
-}
-
-GLuint QPlatformBackingStoreOpenGLSupport::toTexture(const QRegion &dirtyRegion, QSize *textureSize, QPlatformBackingStore::TextureFlags *flags) const
-{
- Q_ASSERT(textureSize);
- Q_ASSERT(flags);
-
- QImage image = backingStore->toImage();
- QSize imageSize = image.size();
-
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- GLenum internalFormat = GL_RGBA;
- GLuint pixelType = GL_UNSIGNED_BYTE;
-
- bool needsConversion = false;
- *flags = { };
- switch (image.format()) {
- case QImage::Format_ARGB32_Premultiplied:
- *flags |= QPlatformBackingStore::TexturePremultiplied;
- Q_FALLTHROUGH();
- case QImage::Format_RGB32:
- case QImage::Format_ARGB32:
- *flags |= QPlatformBackingStore::TextureSwizzle;
- break;
- case QImage::Format_RGBA8888_Premultiplied:
- *flags |= QPlatformBackingStore::TexturePremultiplied;
- Q_FALLTHROUGH();
- case QImage::Format_RGBX8888:
- case QImage::Format_RGBA8888:
- break;
- case QImage::Format_BGR30:
- case QImage::Format_A2BGR30_Premultiplied:
- if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
- pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
- internalFormat = GL_RGB10_A2;
- *flags |= QPlatformBackingStore::TexturePremultiplied;
- } else {
- needsConversion = true;
- }
- break;
- case QImage::Format_RGB30:
- case QImage::Format_A2RGB30_Premultiplied:
- if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
- pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
- internalFormat = GL_RGB10_A2;
- *flags |= QPlatformBackingStore::TextureSwizzle | QPlatformBackingStore::TexturePremultiplied;
- } else {
- needsConversion = true;
- }
- break;
- default:
- needsConversion = true;
- break;
- }
- if (imageSize.isEmpty()) {
- *textureSize = imageSize;
- return 0;
- }
-
- // Must rely on the input only, not d_ptr.
- // With the default composeAndFlush() textureSize is &d_ptr->textureSize.
- bool resized = *textureSize != imageSize;
- if (dirtyRegion.isEmpty() && !resized)
- return textureId;
-
- *textureSize = imageSize;
-
- if (needsConversion)
- image = image.convertToFormat(QImage::Format_RGBA8888);
-
- // The image provided by the backingstore may have a stride larger than width * 4, for
- // instance on platforms that manually implement client-side decorations.
- static const int bytesPerPixel = 4;
- const qsizetype strideInPixels = image.bytesPerLine() / bytesPerPixel;
- const bool hasUnpackRowLength = !ctx->isOpenGLES() || ctx->format().majorVersion() >= 3;
-
- QOpenGLFunctions *funcs = ctx->functions();
-
- if (hasUnpackRowLength) {
- funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, strideInPixels);
- } else if (strideInPixels != image.width()) {
- // No UNPACK_ROW_LENGTH on ES 2.0 and yet we would need it. This case is typically
- // hit with QtWayland which is rarely used in combination with a ES2.0-only GL
- // implementation. Therefore, accept the performance hit and do a copy.
- image = image.copy();
- }
-
- if (resized) {
- if (textureId)
- funcs->glDeleteTextures(1, &textureId);
- funcs->glGenTextures(1, &textureId);
- funcs->glBindTexture(GL_TEXTURE_2D, textureId);
- if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
- }
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, imageSize.width(), imageSize.height(), 0, GL_RGBA, pixelType,
- const_cast<uchar*>(image.constBits()));
- } else {
- funcs->glBindTexture(GL_TEXTURE_2D, textureId);
- QRect imageRect = image.rect();
- QRect rect = dirtyRegion.boundingRect() & imageRect;
-
- if (hasUnpackRowLength) {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
- image.constScanLine(rect.y()) + rect.x() * bytesPerPixel);
- } else {
- // if the rect is wide enough it's cheaper to just
- // extend it instead of doing an image copy
- if (rect.width() >= imageRect.width() / 2) {
- rect.setX(0);
- rect.setWidth(imageRect.width());
- }
-
- // if the sub-rect is full-width we can pass the image data directly to
- // OpenGL instead of copying, since there's no gap between scanlines
-
- if (rect.width() == imageRect.width()) {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
- image.constScanLine(rect.y()));
- } else {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
- image.copy(rect).constBits());
- }
- }
- }
-
- if (hasUnpackRowLength)
- funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-
- return textureId;
-}
-
-void qt_registerDefaultPlatformBackingStoreOpenGLSupport()
-{
- if (!QPlatformBackingStoreOpenGLSupportBase::factoryFunction()) {
- QPlatformBackingStoreOpenGLSupportBase::setFactoryFunction([]() -> QPlatformBackingStoreOpenGLSupportBase* {
- return new QPlatformBackingStoreOpenGLSupport;
- });
- }
-}
-
-#endif // QT_NO_OPENGL
-
-QT_END_NAMESPACE
diff --git a/src/opengl/qplatformbackingstoreopenglsupport.h b/src/opengl/qplatformbackingstoreopenglsupport.h
deleted file mode 100644
index ae9d972c6a..0000000000
--- a/src/opengl/qplatformbackingstoreopenglsupport.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui 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 QPLATFORMBACKINGSTOREOPENGLSUPPORT_H
-#define QPLATFORMBACKINGSTOREOPENGLSUPPORT_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is part of the QPA API and is not meant to be used
-// in applications. Usage of this API may make your code
-// source and binary incompatible with future versions of Qt.
-//
-
-#ifndef QT_NO_OPENGL
-
-#include <QtOpenGL/qtopenglglobal.h>
-#include <qpa/qplatformbackingstore.h>
-
-#include <QtGui/QOpenGLContext>
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLTextureBlitter;
-class QOpenGLBackingStore;
-
-class Q_OPENGL_EXPORT QPlatformBackingStoreOpenGLSupport : public QPlatformBackingStoreOpenGLSupportBase
-{
-public:
- ~QPlatformBackingStoreOpenGLSupport() override;
- void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
- QPlatformTextureList *textures, bool translucentBackground) override;
- GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, QPlatformBackingStore::TextureFlags *flags) const override;
-
-private:
- QScopedPointer<QOpenGLContext> context;
- mutable GLuint textureId = 0;
- mutable QSize textureSize;
- mutable bool needsSwizzle = false;
- mutable bool premultiplied = false;
- QOpenGLTextureBlitter *blitter = nullptr;
-};
-
-Q_OPENGL_EXPORT void qt_registerDefaultPlatformBackingStoreOpenGLSupport();
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_OPENGL
-
-#endif // QPLATFORMBACKINGSTOREOPENGLSUPPORT_H
diff --git a/src/opengl/qtopengl.tracepoints b/src/opengl/qtopengl.tracepoints
deleted file mode 100644
index 1602f572d4..0000000000
--- a/src/opengl/qtopengl.tracepoints
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-#include <private/qopengl2pexvertexarray_p.h>
-#include <private/qopengltextureuploader_p.h>
-#include <qopenglframebufferobject.h>
-}
-
-QOpenGLFramebufferObjectPrivate_init_entry(QOpenGLFramebufferObject *qfbo, const QSize &size, QOpenGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples, bool mipmap)
-QOpenGLFramebufferObjectPrivate_init_exit()
-QOpenGL2PaintEngineExPrivate_drawTexture_entry(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
-QOpenGL2PaintEngineExPrivate_drawTexture_exit()
-QOpenGLTextureCache_bindTexture_entry(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)
-QOpenGLTextureCache_bindTexture_exit()
diff --git a/src/opengl/qtopenglglobal.h b/src/opengl/qtopenglglobal.h
index 58a76dbffd..a46f98e0bd 100644
--- a/src/opengl/qtopenglglobal.h
+++ b/src/opengl/qtopenglglobal.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 Intel Corporation.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QTOPENGLGLOBAL_H
#define QTOPENGLGLOBAL_H
diff --git a/src/opengl/qvkconvenience.cpp b/src/opengl/qvkconvenience.cpp
index 59de335333..244f788414 100644
--- a/src/opengl/qvkconvenience.cpp
+++ b/src/opengl/qvkconvenience.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 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$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qvkconvenience_p.h"
diff --git a/src/opengl/qvkconvenience_p.h b/src/opengl/qvkconvenience_p.h
index bc8694979b..416c944ed9 100644
--- a/src/opengl/qvkconvenience_p.h
+++ b/src/opengl/qvkconvenience_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 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$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QVKCONVENIENCE_P_H
#define QVKCONVENIENCE_P_H
@@ -53,6 +17,7 @@
#include <QtOpenGL/qtopenglglobal.h>
#include <qvulkaninstance.h>
+#include <private/qglobal_p.h>
QT_BEGIN_NAMESPACE