From 2344e5cc3104b7d599f4d2a96bbfd8530223a08e Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 12 Dec 2019 08:51:20 +0100 Subject: [PATCH] Move QOpenGLTexture and related classes from QtGui to QtOpenGL Task-number: QTBUG-74409 Change-Id: Ied825dd7cb92365505a4aa43fd67488024160341 Reviewed-by: Laszlo Agocs Reviewed-by: Qt CI Bot --- src/gui/opengl/opengl.pri | 7 ------- src/opengl/opengl.pro | 7 +++++++ src/{gui => }/opengl/qopenglpixeltransferoptions.cpp | 2 +- src/{gui => }/opengl/qopenglpixeltransferoptions.h | 6 +++--- src/{gui => }/opengl/qopengltexture.cpp | 0 src/{gui => }/opengl/qopengltexture.h | 10 +++++----- src/{gui => }/opengl/qopengltexture_p.h | 4 ++-- src/{gui => }/opengl/qopengltexturehelper.cpp | 2 +- src/{gui => }/opengl/qopengltexturehelper_p.h | 4 ++-- src/platformsupport/vkconvenience/qvkconvenience.cpp | 4 +++- src/platformsupport/vkconvenience/vkconvenience.pro | 2 ++ src/plugins/platforms/wasm/qwasmbackingstore.cpp | 2 +- src/plugins/platforms/wasm/qwasmcompositor.cpp | 2 +- src/plugins/platforms/wasm/qwasmcompositor.h | 2 +- src/plugins/platforms/wasm/wasm.pro | 1 + src/src.pro | 1 + tests/auto/gui/qopengl/tst_qopengl.cpp | 2 +- 17 files changed, 32 insertions(+), 26 deletions(-) rename src/{gui => }/opengl/qopenglpixeltransferoptions.cpp (99%) rename src/{gui => }/opengl/qopenglpixeltransferoptions.h (95%) rename src/{gui => }/opengl/qopengltexture.cpp (100%) rename src/{gui => }/opengl/qopengltexture.h (99%) rename src/{gui => }/opengl/qopengltexture_p.h (98%) rename src/{gui => }/opengl/qopengltexturehelper.cpp (99%) rename src/{gui => }/opengl/qopengltexturehelper_p.h (99%) diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri index d9f0e0d6cc7..f1e20194172 100644 --- a/src/gui/opengl/opengl.pri +++ b/src/gui/opengl/opengl.pri @@ -17,10 +17,6 @@ qtConfig(opengl) { opengl/qopenglversionfunctionsfactory_p.h \ opengl/qopenglvertexarrayobject.h \ opengl/qopengltextureblitter.h \ - opengl/qopengltexture.h \ - opengl/qopengltexture_p.h \ - opengl/qopengltexturehelper_p.h \ - opengl/qopenglpixeltransferoptions.h \ opengl/qopenglextrafunctions.h \ opengl/qopenglprogrambinarycache_p.h @@ -33,9 +29,6 @@ qtConfig(opengl) { opengl/qopenglversionfunctionsfactory.cpp \ opengl/qopenglvertexarrayobject.cpp \ opengl/qopengltextureblitter.cpp \ - opengl/qopengltexture.cpp \ - opengl/qopengltexturehelper.cpp \ - opengl/qopenglpixeltransferoptions.cpp \ opengl/qopenglprogrambinarycache.cpp !qtConfig(opengles2) { diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 6c2a9698209..ba9590ec073 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -19,7 +19,11 @@ HEADERS += \ qopenglpaintdevice.h \ qopenglpaintdevice_p.h \ qopenglpaintengine_p.h \ + qopenglpixeltransferoptions.h \ qopenglshadercache_p.h \ + qopengltexture.h \ + qopengltexture_p.h \ + qopengltexturehelper_p.h \ qopengltexturecache_p.h \ qopengltextureglyphcache_p.h \ qopengltextureuploader_p.h \ @@ -33,6 +37,9 @@ SOURCES += \ qopenglgradientcache.cpp \ qopenglpaintdevice.cpp \ qopenglpaintengine.cpp \ + qopenglpixeltransferoptions.cpp \ + qopengltexture.cpp \ + qopengltexturehelper.cpp \ qopengltexturecache.cpp \ qopengltextureglyphcache.cpp \ qopengltextureuploader.cpp \ diff --git a/src/gui/opengl/qopenglpixeltransferoptions.cpp b/src/opengl/qopenglpixeltransferoptions.cpp similarity index 99% rename from src/gui/opengl/qopenglpixeltransferoptions.cpp rename to src/opengl/qopenglpixeltransferoptions.cpp index b0d953d76b1..aa1af3b092f 100644 --- a/src/gui/opengl/qopenglpixeltransferoptions.cpp +++ b/src/opengl/qopenglpixeltransferoptions.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/opengl/qopenglpixeltransferoptions.h similarity index 95% rename from src/gui/opengl/qopenglpixeltransferoptions.h rename to src/opengl/qopenglpixeltransferoptions.h index 195543ae903..252c2a2f1e4 100644 --- a/src/gui/opengl/qopenglpixeltransferoptions.h +++ b/src/opengl/qopenglpixeltransferoptions.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -40,7 +40,7 @@ #ifndef QOPENGLPIXELUPLOADOPTIONS_H #define QOPENGLPIXELUPLOADOPTIONS_H -#include +#include #if !defined(QT_NO_OPENGL) @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE class QOpenGLPixelTransferOptionsData; -class Q_GUI_EXPORT QOpenGLPixelTransferOptions +class Q_OPENGL_EXPORT QOpenGLPixelTransferOptions { public: QOpenGLPixelTransferOptions(); diff --git a/src/gui/opengl/qopengltexture.cpp b/src/opengl/qopengltexture.cpp similarity index 100% rename from src/gui/opengl/qopengltexture.cpp rename to src/opengl/qopengltexture.cpp diff --git a/src/gui/opengl/qopengltexture.h b/src/opengl/qopengltexture.h similarity index 99% rename from src/gui/opengl/qopengltexture.h rename to src/opengl/qopengltexture.h index 539b6aa7b20..8eba2724df5 100644 --- a/src/gui/opengl/qopengltexture.h +++ b/src/opengl/qopengltexture.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -40,7 +40,7 @@ #ifndef QOPENGLABSTRACTTEXTURE_H #define QOPENGLABSTRACTTEXTURE_H -#include +#include #ifndef QT_NO_OPENGL @@ -54,7 +54,7 @@ class QDebug; class QOpenGLTexturePrivate; class QOpenGLPixelTransferOptions; -class Q_GUI_EXPORT QOpenGLTexture +class Q_OPENGL_EXPORT QOpenGLTexture { Q_GADGET public: @@ -641,7 +641,7 @@ public: float levelofDetailBias() const; #ifndef QT_NO_DEBUG_STREAM - friend Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QOpenGLTexture *t); + friend Q_OPENGL_EXPORT QDebug operator<<(QDebug dbg, const QOpenGLTexture *t); #endif private: @@ -653,7 +653,7 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTexture::Features) #ifndef QT_NO_DEBUG_STREAM -Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QOpenGLTexture *t); +Q_OPENGL_EXPORT QDebug operator<<(QDebug debug, const QOpenGLTexture *t); #endif QT_END_NAMESPACE diff --git a/src/gui/opengl/qopengltexture_p.h b/src/opengl/qopengltexture_p.h similarity index 98% rename from src/gui/opengl/qopengltexture_p.h rename to src/opengl/qopengltexture_p.h index 9f3457ad0a0..1dc08016443 100644 --- a/src/gui/opengl/qopengltexture_p.h +++ b/src/opengl/qopengltexture_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -53,7 +53,7 @@ #ifndef QT_NO_OPENGL -#include +#include #include "private/qobject_p.h" #include "qopengltexture.h" #include "qopengl.h" diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/opengl/qopengltexturehelper.cpp similarity index 99% rename from src/gui/opengl/qopengltexturehelper.cpp rename to src/opengl/qopengltexturehelper.cpp index 6709edc4e2b..8f1473ecc9d 100644 --- a/src/gui/opengl/qopengltexturehelper.cpp +++ b/src/opengl/qopengltexturehelper.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/opengl/qopengltexturehelper_p.h similarity index 99% rename from src/gui/opengl/qopengltexturehelper_p.h rename to src/opengl/qopengltexturehelper_p.h index 62d0125daff..a62a47d0290 100644 --- a/src/gui/opengl/qopengltexturehelper_p.h +++ b/src/opengl/qopengltexturehelper_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB). ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -51,7 +51,7 @@ // We mean it. // -#include +#include #ifndef QT_NO_OPENGL diff --git a/src/platformsupport/vkconvenience/qvkconvenience.cpp b/src/platformsupport/vkconvenience/qvkconvenience.cpp index acde1d1bda6..59de3353339 100644 --- a/src/platformsupport/vkconvenience/qvkconvenience.cpp +++ b/src/platformsupport/vkconvenience/qvkconvenience.cpp @@ -39,7 +39,9 @@ #include "qvkconvenience_p.h" -#include +#if QT_CONFIG(opengl) +#include +#endif QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/vkconvenience/vkconvenience.pro b/src/platformsupport/vkconvenience/vkconvenience.pro index ee540024cff..f3ada5768a6 100644 --- a/src/platformsupport/vkconvenience/vkconvenience.pro +++ b/src/platformsupport/vkconvenience/vkconvenience.pro @@ -2,6 +2,8 @@ TARGET = QtVulkanSupport MODULE = vulkan_support QT = core-private gui-private +qtConfig(opengl): QT += opengl + CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII diff --git a/src/plugins/platforms/wasm/qwasmbackingstore.cpp b/src/plugins/platforms/wasm/qwasmbackingstore.cpp index 7e8a3825124..a7423e9c47e 100644 --- a/src/plugins/platforms/wasm/qwasmbackingstore.cpp +++ b/src/plugins/platforms/wasm/qwasmbackingstore.cpp @@ -31,7 +31,7 @@ #include "qwasmwindow.h" #include "qwasmcompositor.h" -#include +#include #include #include #include diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index e9c45599716..6bf0d697707 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -31,7 +31,7 @@ #include "qwasmwindow.h" #include "qwasmstylepixmaps_p.h" -#include +#include #include #include diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h index 98f4a79b27e..6b59d87a0a2 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.h +++ b/src/plugins/platforms/wasm/qwasmcompositor.h @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -43,6 +42,7 @@ QT_BEGIN_NAMESPACE class QWasmWindow; class QWasmScreen; class QOpenGLContext; +class QOpenGLTexture; class QOpenGLTextureBlitter; class QWasmCompositedWindow diff --git a/src/plugins/platforms/wasm/wasm.pro b/src/plugins/platforms/wasm/wasm.pro index f8c81755257..9087c484d50 100644 --- a/src/plugins/platforms/wasm/wasm.pro +++ b/src/plugins/platforms/wasm/wasm.pro @@ -50,6 +50,7 @@ wasmfonts.base = ../../../3rdparty/wasm RESOURCES += wasmfonts qtConfig(opengl) { + QT += opengl SOURCES += qwasmbackingstore.cpp HEADERS += qwasmbackingstore.h } diff --git a/src/src.pro b/src/src.pro index 0b8ae6d3084..3445ca0faba 100644 --- a/src/src.pro +++ b/src/src.pro @@ -221,6 +221,7 @@ qtConfig(gui) { SUBDIRS += src_openglextensions SUBDIRS += src_opengl src_plugins.depends += src_opengl + src_platformsupport.depends += src_opengl } src_plugins.depends += src_gui src_platformsupport src_platformheaders src_testlib.depends += src_gui # if QtGui is enabled, QtTest requires QtGui's headers diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index 3b39c8c4740..3a7ad6dad54 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -27,13 +27,13 @@ ****************************************************************************/ #include +#include #include #include #include #include #include #include -#include #include #include #include