summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/.prev_CMakeLists.txt107
-rw-r--r--src/opengl/CMakeLists.txt45
-rw-r--r--src/opengl/doc/QtOpenGLDoc2
-rw-r--r--src/opengl/doc/images/openglwindow-example.pngbin0 -> 19920 bytes
-rw-r--r--src/opengl/doc/qtopengl.qdocconf23
-rw-r--r--src/opengl/doc/snippets/CMakeLists.txt7
-rw-r--r--src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp168
-rw-r--r--src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp21
-rw-r--r--src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp86
-rw-r--r--src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp69
-rw-r--r--src/opengl/doc/src/dontdocument.qdoc28
-rw-r--r--src/opengl/doc/src/qt6-changes.qdoc92
-rw-r--r--src/opengl/doc/src/qtopengl-examples.qdoc30
-rw-r--r--src/opengl/doc/src/qtopengl-index.qdoc115
-rw-r--r--src/opengl/doc/src/qtopengl-module.qdoc46
-rw-r--r--src/opengl/opengl.pro157
-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.h48
-rw-r--r--src/opengl/qopenglengineshadermanager.cpp69
-rw-r--r--src/opengl/qopenglengineshadermanager_p.h42
-rw-r--r--src/opengl/qopenglengineshadersource_p.h40
-rw-r--r--src/opengl/qopenglframebufferobject.cpp151
-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.h65
-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.h63
-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.h313
-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.h313
-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.h313
-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.h313
-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.h313
-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.cpp42
-rw-r--r--src/opengl/qopenglpaintdevice.h40
-rw-r--r--src/opengl/qopenglpaintdevice_p.h41
-rw-r--r--src/opengl/qopenglpaintengine.cpp209
-rw-r--r--src/opengl/qopenglpaintengine_p.h101
-rw-r--r--src/opengl/qopenglpixeltransferoptions.cpp41
-rw-r--r--src/opengl/qopenglpixeltransferoptions.h43
-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.cpp81
-rw-r--r--src/opengl/qopengltexture.h49
-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.cpp67
-rw-r--r--src/opengl/qopengltextureglyphcache_p.h44
-rw-r--r--src/opengl/qopengltexturehelper.cpp40
-rw-r--r--src/opengl/qopengltexturehelper_p.h41
-rw-r--r--src/opengl/qopengltextureuploader.cpp79
-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.cpp53
-rw-r--r--src/opengl/qopenglversionfunctions.h88
-rw-r--r--src/opengl/qopenglversionfunctions_p.h41
-rw-r--r--src/opengl/qopenglversionfunctionsfactory.cpp51
-rw-r--r--src/opengl/qopenglversionfunctionsfactory.h41
-rw-r--r--src/opengl/qopenglversionprofile.cpp40
-rw-r--r--src/opengl/qopenglversionprofile.h68
-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.cpp464
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.h87
-rw-r--r--src/opengl/qtopengl.tracepoints3
-rw-r--r--src/opengl/qtopenglglobal.h55
-rw-r--r--src/opengl/qvkconvenience.cpp40
-rw-r--r--src/opengl/qvkconvenience_p.h41
134 files changed, 1904 insertions, 7186 deletions
diff --git a/src/opengl/.prev_CMakeLists.txt b/src/opengl/.prev_CMakeLists.txt
deleted file mode 100644
index 1d8544ab8e..0000000000
--- a/src/opengl/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-# Generated from opengl.pro.
-
-#####################################################################
-## OpenGL Module:
-#####################################################################
-
-qt_add_module(OpenGL
- SOURCES
- qopengl2pexvertexarray.cpp qopengl2pexvertexarray_p.h
- qopenglbuffer.cpp qopenglbuffer.h
- qopenglcustomshaderstage.cpp qopenglcustomshaderstage_p.h
- qopengldebug.cpp qopengldebug.h
- qopenglengineshadermanager.cpp qopenglengineshadermanager_p.h
- qopenglengineshadersource_p.h
- qopenglframebufferobject.cpp qopenglframebufferobject.h qopenglframebufferobject_p.h
- qopenglgradientcache.cpp qopenglgradientcache_p.h
- qopenglpaintdevice.cpp qopenglpaintdevice.h qopenglpaintdevice_p.h
- qopenglpaintengine.cpp qopenglpaintengine_p.h
- qopenglpixeltransferoptions.cpp qopenglpixeltransferoptions.h
- qopenglshadercache_p.h
- qopenglshaderprogram.cpp qopenglshaderprogram.h
- qopengltexture.cpp qopengltexture.h qopengltexture_p.h
- qopengltextureblitter.cpp qopengltextureblitter.h
- qopengltexturecache.cpp qopengltexturecache_p.h
- qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h
- qopengltexturehelper.cpp qopengltexturehelper_p.h
- qopengltextureuploader.cpp qopengltextureuploader_p.h
- qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h
- qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h
- qopenglversionprofile.cpp qopenglversionprofile.h
- qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h
- qopenglwindow.cpp qopenglwindow.h
- qplatformbackingstoreopenglsupport.cpp qplatformbackingstoreopenglsupport.h
- qtopenglglobal.h
- DEFINES
- QT_NO_FOREACH
- QT_NO_USING_NAMESPACE
- LIBRARIES
- Qt::CorePrivate
- Qt::GuiPrivate
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
- PRIVATE_MODULE_INTERFACE
- Qt::CorePrivate
- Qt::GuiPrivate
-)
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
- SOURCES
- qopenglfunctions_es2.cpp qopenglfunctions_es2.h
-)
-
-qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
- SOURCES
- qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h
- qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h
- qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h
- qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h
- qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h
- qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h
- qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h
- qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h
- qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h
- qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h
- qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h
- qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h
- qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h
- qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h
- qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h
- qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h
- qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h
- qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h
- qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h
- qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h
- qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h
- qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h
- qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h
- qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h
- 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
-)
-
-qt_extend_target(OpenGL CONDITION QT_FEATURE_vulkan
- SOURCES
- qvkconvenience.cpp qvkconvenience_p.h
- PUBLIC_LIBRARIES
- Vulkan::Vulkan_nolink
-)
-
-qt_extend_target(OpenGL CONDITION QT_FEATURE_egl
- SOURCES
- qopenglcompositor.cpp qopenglcompositor_p.h
- qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
-)
-
-
-qt_create_tracepoints(OpenGL qtopengl.tracepoints)
-qt_add_docs(OpenGL
- doc/qtopengl.qdocconf
-)
-
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index 781301dc0f..825e4cb71b 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -1,10 +1,11 @@
-# Generated from opengl.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## OpenGL Module:
#####################################################################
-qt_add_module(OpenGL
+qt_internal_add_module(OpenGL
SOURCES
qopengl2pexvertexarray.cpp qopengl2pexvertexarray_p.h
qopenglbuffer.cpp qopenglbuffer.h
@@ -25,16 +26,20 @@ qt_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
@@ -44,17 +49,23 @@ qt_add_module(OpenGL
PRIVATE_MODULE_INTERFACE
Qt::CorePrivate
Qt::GuiPrivate
+ GENERATE_CPP_EXPORTS
)
## Scopes:
#####################################################################
-qt_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
+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
)
-qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
+qt_internal_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
SOURCES
qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h
qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h
@@ -83,24 +94,30 @@ qt_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_extend_target(OpenGL CONDITION QT_FEATURE_vulkan
+qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_vulkan
SOURCES
qvkconvenience.cpp qvkconvenience_p.h
- PUBLIC_LIBRARIES
- Vulkan::Vulkan_nolink
)
+if(QT_FEATURE_vulkan)
+ qt_internal_add_target_include_dirs_and_optionally_propagate(
+ OpenGL WrapVulkanHeaders::WrapVulkanHeaders)
+endif()
-qt_extend_target(OpenGL CONDITION QT_FEATURE_egl
+qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_egl
SOURCES
qopenglcompositor.cpp qopenglcompositor_p.h
qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
)
-qt_create_tracepoints(OpenGL qtopengl.tracepoints)
-qt_add_docs(OpenGL
+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/QtOpenGLDoc b/src/opengl/doc/QtOpenGLDoc
new file mode 100644
index 0000000000..2e98521801
--- /dev/null
+++ b/src/opengl/doc/QtOpenGLDoc
@@ -0,0 +1,2 @@
+#include <QtOpenGL/QtOpenGL>
+#include <QtOpenGLWidgets/QtOpenGLWidgets>
diff --git a/src/opengl/doc/images/openglwindow-example.png b/src/opengl/doc/images/openglwindow-example.png
new file mode 100644
index 0000000000..63ba4ed2f4
--- /dev/null
+++ b/src/opengl/doc/images/openglwindow-example.png
Binary files differ
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 6153e97e04..7af173aac8 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -1,6 +1,10 @@
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
include($QT_INSTALL_DOCS/config/exampleurl-qtbase.qdocconf)
+# Use a custom module header that pulls in also QtOpenGLWidgets
+includepaths += .
+moduleheader = QtOpenGLDoc
+
# Name of the project which must match the outputdir. Determines the .index file
project = QtOpenGL
@@ -11,17 +15,19 @@ project = QtOpenGL
# <rootdir>/examples.
# Paths are relative to the location of this file.
-headerdirs += ..
-sourcedirs += .. \
- ../../../examples/opengl/doc/src
+{sourcedirs,headerdirs} += \
+ .. \
+ ../../openglwidgets
+
exampledirs += ../../../examples/opengl \
. \
snippets \
- ..
-imagedirs += images \
- ../../../examples/opengl/doc/images
+ .. \
+ ../../gui/doc/snippets
-depends += qtcore qtgui qtwidgets qtdoc qmake qtcmake
+imagedirs += images
+
+depends += qtcore qtgui qtwidgets qtdoc qmake qtcmake qtquick
examplesinstallpath = opengl
@@ -57,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 03b161ee97..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)
-target_link_libraries(mytarget Qt::OpenGL)
+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
new file mode 100644
index 0000000000..f2c26e0bb8
--- /dev/null
+++ b/src/opengl/doc/snippets/code/doc_gui_widgets_qopenglwidget.cpp
@@ -0,0 +1,168 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+class MyGLWidget : public QOpenGLWidget
+{
+public:
+ MyGLWidget(QWidget *parent) : QOpenGLWidget(parent) { }
+
+protected:
+ void initializeGL() override
+ {
+ // Set up the rendering context, load shaders and other resources, etc.:
+ QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
+ f->glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ ...
+ }
+
+ void resizeGL(int w, int h) override
+ {
+ // Update projection matrix and other size related settings:
+ m_projection.setToIdentity();
+ m_projection.perspective(45.0f, w / float(h), 0.01f, 100.0f);
+ ...
+ }
+
+ void paintGL() override
+ {
+ // Draw the scene:
+ QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
+ f->glClear(GL_COLOR_BUFFER_BIT);
+ ...
+ }
+
+};
+//! [0]
+
+//! [1]
+class MyGLWidget : public QOpenGLWidget, protected QOpenGLFunctions
+{
+ ...
+ void initializeGL() override
+ {
+ initializeOpenGLFunctions();
+ glClearColor(...);
+ ...
+ }
+ ...
+};
+//! [1]
+
+//! [2]
+QOpenGLWidget *widget = new QOpenGLWidget(parent);
+QSurfaceFormat format;
+format.setDepthBufferSize(24);
+format.setStencilBufferSize(8);
+format.setVersion(3, 2);
+format.setProfile(QSurfaceFormat::CoreProfile);
+widget->setFormat(format); // must be called before the widget or its parent window gets shown
+//! [2]
+
+//! [3]
+ ...
+ void paintGL() override
+ {
+ QOpenGLFunctions_3_2_Core *f = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
+ ...
+ f->glDrawArraysInstanced(...);
+ ...
+ }
+ ...
+//! [3]
+
+//! [4]
+class MyGLWidget : public QOpenGLWidget
+{
+ ...
+
+private:
+ QOpenGLVertexArrayObject m_vao;
+ QOpenGLBuffer m_vbo;
+ QOpenGLShaderProgram *m_program;
+ QOpenGLShader *m_shader;
+ QOpenGLTexture *m_texture;
+};
+
+MyGLWidget::MyGLWidget()
+ : m_program(0), m_shader(0), m_texture(0)
+{
+ // No OpenGL resource initialization is done here.
+}
+
+MyGLWidget::~MyGLWidget()
+{
+ // Make sure the context is current and then explicitly
+ // destroy all underlying OpenGL resources.
+ makeCurrent();
+
+ delete m_texture;
+ delete m_shader;
+ delete m_program;
+
+ m_vbo.destroy();
+ m_vao.destroy();
+
+ doneCurrent();
+}
+
+void MyGLWidget::initializeGL()
+{
+ m_vao.create();
+ if (m_vao.isCreated())
+ m_vao.bind();
+
+ m_vbo.create();
+ m_vbo.bind();
+ m_vbo.allocate(...);
+
+ m_texture = new QOpenGLTexture(QImage(...));
+
+ m_shader = new QOpenGLShader(...);
+ m_program = new QOpenGLShaderProgram(...);
+
+ ...
+}
+//! [4]
+
+//! [5]
+MyGLWidget::~MyGLWidget()
+{
+ cleanup();
+}
+
+void MyGLWidget::initializeGL()
+{
+ ...
+ connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &MyGLWidget::cleanup);
+}
+
+void MyGLWidget::cleanup()
+{
+ makeCurrent();
+ delete m_texture;
+ m_texture = 0;
+ ...
+ doneCurrent();
+ disconnect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &MyGLWidget::cleanup);
+}
+//! [5]
+
+//! [6]
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QSurfaceFormat format;
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ format.setVersion(3, 2);
+ format.setProfile(QSurfaceFormat::CoreProfile);
+ QSurfaceFormat::setDefaultFormat(format);
+
+ MyWidget widget;
+ widget.show();
+
+ return app.exec();
+}
+//! [6]
diff --git a/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp b/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp
new file mode 100644
index 0000000000..f20eb3493a
--- /dev/null
+++ b/src/opengl/doc/snippets/code/src_gui_opengl_qopenglbuffer.cpp
@@ -0,0 +1,21 @@
+// 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 {
+void wrapper() {
+
+//! [0]
+QOpenGLBuffer buffer1(QOpenGLBuffer::IndexBuffer);
+buffer1.create();
+
+QOpenGLBuffer buffer2 = buffer1;
+//! [0]
+
+
+//! [1]
+QOpenGLBuffer::release(QOpenGLBuffer::VertexBuffer);
+//! [1]
+
+} // wrapper
+} // 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
new file mode 100644
index 0000000000..bb5c212205
--- /dev/null
+++ b/src/opengl/doc/snippets/code/src_gui_opengl_qopengldebug.cpp
@@ -0,0 +1,86 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+#include <QOpenGLContext>
+#include <QSurfaceFormat>
+#include <QWidget>
+#include <QtOpenGL/QOpenGLDebugLogger>
+
+namespace src_gui_opengl_qopengldebug {
+struct LogHandler : public QObject
+{
+ Q_OBJECT
+public slots:
+ static bool handleLoggedMessage() { return true; };
+};
+struct SnippetWrapper : public QObject
+{
+ Q_OBJECT
+ void wrapper1(LogHandler *receiver);
+ const QWidget *receiver;
+};
+
+void wrapper0() {
+
+//! [0]
+GLenum error = GL_NO_ERROR;
+do {
+ error = glGetError();
+ if (error != GL_NO_ERROR) {
+ // handle the error
+ }
+} while (error != GL_NO_ERROR);
+//! [0]
+
+
+//! [1]
+QSurfaceFormat format;
+// asks for a OpenGL 3.2 debug context using the Core profile
+format.setMajorVersion(3);
+format.setMinorVersion(2);
+format.setProfile(QSurfaceFormat::CoreProfile);
+format.setOption(QSurfaceFormat::DebugContext);
+
+QOpenGLContext *context = new QOpenGLContext;
+context->setFormat(format);
+context->create();
+//! [1]
+
+} // wrapper0
+
+
+void SnippetWrapper::wrapper1(LogHandler *receiver) {
+//! [2]
+QOpenGLContext *ctx = QOpenGLContext::currentContext();
+QOpenGLDebugLogger *logger = new QOpenGLDebugLogger(this);
+
+logger->initialize(); // initializes in the current context, i.e. ctx
+//! [2]
+
+
+//! [3]
+ctx->hasExtension(QByteArrayLiteral("GL_KHR_debug"));
+//! [3]
+
+
+//! [4]
+const QList<QOpenGLDebugMessage> messages = logger->loggedMessages();
+for (const QOpenGLDebugMessage &message : messages)
+ qDebug() << message;
+//! [4]
+
+
+//! [5]
+connect(logger, &QOpenGLDebugLogger::messageLogged, receiver, &LogHandler::handleLoggedMessage);
+logger->startLogging();
+//! [5]
+
+
+//! [6]
+QOpenGLDebugMessage message =
+ QOpenGLDebugMessage::createApplicationMessage(QStringLiteral("Custom message"));
+
+logger->logMessage(message);
+//! [6]
+
+} // SnippetWrapper::wrapper1
+} // src_gui_opengl_qopengldebug
diff --git a/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp b/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp
new file mode 100644
index 0000000000..de62069fda
--- /dev/null
+++ b/src/opengl/doc/snippets/code/src_gui_qopenglshaderprogram.cpp
@@ -0,0 +1,69 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+#include <QColor>
+#include <QString>
+#include <QtOpenGL/QOpenGLShader>
+
+namespace src_gui_qopenglshaderprogram {
+QString code;
+QObject *context = nullptr;
+QRectF rect() { return QRectF(); }
+
+void wrapper() {
+//! [0]
+QOpenGLShader shader(QOpenGLShader::Vertex);
+shader.compileSourceCode(code);
+
+QOpenGLShaderProgram program(context);
+program.addShader(&shader);
+program.link();
+
+program.bind();
+//! [0]
+
+//! [1]
+program.addShaderFromSourceCode(QOpenGLShader::Vertex,
+ "attribute highp vec4 vertex;\n"
+ "uniform highp mat4 matrix;\n"
+ "void main(void)\n"
+ "{\n"
+ " gl_Position = matrix * vertex;\n"
+ "}");
+program.addShaderFromSourceCode(QOpenGLShader::Fragment,
+ "uniform mediump vec4 color;\n"
+ "void main(void)\n"
+ "{\n"
+ " gl_FragColor = color;\n"
+ "}");
+program.link();
+program.bind();
+
+int vertexLocation = program.attributeLocation("vertex");
+int matrixLocation = program.uniformLocation("matrix");
+int colorLocation = program.uniformLocation("color");
+//! [1]
+
+//! [2]
+static GLfloat const triangleVertices[] = {
+ 60.0f, 10.0f, 0.0f,
+ 110.0f, 110.0f, 0.0f,
+ 10.0f, 110.0f, 0.0f
+};
+
+QColor color(0, 255, 0, 255);
+
+QMatrix4x4 pmvMatrix;
+pmvMatrix.ortho(rect());
+
+program.enableAttributeArray(vertexLocation);
+program.setAttributeArray(vertexLocation, triangleVertices, 3);
+program.setUniformValue(matrixLocation, pmvMatrix);
+program.setUniformValue(colorLocation, color);
+
+glDrawArrays(GL_TRIANGLES, 0, 3);
+
+program.disableAttributeArray(vertexLocation);
+//! [2]
+
+} // wrapper
+} // src_gui_qopenglshaderprogram
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 6ef8c69bbb..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 Porting to Qt 6 - Qt OpenGL
- \ingroup porting-guides-5-to-6
- \brief Migrate Qt OpenGL to Qt 6.
+ \title Changes to Qt OpenGL
+ \ingroup changes-qt-5-to-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.
@@ -38,9 +14,63 @@
APIs in each release. But some changes were inevitable in an effort to
make Qt a better framework.
- In this topic we summarize those changes in Qt OpenGL, and provide
+ In this topic we summarize those changes in \l{Qt OpenGL}, and provide
guidance to handle them.
- \section1 ADD STUFF HERE
+ \section1 Deprecated classes removed
+ The \l{Qt OpenGL} module was deprecated for the life time of Qt 5, and the
+ classes it contained have been removed in Qt 6.
+
+ This refers specifically to the classes prefixed by \c{QGL}.
+
+ \section1 QOpenGL classes migrated
+
+ In Qt 5, a replacement set of OpenGL-support classes were added to Qt Gui.
+ This was in order to support OpenGL as the cross-platform graphics API that
+ served as foundation for graphics in Qt.
+
+ In Qt 6, these have been migrated to the \l{Qt OpenGL} module. They are still
+ usable and fully supported for applications depending on OpenGL directly.
+ However, they are no longer considered foundational, since Qt has been extended
+ to support other graphics APIs in its foundation, such as Direct3D, Metal and
+ Vulkan.
+
+ Existing application code will largely continue working, but should now
+ include \l{Qt OpenGL} in project files, as well as include the headers if
+ these were previously included indirectly through Qt Gui.
+
+ \note A notable exception is \l QOpenGLContext, which still resides in
+ Qt Gui.
+
+ \section1 The QOpenGLWidgets class
+
+ Another exception is the \l QOpenGLWidget class. This has been moved to a new
+ module named \c{Qt OpenGL Widgets} and should be included from there.
+
+ \section1 Selecting the OpenGL backend for RHI
+
+ In addition to adjusting project files and including headers, the application
+ should also manually set the rendering backend to OpenGL in order to use
+ this functionality when working with Qt Quick. By default, Qt will use the most
+ appropriate graphics API on the target platform. See the
+ \l{Rendering via the Qt Rendering Hardware Interface}{RHI rendering documentation}
+ for more details.
+
+ \section1 Removal of ANGLE
+
+ On Windows, ANGLE, a third-party OpenGL ES to Direct 3D translator, is no
+ longer included in Qt 6. This means \c Qt::AA_UseOpenGLES and the
+ environment variable \c{QT_OPENGL=angle} no longer has any effect. In
+ dynamic OpenGL builds there is no automatic fallback to ANGLE in case
+ OpenGL-proper fails to initialize. For QWindow or QWidget based applications
+ using OpenGL directly, for example via QOpenGLWidget, this means that
+ OpenGL-proper is the only option at runtime. However, the use of a pure
+ software OpenGL implementation, such as Mesa llvmpipe that is shipped with
+ the pre-built Qt packages, is still available.
+
+ For Qt Quick and Qt Quick 3D applications, Qt 6 introduces support for
+ Direct 3D 11, Vulkan, and Metal, in addition to OpenGL. On Windows, Qt 6
+ defaults to Direct 3D, therefore the effect of the removal of ANGLE is
+ lessened by the addition of support to other graphics APIs.
*/
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 53f1599c1b..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
@@ -31,49 +7,78 @@
\brief The Qt OpenGL module offers classes that make it easy to
use OpenGL in Qt applications.
- \warning This module should not be used anymore for new code. Please
- use the corresponding OpenGL classes in \l{Qt GUI}.
- \section1 Introduction
+ 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 that have been
+ optimized for each of these types.
- OpenGL is a standard API for rendering 3D graphics. OpenGL only
- deals with 3D rendering and provides little or no support for GUI
- programming issues. The user interface for an OpenGL application
- must be created with another toolkit, such as Cocoa on the \macos
- platform, Microsoft Foundation Classes (MFC) under Windows, or Qt
- on both platforms.
+ It is possible to combine code written in the OpenGL graphics API
+ 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.
- The Qt OpenGL module makes it easy to use OpenGL in Qt applications.
- It provides an OpenGL widget class that can be used just like any
- other Qt widget, except that it opens an OpenGL display buffer where
- you can use the OpenGL API to render the contents.
+ The Qt OpenGL module contains convenience classes to make this type of
+ integration easier and faster.
- The Qt OpenGL module is implemented as a platform-independent Qt/C++
- wrapper around the platform-dependent GLX (version 1.3 or later),
- WGL, or AGL C APIs. Although the basic functionality provided is very
- similar to Mark Kilgard's GLUT library, applications using the Qt
- OpenGL module can take advantage of the whole Qt API for
- non-OpenGL-specific GUI functionality.
+ \section1 Qt OpenGL and Qt Widgets
- The \l{Qt OpenGL C++ Classes} page gives an overview over the available classes
- in this module.
+ \l{Qt Widgets} is typically rendered by a highly optimized and accurate
+ software rasterizer, and the final content reproduced on screen using a
+ method appropriate for the platform where the application is running.
- \include module-use.qdocinc using qt module
- \snippet snippets/CMakeLists.txt cmake_use
+ But it is also possible to combine \l{Qt Widgets} with OpenGL. The main entry
+ point for this is the \l{QOpenGLWidget} class. This class can be used to
+ enable OpenGL rendering for a certain part of the widget tree, and the
+ classes in the Qt OpenGL module can be used to facilitate any application-side
+ OpenGL code.
- See also the \l[QtDoc]{Build with CMake} overview.
+ \section1 Qt OpenGL and Qt Quick
- \include module-use.qdocinc building with qmake
- \snippet snippets/snippets.pro qmake_use
+ \l[QtQuick]{Qt Quick} is optimized for hardware-accelerated rendering. By default,
+ it will be built on the low-level graphics API most appropriate for the
+ target platform.
+
+ For instance, it will default to \c Direct3D on Windows, whereas on macOS,
+ it will default to \c Metal. But it is also possible to manually
+ select OpenGL as the active graphics API on platforms where this is supported.
+
+ For more details on enabling OpenGL with \l[QtQuick]{Qt Quick}, see
+ \l{Rendering via the Qt Rendering Hardware Interface}{scenegraph renderer documentation}.
+
+ \section1 Using the Module
+
+ \include {module-use.qdocinc} {using the c++ api}
+
+ \section2 Building with CMake
+
+ \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{Porting to Qt 6 - Qt OpenGL} lists important changes in the module API
+ \l{Changes to Qt OpenGL} lists important changes in the module API
and functionality that were done for the Qt 6 series of Qt.
\section1 Licenses and Trademarks
- The Qt OpenGL module is available under commercial licenses from \l{The Qt Company}.
- In addition, it is available under free software licenses:
+ The Qt OpenGL module is available under commercial licenses from
+ \l{The Qt Company}. In addition, it is available under free software
+ licenses:
The \l{GNU Lesser General Public License, version 3}, or
the \l{GNU General Public License, version 2}.
See \l{Qt Licensing} for further details.
diff --git a/src/opengl/doc/src/qtopengl-module.qdoc b/src/opengl/doc/src/qtopengl-module.qdoc
index 0ba78ed5dc..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
@@ -35,5 +11,21 @@
\brief The Qt OpenGL module offers classes that make it easy to
use OpenGL in Qt applications.
- \warning This module should not be used anymore for new code.
+ The \l{Qt OpenGL} page contains information about how to use the module.
+
+ A separate \l{Qt OpenGL Widgets C++ Classes}{Qt OpenGL Widgets} library
+ provides a C++ widget class for rendering OpenGL graphics into widgets UIs.
+
+ \generatelist classesbymodule QtOpenGLWidgets
+*/
+
+/*
+ This "module" only exists so that classes in that separate library have
+ the correct build system documentation.
+*/
+/*!
+ \module QtOpenGLWidgets
+ \title Qt OpenGL Widgets C++ Classes
+ \qtcmakepackage OpenGLWidgets
+ \qtvariable openglwidgets
*/
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
deleted file mode 100644
index 0dd3d33552..0000000000
--- a/src/opengl/opengl.pro
+++ /dev/null
@@ -1,157 +0,0 @@
-TARGET = QtOpenGL
-QT = core-private gui-private
-
-DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
-
-QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
-
-qtConfig(opengl): CONFIG += opengl
-qtConfig(opengles2): CONFIG += opengles2
-
-HEADERS += \
- qopengl2pexvertexarray_p.h \
- qopenglbuffer.h \
- qopenglcustomshaderstage_p.h \
- qopengldebug.h \
- qopenglengineshadermanager_p.h \
- qopenglengineshadersource_p.h \
- qopenglframebufferobject.h \
- qopenglframebufferobject_p.h \
- qopenglgradientcache_p.h \
- qopenglpaintdevice.h \
- qopenglpaintdevice_p.h \
- qopenglpaintengine_p.h \
- qopenglpixeltransferoptions.h \
- qopenglshadercache_p.h \
- qopenglshaderprogram.h \
- qopengltexture.h \
- qopengltexture_p.h \
- qopengltexturehelper_p.h \
- qopengltextureblitter.h \
- qopengltexturecache_p.h \
- qopengltextureglyphcache_p.h \
- qopengltextureuploader_p.h \
- qopenglversionfunctions.h \
- qopenglversionfunctions_p.h \
- qopenglversionfunctionsfactory.h \
- qopenglversionprofile.h \
- qopenglvertexarrayobject.h \
- qopenglwindow.h \
- qtopenglglobal.h \
- qplatformbackingstoreopenglsupport.h
-
-SOURCES += \
- qopengl2pexvertexarray.cpp \
- qopenglbuffer.cpp \
- qopenglcustomshaderstage.cpp \
- qopenglengineshadermanager.cpp \
- qopenglframebufferobject.cpp \
- qopenglgradientcache.cpp \
- qopenglpaintdevice.cpp \
- qopenglpaintengine.cpp \
- qopenglpixeltransferoptions.cpp \
- qopenglshaderprogram.cpp \
- qopengltexture.cpp \
- qopengltexturehelper.cpp \
- qopengltextureblitter.cpp \
- qopengltexturecache.cpp \
- qopengltextureglyphcache.cpp \
- qopengltextureuploader.cpp \
- qopenglversionfunctions.cpp \
- qopenglversionfunctionsfactory.cpp \
- qopenglversionprofile.cpp \
- qopenglvertexarrayobject.cpp \
- qopenglwindow.cpp \
- qopengldebug.cpp \
- qplatformbackingstoreopenglsupport.cpp
-
-!qtConfig(opengles2) {
- HEADERS += \
- qopenglfunctions_1_0.h \
- qopenglfunctions_1_1.h \
- qopenglfunctions_1_2.h \
- qopenglfunctions_1_3.h \
- qopenglfunctions_1_4.h \
- qopenglfunctions_1_5.h \
- qopenglfunctions_2_0.h \
- qopenglfunctions_2_1.h \
- qopenglfunctions_3_0.h \
- qopenglfunctions_3_1.h \
- qopenglfunctions_3_2_core.h \
- qopenglfunctions_3_3_core.h \
- qopenglfunctions_4_0_core.h \
- qopenglfunctions_4_1_core.h \
- qopenglfunctions_4_2_core.h \
- qopenglfunctions_4_3_core.h \
- qopenglfunctions_4_4_core.h \
- qopenglfunctions_4_5_core.h \
- qopenglfunctions_3_2_compatibility.h \
- qopenglfunctions_3_3_compatibility.h \
- qopenglfunctions_4_0_compatibility.h \
- qopenglfunctions_4_1_compatibility.h \
- qopenglfunctions_4_2_compatibility.h \
- qopenglfunctions_4_3_compatibility.h \
- qopenglfunctions_4_4_compatibility.h \
- qopenglfunctions_4_5_compatibility.h \
- qopenglqueryhelper_p.h \
- qopengltimerquery.h
-
- SOURCES += \
- qopenglfunctions_1_0.cpp \
- qopenglfunctions_1_1.cpp \
- qopenglfunctions_1_2.cpp \
- qopenglfunctions_1_3.cpp \
- qopenglfunctions_1_4.cpp \
- qopenglfunctions_1_5.cpp \
- qopenglfunctions_2_0.cpp \
- qopenglfunctions_2_1.cpp \
- qopenglfunctions_3_0.cpp \
- qopenglfunctions_3_1.cpp \
- qopenglfunctions_3_2_core.cpp \
- qopenglfunctions_3_3_core.cpp \
- qopenglfunctions_4_0_core.cpp \
- qopenglfunctions_4_1_core.cpp \
- qopenglfunctions_4_2_core.cpp \
- qopenglfunctions_4_3_core.cpp \
- qopenglfunctions_4_4_core.cpp \
- qopenglfunctions_4_5_core.cpp \
- qopenglfunctions_3_2_compatibility.cpp \
- qopenglfunctions_3_3_compatibility.cpp \
- qopenglfunctions_4_0_compatibility.cpp \
- qopenglfunctions_4_1_compatibility.cpp \
- qopenglfunctions_4_2_compatibility.cpp \
- qopenglfunctions_4_3_compatibility.cpp \
- qopenglfunctions_4_4_compatibility.cpp \
- qopenglfunctions_4_5_compatibility.cpp \
- qopengltimerquery.cpp
-}
-
-qtConfig(opengles2) {
- HEADERS += qopenglfunctions_es2.h
- SOURCES += qopenglfunctions_es2.cpp
-}
-
-qtConfig(vulkan) {
- CONFIG += generated_privates
-
- HEADERS += qvkconvenience_p.h
- SOURCES += qvkconvenience.cpp
-
- # Applications must inherit the Vulkan header include path.
- QMAKE_USE += vulkan/nolink
-}
-
-qtConfig(egl) {
- SOURCES += \
- qopenglcompositorbackingstore.cpp \
- qopenglcompositor.cpp
-
- HEADERS += \
- qopenglcompositorbackingstore_p.h \
- qopenglcompositor_p.h
-}
-
-load(qt_module)
-
-TRACEPOINT_PROVIDER = $$PWD/qtopengl.tracepoints
-CONFIG += qt_tracepoints
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 c12d996493..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
@@ -109,10 +73,10 @@ public:
QOpenGLDebugMessage(const QOpenGLDebugMessage &debugMessage);
QOpenGLDebugMessage &operator=(const QOpenGLDebugMessage &debugMessage);
- QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) noexcept { swap(other); return *this; }
+ 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 dc52b326bb..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)
@@ -493,9 +456,7 @@ void QOpenGLEngineSharedShaders::cleanupCustomStage(QOpenGLCustomShaderStage* st
}
return false;
};
- cachedPrograms.erase(std::remove_if(cachedPrograms.begin(), cachedPrograms.end(),
- hasStageAsCustomShaderSouce),
- cachedPrograms.end());
+ cachedPrograms.removeIf(hasStageAsCustomShaderSouce);
}
@@ -896,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 78b192b630..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() \
{ \
@@ -152,6 +125,25 @@ QT_BEGIN_NAMESPACE
#define GL_DEPTH_STENCIL 0x84F9
#endif
+#ifndef GL_HALF_FLOAT
+#define GL_HALF_FLOAT 0x140B
+#endif
+
+#ifndef GL_RGBA32F
+#define GL_RGBA32F 0x8814
+#endif
+
+#ifndef GL_RGB32F
+#define GL_RGB32F 0x8815
+#endif
+
+#ifndef GL_RGBA16F
+#define GL_RGBA16F 0x881A
+#endif
+
+#ifndef GL_RGB16F
+#define GL_RGB16F 0x881B
+#endif
/*!
@@ -469,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);
@@ -554,9 +547,25 @@ void QOpenGLFramebufferObjectPrivate::initTexture(int idx)
pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
else if (color.internalFormat == GL_RGB16 || color.internalFormat == GL_RGBA16)
pixelType = GL_UNSIGNED_SHORT;
+ 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();
@@ -565,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,
@@ -1008,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();
}
@@ -1068,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);
@@ -1149,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);
}
@@ -1229,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;
@@ -1281,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();
@@ -1349,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;
}
@@ -1359,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;
}
@@ -1367,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;
}
@@ -1375,7 +1387,25 @@ 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;
+}
+
+static inline QImage qt_gl_read_framebuffer_rgba16f(const QSize &size, bool include_alpha, QOpenGLContext *context)
+{
+ // We assume OpenGL (ES) 3.0+ here.
+ QImage img(size, include_alpha ? QImage::Format_RGBA16FPx4_Premultiplied : QImage::Format_RGBX16FPx4);
+ 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);
+ if (!img.isNull())
+ context->functions()->glReadPixels(0, 0, size.width(), size.height(), GL_RGBA, GL_FLOAT, img.bits());
return img;
}
@@ -1400,14 +1430,21 @@ static QImage qt_gl_read_framebuffer(const QSize &size, GLenum internal_format,
return qt_gl_read_framebuffer_rgba16(size, false, ctx).mirrored(false, flip);
case GL_RGBA16:
return qt_gl_read_framebuffer_rgba16(size, include_alpha, ctx).mirrored(false, flip);
+ case GL_RGB16F:
+ return qt_gl_read_framebuffer_rgba16f(size, false, ctx).mirrored(false, flip);
+ case GL_RGBA16F:
+ return qt_gl_read_framebuffer_rgba16f(size, include_alpha, ctx).mirrored(false, flip);
+ case GL_RGB32F:
+ return qt_gl_read_framebuffer_rgba32f(size, false, ctx).mirrored(false, flip);
+ case GL_RGBA32F:
+ return qt_gl_read_framebuffer_rgba32f(size, include_alpha, ctx).mirrored(false, flip);
case GL_RGBA:
case GL_RGBA8:
default:
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)
@@ -1483,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 cee5685a86..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
**
@@ -119,8 +84,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -132,7 +95,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -593,18 +555,6 @@ inline void QOpenGLFunctions_3_1::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_3_1::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_1::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_3_1::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -660,13 +610,6 @@ inline void QOpenGLFunctions_3_1::glPolygonOffset(GLfloat factor, GLfloat units)
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_3_1::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_3_1::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
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 bcc07eeca1..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
**
@@ -119,8 +84,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -132,7 +95,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -615,18 +577,6 @@ inline void QOpenGLFunctions_3_2_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_3_2_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_2_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_3_2_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -682,13 +632,6 @@ inline void QOpenGLFunctions_3_2_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_3_2_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_3_2_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
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 b38f9c54e5..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
**
@@ -119,8 +84,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -132,7 +95,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -362,36 +324,6 @@ public:
void glVertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
void glVertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
- void glSecondaryColorP3uiv(GLenum type, const GLuint *color);
- void glSecondaryColorP3ui(GLenum type, GLuint color);
- void glColorP4uiv(GLenum type, const GLuint *color);
- void glColorP4ui(GLenum type, GLuint color);
- void glColorP3uiv(GLenum type, const GLuint *color);
- void glColorP3ui(GLenum type, GLuint color);
- void glNormalP3uiv(GLenum type, const GLuint *coords);
- void glNormalP3ui(GLenum type, GLuint coords);
- void glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords);
- void glTexCoordP4uiv(GLenum type, const GLuint *coords);
- void glTexCoordP4ui(GLenum type, GLuint coords);
- void glTexCoordP3uiv(GLenum type, const GLuint *coords);
- void glTexCoordP3ui(GLenum type, GLuint coords);
- void glTexCoordP2uiv(GLenum type, const GLuint *coords);
- void glTexCoordP2ui(GLenum type, GLuint coords);
- void glTexCoordP1uiv(GLenum type, const GLuint *coords);
- void glTexCoordP1ui(GLenum type, GLuint coords);
- void glVertexP4uiv(GLenum type, const GLuint *value);
- void glVertexP4ui(GLenum type, GLuint value);
- void glVertexP3uiv(GLenum type, const GLuint *value);
- void glVertexP3ui(GLenum type, GLuint value);
- void glVertexP2uiv(GLenum type, const GLuint *value);
- void glVertexP2ui(GLenum type, GLuint value);
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void glQueryCounter(GLuint id, GLenum target);
@@ -676,18 +608,6 @@ inline void QOpenGLFunctions_3_3_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_3_3_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_3_3_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -743,13 +663,6 @@ inline void QOpenGLFunctions_3_3_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_3_3_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_3_3_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
@@ -1815,224 +1728,6 @@ inline void QOpenGLFunctions_3_3_Core::glVertexAttribP1ui(GLuint index, GLenum t
d_3_3_Core->f.VertexAttribP1ui(index, type, normalized, value);
}
-inline void QOpenGLFunctions_3_3_Core::glSecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glSecondaryColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glColorP4uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glColorP4ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glNormalP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glNormalP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP4uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP4ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP2uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP2ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP1uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glTexCoordP1ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP4uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP4ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP3uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP3ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP2uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_3_3_Core::glVertexP2ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_3_3_Core::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params)
{
d_3_3_Core->f.GetQueryObjectui64v(id, pname, params);
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 8553bada6e..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
**
@@ -119,8 +84,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -132,7 +95,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -362,36 +324,6 @@ public:
void glVertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
void glVertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
- void glSecondaryColorP3uiv(GLenum type, const GLuint *color);
- void glSecondaryColorP3ui(GLenum type, GLuint color);
- void glColorP4uiv(GLenum type, const GLuint *color);
- void glColorP4ui(GLenum type, GLuint color);
- void glColorP3uiv(GLenum type, const GLuint *color);
- void glColorP3ui(GLenum type, GLuint color);
- void glNormalP3uiv(GLenum type, const GLuint *coords);
- void glNormalP3ui(GLenum type, GLuint coords);
- void glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords);
- void glTexCoordP4uiv(GLenum type, const GLuint *coords);
- void glTexCoordP4ui(GLenum type, GLuint coords);
- void glTexCoordP3uiv(GLenum type, const GLuint *coords);
- void glTexCoordP3ui(GLenum type, GLuint coords);
- void glTexCoordP2uiv(GLenum type, const GLuint *coords);
- void glTexCoordP2ui(GLenum type, GLuint coords);
- void glTexCoordP1uiv(GLenum type, const GLuint *coords);
- void glTexCoordP1ui(GLenum type, GLuint coords);
- void glVertexP4uiv(GLenum type, const GLuint *value);
- void glVertexP4ui(GLenum type, GLuint value);
- void glVertexP3uiv(GLenum type, const GLuint *value);
- void glVertexP3ui(GLenum type, GLuint value);
- void glVertexP2uiv(GLenum type, const GLuint *value);
- void glVertexP2ui(GLenum type, GLuint value);
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void glQueryCounter(GLuint id, GLenum target);
@@ -725,18 +657,6 @@ inline void QOpenGLFunctions_4_0_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_4_0_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_4_0_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -792,13 +712,6 @@ inline void QOpenGLFunctions_4_0_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_4_0_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_0_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
@@ -1864,224 +1777,6 @@ inline void QOpenGLFunctions_4_0_Core::glVertexAttribP1ui(GLuint index, GLenum t
d_3_3_Core->f.VertexAttribP1ui(index, type, normalized, value);
}
-inline void QOpenGLFunctions_4_0_Core::glSecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glSecondaryColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glColorP4uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glColorP4ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glNormalP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glNormalP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP4uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP4ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP2uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP2ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP1uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glTexCoordP1ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP4uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP4ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP3uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP3ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP2uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_0_Core::glVertexP2ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_0_Core::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params)
{
d_3_3_Core->f.GetQueryObjectui64v(id, pname, params);
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 8c2f5bce3e..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
**
@@ -119,8 +84,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -132,7 +95,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -362,36 +324,6 @@ public:
void glVertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
void glVertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
- void glSecondaryColorP3uiv(GLenum type, const GLuint *color);
- void glSecondaryColorP3ui(GLenum type, GLuint color);
- void glColorP4uiv(GLenum type, const GLuint *color);
- void glColorP4ui(GLenum type, GLuint color);
- void glColorP3uiv(GLenum type, const GLuint *color);
- void glColorP3ui(GLenum type, GLuint color);
- void glNormalP3uiv(GLenum type, const GLuint *coords);
- void glNormalP3ui(GLenum type, GLuint coords);
- void glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords);
- void glTexCoordP4uiv(GLenum type, const GLuint *coords);
- void glTexCoordP4ui(GLenum type, GLuint coords);
- void glTexCoordP3uiv(GLenum type, const GLuint *coords);
- void glTexCoordP3ui(GLenum type, GLuint coords);
- void glTexCoordP2uiv(GLenum type, const GLuint *coords);
- void glTexCoordP2ui(GLenum type, GLuint coords);
- void glTexCoordP1uiv(GLenum type, const GLuint *coords);
- void glTexCoordP1ui(GLenum type, GLuint coords);
- void glVertexP4uiv(GLenum type, const GLuint *value);
- void glVertexP4ui(GLenum type, GLuint value);
- void glVertexP3uiv(GLenum type, const GLuint *value);
- void glVertexP3ui(GLenum type, GLuint value);
- void glVertexP2uiv(GLenum type, const GLuint *value);
- void glVertexP2ui(GLenum type, GLuint value);
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void glQueryCounter(GLuint id, GLenum target);
@@ -816,18 +748,6 @@ inline void QOpenGLFunctions_4_1_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_4_1_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_4_1_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -883,13 +803,6 @@ inline void QOpenGLFunctions_4_1_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_4_1_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_1_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
@@ -1955,224 +1868,6 @@ inline void QOpenGLFunctions_4_1_Core::glVertexAttribP1ui(GLuint index, GLenum t
d_3_3_Core->f.VertexAttribP1ui(index, type, normalized, value);
}
-inline void QOpenGLFunctions_4_1_Core::glSecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glSecondaryColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glColorP4uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glColorP4ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glNormalP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glNormalP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP4uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP4ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP2uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP2ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP1uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glTexCoordP1ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP4uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP4ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP3uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP3ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP2uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_1_Core::glVertexP2ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_1_Core::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params)
{
d_3_3_Core->f.GetQueryObjectui64v(id, pname, params);
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 88e19fe1bc..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
**
@@ -125,8 +90,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -138,7 +101,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -368,36 +330,6 @@ public:
void glVertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
void glVertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
- void glSecondaryColorP3uiv(GLenum type, const GLuint *color);
- void glSecondaryColorP3ui(GLenum type, GLuint color);
- void glColorP4uiv(GLenum type, const GLuint *color);
- void glColorP4ui(GLenum type, GLuint color);
- void glColorP3uiv(GLenum type, const GLuint *color);
- void glColorP3ui(GLenum type, GLuint color);
- void glNormalP3uiv(GLenum type, const GLuint *coords);
- void glNormalP3ui(GLenum type, GLuint coords);
- void glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords);
- void glTexCoordP4uiv(GLenum type, const GLuint *coords);
- void glTexCoordP4ui(GLenum type, GLuint coords);
- void glTexCoordP3uiv(GLenum type, const GLuint *coords);
- void glTexCoordP3ui(GLenum type, GLuint coords);
- void glTexCoordP2uiv(GLenum type, const GLuint *coords);
- void glTexCoordP2ui(GLenum type, GLuint coords);
- void glTexCoordP1uiv(GLenum type, const GLuint *coords);
- void glTexCoordP1ui(GLenum type, GLuint coords);
- void glVertexP4uiv(GLenum type, const GLuint *value);
- void glVertexP4ui(GLenum type, GLuint value);
- void glVertexP3uiv(GLenum type, const GLuint *value);
- void glVertexP3ui(GLenum type, GLuint value);
- void glVertexP2uiv(GLenum type, const GLuint *value);
- void glVertexP2ui(GLenum type, GLuint value);
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void glQueryCounter(GLuint id, GLenum target);
@@ -837,18 +769,6 @@ inline void QOpenGLFunctions_4_2_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_4_2_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_4_2_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -904,13 +824,6 @@ inline void QOpenGLFunctions_4_2_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_4_2_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_2_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
@@ -1976,224 +1889,6 @@ inline void QOpenGLFunctions_4_2_Core::glVertexAttribP1ui(GLuint index, GLenum t
d_3_3_Core->f.VertexAttribP1ui(index, type, normalized, value);
}
-inline void QOpenGLFunctions_4_2_Core::glSecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glSecondaryColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glColorP4uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glColorP4ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glNormalP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glNormalP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP4uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP4ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP2uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP2ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP1uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glTexCoordP1ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP4uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP4ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP3uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP3ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP2uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_2_Core::glVertexP2ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_2_Core::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params)
{
d_3_3_Core->f.GetQueryObjectui64v(id, pname, params);
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 31903bdcf4..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
**
@@ -126,8 +91,6 @@ public:
void glCullFace(GLenum mode);
// OpenGL 1.1 core functions
- void glIndexubv(const GLubyte *c);
- void glIndexub(GLubyte c);
GLboolean glIsTexture(GLuint texture);
void glGenTextures(GLsizei n, GLuint *textures);
void glDeleteTextures(GLsizei n, const GLuint *textures);
@@ -139,7 +102,6 @@ public:
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void glPolygonOffset(GLfloat factor, GLfloat units);
- void glGetPointerv(GLenum pname, GLvoid* *params);
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void glDrawArrays(GLenum mode, GLint first, GLsizei count);
@@ -369,36 +331,6 @@ public:
void glVertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
void glVertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
- void glSecondaryColorP3uiv(GLenum type, const GLuint *color);
- void glSecondaryColorP3ui(GLenum type, GLuint color);
- void glColorP4uiv(GLenum type, const GLuint *color);
- void glColorP4ui(GLenum type, GLuint color);
- void glColorP3uiv(GLenum type, const GLuint *color);
- void glColorP3ui(GLenum type, GLuint color);
- void glNormalP3uiv(GLenum type, const GLuint *coords);
- void glNormalP3ui(GLenum type, GLuint coords);
- void glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords);
- void glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords);
- void glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords);
- void glTexCoordP4uiv(GLenum type, const GLuint *coords);
- void glTexCoordP4ui(GLenum type, GLuint coords);
- void glTexCoordP3uiv(GLenum type, const GLuint *coords);
- void glTexCoordP3ui(GLenum type, GLuint coords);
- void glTexCoordP2uiv(GLenum type, const GLuint *coords);
- void glTexCoordP2ui(GLenum type, GLuint coords);
- void glTexCoordP1uiv(GLenum type, const GLuint *coords);
- void glTexCoordP1ui(GLenum type, GLuint coords);
- void glVertexP4uiv(GLenum type, const GLuint *value);
- void glVertexP4ui(GLenum type, GLuint value);
- void glVertexP3uiv(GLenum type, const GLuint *value);
- void glVertexP3ui(GLenum type, GLuint value);
- void glVertexP2uiv(GLenum type, const GLuint *value);
- void glVertexP2ui(GLenum type, GLuint value);
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void glQueryCounter(GLuint id, GLenum target);
@@ -874,18 +806,6 @@ inline void QOpenGLFunctions_4_3_Core::glCullFace(GLenum mode)
// OpenGL 1.1 core functions
-inline void QOpenGLFunctions_4_3_Core::glIndexubv(const GLubyte *c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glIndexub(GLubyte c)
-{
- Q_UNUSED(c);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline GLboolean QOpenGLFunctions_4_3_Core::glIsTexture(GLuint texture)
{
return d_1_1_Core->f.IsTexture(texture);
@@ -941,13 +861,6 @@ inline void QOpenGLFunctions_4_3_Core::glPolygonOffset(GLfloat factor, GLfloat u
d_1_1_Core->f.PolygonOffset(factor, units);
}
-inline void QOpenGLFunctions_4_3_Core::glGetPointerv(GLenum pname, GLvoid* *params)
-{
- Q_UNUSED(pname);
- Q_UNUSED(params);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_3_Core::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{
d_1_1_Core->f.DrawElements(mode, count, type, indices);
@@ -2013,224 +1926,6 @@ inline void QOpenGLFunctions_4_3_Core::glVertexAttribP1ui(GLuint index, GLenum t
d_3_3_Core->f.VertexAttribP1ui(index, type, normalized, value);
}
-inline void QOpenGLFunctions_4_3_Core::glSecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glSecondaryColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glColorP4uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glColorP4ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glColorP3uiv(GLenum type, const GLuint *color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glColorP3ui(GLenum type, GLuint color)
-{
- Q_UNUSED(type);
- Q_UNUSED(color);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glNormalP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glNormalP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint *coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glMultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
-{
- Q_UNUSED(texture);
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP4uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP4ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP3uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP3ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP2uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP2ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP1uiv(GLenum type, const GLuint *coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glTexCoordP1ui(GLenum type, GLuint coords)
-{
- Q_UNUSED(type);
- Q_UNUSED(coords);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP4uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP4ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP3uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP3ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP2uiv(GLenum type, const GLuint *value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
-inline void QOpenGLFunctions_4_3_Core::glVertexP2ui(GLenum type, GLuint value)
-{
- Q_UNUSED(type);
- Q_UNUSED(value);
- QOPENGL_DEPRECATEDFUNCTION;
-}
-
inline void QOpenGLFunctions_4_3_Core::glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params)
{
d_3_3_Core->f.GetQueryObjectui64v(id, pname, params);
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 811425cf69..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>
@@ -331,7 +295,7 @@ void QOpenGLPaintDevice::setDotsPerMeterX(qreal dpmx)
void QOpenGLPaintDevice::setDotsPerMeterY(qreal dpmy)
{
- d_ptr->dpmx = dpmy;
+ d_ptr->dpmy = dpmy;
}
/*!
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 a3f0a0ca02..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) {
@@ -1364,7 +1361,7 @@ void QOpenGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
return;
QOpenGL2PaintEngineState *s = state();
- if (qt_pen_is_cosmetic(pen, state()->renderHints) && !qt_scaleForTransform(s->transform(), nullptr)) {
+ if (pen.isCosmetic() && !qt_scaleForTransform(s->transform(), nullptr)) {
// QTriangulatingStroker class is not meant to support cosmetically sheared strokes.
QPaintEngineEx::stroke(path, pen);
return;
@@ -1426,7 +1423,7 @@ void QOpenGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &p
? qMax(pen.miterLimit() * width, width)
: width;
- if (qt_pen_is_cosmetic(pen, q->state()->renderHints))
+ if (pen.isCosmetic())
extra = extra * inverseScale;
QRectF bounds = path.controlPointRect().adjusted(-extra, -extra, extra, extra);
@@ -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()
@@ -1572,6 +1574,8 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c
case QImage::Format_RGBA8888:
case QImage::Format_ARGB32:
case QImage::Format_RGBA64:
+ case QImage::Format_RGBA16FPx4:
+ case QImage::Format_RGBA32FPx4:
d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::NonPremultipliedImageSrc);
bindOption = { };
break;
@@ -1745,6 +1749,14 @@ bool QOpenGL2PaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, cons
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
+
+// MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for the code
+// that divides by QOpenGLTextureGlyphCache::height() in release builds.
+// Anyhow, the code path in this method is only executed
+// if height() != 0. Therefore disable the warning.
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4723)
+
void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat glyphFormat,
QStaticTextItem *staticTextItem)
{
@@ -1797,11 +1809,13 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
if (recreateVertexArrays) {
cache->setPaintEnginePrivate(this);
if (!cache->populate(fe, staticTextItem->numGlyphs,
- staticTextItem->glyphs, staticTextItem->glyphPositions)) {
+ staticTextItem->glyphs, staticTextItem->glyphPositions,
+ s->renderHints)) {
// No space for glyphs in cache. We need to reset it and try again.
cache->clear();
cache->populate(fe, staticTextItem->numGlyphs,
- staticTextItem->glyphs, staticTextItem->glyphPositions);
+ staticTextItem->glyphs, staticTextItem->glyphPositions,
+ s->renderHints);
}
if (cache->hasPendingGlyphs()) {
@@ -1874,10 +1888,15 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
textureCoordinates->clear();
bool supportsSubPixelPositions = fe->supportsSubPixelPositions();
+ bool verticalSubPixelPositions = fe->supportsVerticalSubPixelPositions()
+ && (s->renderHints & QPainter::VerticalSubpixelPositioning) != 0;
for (int i=0; i<staticTextItem->numGlyphs; ++i) {
- QFixed subPixelPosition;
- if (supportsSubPixelPositions)
- subPixelPosition = fe->subPixelPositionForX(staticTextItem->glyphPositions[i].x);
+ QFixedPoint subPixelPosition;
+ if (supportsSubPixelPositions) {
+ subPixelPosition = fe->subPixelPositionFor(staticTextItem->glyphPositions[i]);
+ if (!verticalSubPixelPositions)
+ subPixelPosition.y = 0;
+ }
QTextureGlyphCache::GlyphAndSubPixelPosition glyph(staticTextItem->glyphs[i], subPixelPosition);
@@ -1886,7 +1905,10 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
continue;
int x = qFloor(staticTextItem->glyphPositions[i].x.toReal() * cache->transform().m11()) + c.baseLineX - margin;
- int y = qRound(staticTextItem->glyphPositions[i].y.toReal() * cache->transform().m22()) - c.baseLineY - margin;
+ int y = verticalSubPixelPositions
+ ? qRound(staticTextItem->glyphPositions[i].y.toReal() * cache->transform().m22())
+ : qFloor(staticTextItem->glyphPositions[i].y.toReal() * cache->transform().m22());
+ y -= c.baseLineY + margin;
vertexCoordinates->addQuad(QRectF(x, y, c.w, c.h));
textureCoordinates->addQuad(QRectF(c.x*dx, c.y*dy, c.w * dx, c.h * dy));
@@ -2050,6 +2072,8 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
#endif
}
+QT_WARNING_POP
+
void QOpenGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
QPainter::PixmapFragmentHints hints)
{
@@ -2127,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);
@@ -2193,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)
@@ -2324,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 {
@@ -2496,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 252c2a2f1e..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
@@ -55,8 +19,7 @@ class Q_OPENGL_EXPORT QOpenGLPixelTransferOptions
public:
QOpenGLPixelTransferOptions();
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
- QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) noexcept
- { swap(other); return *this; }
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpenGLPixelTransferOptions)
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
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 cdf2494505..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);
@@ -4258,10 +4228,11 @@ QOpenGLTexture::DepthStencilMode QOpenGLTexture::depthStencilMode() const
\value CompareLess Equivalent to GL_LESS.
\value CompareGreater Equivalent to GL_GREATER.
\value CompareEqual Equivalent to GL_EQUAL.
- \value CommpareNotEqual Equivalent to GL_NOTEQUAL.
+ \value CompareNotEqual Equivalent to GL_NOTEQUAL.
\value CompareAlways Equivalent to GL_ALWAYS.
\value CompareNever Equivalent to GL_NEVER.
+ \omitvalue CommpareNotEqual
*/
/*!
@@ -4456,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()
*/
@@ -4871,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 28bd5a07cc..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
@@ -550,9 +514,14 @@ public:
CompareLess = 0x0201, // GL_LESS
CompareGreater = 0x0204, // GL_GREATER
CompareEqual = 0x0202, // GL_EQUAL
- CommpareNotEqual = 0x0205, // GL_NOTEQUAL
+ CompareNotEqual = 0x0205, // GL_NOTEQUAL
CompareAlways = 0x0207, // GL_ALWAYS
- CompareNever = 0x0200 // GL_NEVER
+ CompareNever = 0x0200, // GL_NEVER
+
+#if QT_DEPRECATED_SINCE(6, 1)
+ CommpareNotEqual Q_DECL_ENUMERATOR_DEPRECATED_X(
+ "Use CompareNotEqual instead.") = CompareNotEqual
+#endif
};
Q_ENUM(ComparisonFunction)
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 a38d4328cc..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);
}
@@ -421,7 +385,9 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
}
}
-void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition)
+void QOpenGLTextureGlyphCache::fillTexture(const Coord &c,
+ glyph_t glyph,
+ const QFixedPoint &subPixelPosition)
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (ctx == nullptr) {
@@ -441,7 +407,10 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
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 15ecd6209b..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
@@ -115,7 +79,9 @@ public:
virtual void createTextureData(int width, int height) override;
virtual void resizeTextureData(int width, int height) override;
- virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override;
+ virtual void fillTexture(const Coord &c,
+ glyph_t glyph,
+ const QFixedPoint &subPixelPosition) override;
virtual int glyphPadding() const override;
virtual int maxTextureWidth() const override;
virtual int maxTextureHeight() const override;
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 469ddc56c1..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"
@@ -45,6 +9,10 @@
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
+#ifndef GL_HALF_FLOAT
+#define GL_HALF_FLOAT 0x140B
+#endif
+
#ifndef GL_RED
#define GL_RED 0x1903
#endif
@@ -81,6 +49,14 @@
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#endif
+#ifndef GL_RGBA16F
+#define GL_RGBA16F 0x881A
+#endif
+
+#ifndef GL_RGBA32F
+#define GL_RGBA32F 0x8814
+#endif
+
#ifndef GL_TEXTURE_SWIZZLE_R
#define GL_TEXTURE_SWIZZLE_R 0x8E42
#endif
@@ -236,6 +212,25 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
pixelType = GL_UNSIGNED_SHORT;
targetFormat = image.format();
break;
+ case QImage::Format_RGBX16FPx4:
+ case QImage::Format_RGBA16FPx4:
+ case QImage::Format_RGBA16FPx4_Premultiplied:
+ if (context->format().majorVersion() >= 3) {
+ externalFormat = GL_RGBA;
+ internalFormat = GL_RGBA16F;
+ pixelType = GL_HALF_FLOAT;
+ targetFormat = image.format();
+ }
+ break;
+ case QImage::Format_RGBX32FPx4:
+ case QImage::Format_RGBA32FPx4:
+ case QImage::Format_RGBA32FPx4_Premultiplied:
+ externalFormat = internalFormat = GL_RGBA;
+ if (context->format().majorVersion() >= 3)
+ internalFormat = GL_RGBA32F;
+ pixelType = GL_FLOAT;
+ targetFormat = image.format();
+ break;
case QImage::Format_Indexed8:
if (sRgbBinding) {
// Always needs conversion
@@ -333,6 +328,10 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
targetFormat = QImage::Format_RGBA8888_Premultiplied;
else if (targetFormat == QImage::Format_RGBA64)
targetFormat = QImage::Format_RGBA64_Premultiplied;
+ else if (targetFormat == QImage::Format_RGBA16FPx4)
+ targetFormat = QImage::Format_RGBA16FPx4_Premultiplied;
+ else if (targetFormat == QImage::Format_RGBA32FPx4)
+ targetFormat = QImage::Format_RGBA32FPx4_Premultiplied;
} else {
if (targetFormat == QImage::Format_ARGB32_Premultiplied)
targetFormat = QImage::Format_ARGB32;
@@ -340,6 +339,10 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
targetFormat = QImage::Format_RGBA8888;
else if (targetFormat == QImage::Format_RGBA64_Premultiplied)
targetFormat = QImage::Format_RGBA64;
+ else if (targetFormat == QImage::Format_RGBA16FPx4_Premultiplied)
+ targetFormat = QImage::Format_RGBA16FPx4;
+ else if (targetFormat == QImage::Format_RGBA32FPx4_Premultiplied)
+ targetFormat = QImage::Format_RGBA32FPx4;
}
if (sRgbBinding) {
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 64d9d11218..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;
@@ -247,9 +212,9 @@ void QAbstractOpenGLFunctionsPrivate::removeExternalFunctions(QOpenGLContext *co
A pointer to an object of the class corresponding to the version and
profile of OpenGL in use can be obtained from
- QOpenGLContext::versionFunctions(). If obtained in this way, note that
- the QOpenGLContext retains ownership of the object. This is so that only
- one instance need be created.
+ QOpenGLVersionFunctionsFactory::get(). If obtained in this way, note that
+ the QOpenGLContext retains ownership of the object. This is so that the
+ instance can be cached and shared.
Before calling any of the exposed OpenGL functions you must ensure that the
object has resolved the function pointers to the OpenGL functions. This
@@ -266,7 +231,7 @@ void QAbstractOpenGLFunctionsPrivate::removeExternalFunctions(QOpenGLContext *co
profile. This is obviously a lot easier to debug than undefined behavior
at run time.
- \sa QOpenGLContext::versionFunctions()
+ \sa QOpenGLVersionFunctionsFactory::get()
*/
/*!
Constructs a QAbstractOpenGLFunctions object.
diff --git a/src/opengl/qopenglversionfunctions.h b/src/opengl/qopenglversionfunctions.h
index 546f3f3e41..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
**
@@ -54,9 +19,6 @@
#ifndef QT_NO_OPENGL
-#if QT_DEPRECATED_SINCE(5, 6)
-#include <QtCore/qhash.h>
-#endif
#include <QtCore/qhashfunctions.h>
#include <QtCore/qpair.h>
#include <QtGui/qopengl.h>
@@ -77,10 +39,6 @@ class QOpenGLContext;
#pragma qt_sync_stop_processing
#endif
-#define QOPENGL_DEPRECATEDFUNCTION \
- qFatal("This function was erroneously included in previous versions of Qt and is here only for binary compatibility. " \
- "If you need to use this function, please use a legacy OpenGL version or a Compatibility profile.")
-
struct QOpenGLVersionStatus
{
enum OpenGLStatus {
@@ -101,6 +59,16 @@ struct QOpenGLVersionStatus
QPair<int, int> version;
OpenGLStatus status;
+
+ friend constexpr bool operator==(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs) noexcept
+ {
+ return lhs.status == rhs.status && lhs.version == rhs.version;
+ }
+
+ friend constexpr bool operator!=(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs) noexcept
+ {
+ return !(lhs == rhs);
+ }
};
inline size_t qHash(const QOpenGLVersionStatus &v, size_t seed = 0) noexcept
@@ -109,16 +77,6 @@ inline size_t qHash(const QOpenGLVersionStatus &v, size_t seed = 0) noexcept
+ v.version.first * 100 + v.version.second * 10, seed);
}
-constexpr inline bool operator==(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
-{
- return lhs.status == rhs.status && lhs.version == rhs.version;
-}
-
-constexpr inline bool operator!=(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
-{
- return !operator==(lhs, rhs);
-}
-
#define QT_OPENGL_DECLARE_FUNCTIONS(ret, name, args) \
ret (QOPENGLF_APIENTRYP name)args;
#define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1
@@ -1221,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 d377c64961..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
**
@@ -162,7 +127,15 @@ static QAbstractOpenGLFunctions *createFunctions(const QOpenGLVersionProfile &ve
}
/*!
- \fn static T *QOpenGLVersionFunctionsFactory::get(QOpenGLContext *context)
+ \class QOpenGLVersionFunctionsFactory
+ \inmodule QtOpenGL
+ \since 6.0
+ \brief Provides access to OpenGL functions for a specified version and
+ profile.
+*/
+
+/*!
+ \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 fdc531692a..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
@@ -45,9 +9,6 @@
#include <QtGui/QSurfaceFormat>
#include <QtCore/QPair>
-#if QT_DEPRECATED_SINCE(5, 6)
-#include <QtCore/qhash.h>
-#endif
#include <QtCore/qhashfunctions.h>
QT_BEGIN_NAMESPACE
@@ -77,25 +38,26 @@ public:
private:
QOpenGLVersionProfilePrivate* d;
+
+ friend bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
+ {
+ if (lhs.profile() != rhs.profile())
+ return false;
+ return lhs.version() == rhs.version();
+ }
+
+ friend bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs) noexcept
+ {
+ return !operator==(lhs, rhs);
+ }
};
-inline size_t qHash(const QOpenGLVersionProfile &v, size_t seed = 0)
+inline size_t qHash(const QOpenGLVersionProfile &v, size_t seed = 0) noexcept
{
return qHash(static_cast<int>(v.profile() * 1000)
+ v.version().first * 100 + v.version().second * 10, seed);
}
-inline bool operator==(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs)
-{
- if (lhs.profile() != rhs.profile())
- return false;
- return lhs.version() == rhs.version();
-}
-
-inline bool operator!=(const QOpenGLVersionProfile &lhs, const QOpenGLVersionProfile &rhs)
-{
- return !operator==(lhs, rhs);
-}
#ifndef QT_NO_DEBUG_STREAM
Q_OPENGL_EXPORT QDebug operator<<(QDebug debug, const QOpenGLVersionProfile &vp);
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 46e36c23d4..0000000000
--- a/src/opengl/qplatformbackingstoreopenglsupport.cpp
+++ /dev/null
@@ -1,464 +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()) {
- 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 3c3043d3d4..0000000000
--- a/src/opengl/qtopengl.tracepoints
+++ /dev/null
@@ -1,3 +0,0 @@
-QOpenGLFramebufferObjectPrivate_init(QOpenGLFramebufferObject *qfbo, const QSize &size, QOpenGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples, bool mipmap)
-QOpenGL2PaintEngineExPrivate_drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
-QOpenGLTextureCache_bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)
diff --git a/src/opengl/qtopenglglobal.h b/src/opengl/qtopenglglobal.h
index 861fb16d59..a46f98e0bd 100644
--- a/src/opengl/qtopenglglobal.h
+++ b/src/opengl/qtopenglglobal.h
@@ -1,60 +1,11 @@
-/****************************************************************************
-**
-** 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
#include <QtCore/qglobal.h>
#include <QtGui/qtguiglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_STATIC
-# if defined(QT_BUILD_OPENGL_LIB)
-# define Q_OPENGL_EXPORT Q_DECL_EXPORT
-# else
-# define Q_OPENGL_EXPORT Q_DECL_IMPORT
-# endif
-#else
-# define Q_OPENGL_EXPORT
-#endif
-
-QT_END_NAMESPACE
+#include <QtOpenGL/qtopenglexports.h>
#endif // 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